/* checkcon.c (rsxnt) -- Copyright (c) 1996-1997 Rainer Schnitker */

#include "rsxnt.h"

void _rsxnt_check_console_handle(EMXPROCESS *p, int fd)
{
    DWORD device = 0xffffffff;

    if (p->bConsoleApp == FALSE || fd > 2)
	return;

    if (fd == 0)
	device = STD_INPUT_HANDLE;
    if (fd == 1)
	device = STD_OUTPUT_HANDLE;
    if (fd == 2)
	device = STD_ERROR_HANDLE;

    SetStdHandle(device, p->file[fd].f_handle);
}
