OSDN Git Service

* fhandler_tty.cc (fhandler_pty_slave::open): Clarify debugging output.
authorcgf <cgf>
Mon, 10 Oct 2011 04:05:28 +0000 (04:05 +0000)
committercgf <cgf>
Mon, 10 Oct 2011 04:05:28 +0000 (04:05 +0000)
(fhandler_pty_slave::open): Change ENOENT to ENXIO when can't open a tty.

winsup/cygwin/ChangeLog
winsup/cygwin/fhandler_tty.cc

index 186f22f..c47b9e4 100644 (file)
@@ -1,3 +1,9 @@
+2011-10-10  Christopher Faylor  <me.cygwin2011@cgf.cx>
+
+       * fhandler_tty.cc (fhandler_pty_slave::open): Clarify debugging output.
+       (fhandler_pty_slave::open): Change ENOENT to ENXIO when can't open a
+       tty.
+
 2011-10-07  Corinna Vinschen  <corinna@vinschen.de>
            Christopher Faylor  <me.cygwin2011@cgf.cx>
 
index 5236430..0d16130 100644 (file)
@@ -457,7 +457,7 @@ fhandler_pty_slave::open (int flags, mode_t)
        {
          pty_owner = OpenProcess (PROCESS_DUP_HANDLE, FALSE, p->dwProcessId);
          if (pty_owner)
-           termios_printf ("dup handles directly since I'm allmighty.");
+           termios_printf ("dup handles directly since I'm the owner");
        }
     }
   if (pty_owner)
@@ -522,7 +522,10 @@ fhandler_pty_slave::open (int flags, mode_t)
   return 1;
 
 err:
-  __seterrno ();
+  if (GetLastError () == ERROR_FILE_NOT_FOUND)
+    set_errno (ENXIO);
+  else
+    __seterrno ();
 err_no_errno:
   termios_printf (errmsg);
 err_no_msg: