Navigation Menu

Skip to content

Commit

Permalink
Unix.isatty: use caml_win32_isatty under Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
nojb committed Nov 18, 2017
1 parent 0669c40 commit 0f57ee8
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions otherlibs/win32unix/isatty.c
Expand Up @@ -12,13 +12,12 @@
/* */
/**************************************************************************/

#define CAML_INTERNALS

#include <caml/mlvalues.h>
#include "unixsupport.h"
#include <caml/osdeps.h>

CAMLprim value unix_isatty(value fd)
{
DWORD lpMode;
HANDLE hFile = Handle_val(fd);
return (Val_bool((GetFileType(hFile) == FILE_TYPE_CHAR)
&& GetConsoleMode(hFile, &lpMode)));
return Val_bool(caml_win32_isatty(Int_val(fd)));
}

0 comments on commit 0f57ee8

Please sign in to comment.