]> code.delx.au - gnu-emacs/blobdiff - src/s/sol2-3.h
(LIBS_SYSTEM): Define this.
[gnu-emacs] / src / s / sol2-3.h
index 891f7cded8b56059a77e4bd3b0fcd3e7007a337d..9d9018aa0be7e29aaf570b29b1ccf407621b7cca 100644 (file)
 #undef PTY_TTY_NAME_SPRINTF
 #define PTY_TTY_NAME_SPRINTF                   \
   {                                            \
-    char *ptsname(), *ptyname;                 \
+    char *ptsname (), *ptyname;                        \
                                                \
-    sigblock(sigmask(SIGCLD));                 \
-    if (grantpt(fd) == -1)                     \
-      fatal("could not grant slave pty");      \
-    sigunblock(sigmask(SIGCLD));               \
-    if (unlockpt(fd) == -1)                    \
-      fatal("could not unlock slave pty");     \
-    if (!(ptyname = ptsname(fd)))              \
-      fatal ("could not enable slave pty");    \
-    strncpy(pty_name, ptyname, sizeof(pty_name)); \
-    pty_name[sizeof(pty_name) - 1] = 0;                \
+    sigblock (sigmask (SIGCLD));               \
+    if (grantpt (fd) == -1)                    \
+      { close (fd); return -1; }               \
+    sigunblock (sigmask (SIGCLD));             \
+    if (unlockpt (fd) == -1)                   \
+      { close (fd); return -1; }               \
+    if (!(ptyname = ptsname (fd)))             \
+      { close (fd); return -1; }               \
+    strncpy (pty_name, ptyname, sizeof (pty_name)); \
+    pty_name[sizeof (pty_name) - 1] = 0;       \
   }
-
-/* David Miller <davem@caip.rutgers.edu> says vfork fails on 2.4.  */
-/* Brendan Kehoe <brendan@zen.org> says it also fails on 2.3.  */
-#undef HAVE_VFORK