qemacs-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemacs-commit] qemacs shell.c


From: Charlie Gordon
Subject: [Qemacs-commit] qemacs shell.c
Date: Sat, 12 Apr 2008 08:13:20 +0000

CVSROOT:        /cvsroot/qemacs
Module name:    qemacs
Changes by:     Charlie Gordon <chqrlie>        08/04/12 08:13:20

Modified files:
        .              : shell.c 

Log message:
        no longer use non portable ptsname_r reentrant version of ptsname

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemacs/shell.c?cvsroot=qemacs&r1=1.53&r2=1.54

Patches:
Index: shell.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/shell.c,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -b -r1.53 -r1.54
--- shell.c     10 Apr 2008 20:57:25 -0000      1.53
+++ shell.c     12 Apr 2008 08:13:19 -0000      1.54
@@ -97,7 +97,14 @@
 
     /* First try Unix98 pseudo tty master */
     if ((fd = open("/dev/ptmx", O_RDWR)) >= 0) {
-#ifdef CONFIG_CYGWIN
+#if 0
+        /* ptsname_r is a sensible renentrant version of ptsname, but
+         * it lacks portability, notably on FreeBSD and cygwin. So we
+         * have to use ill conceived ptsname.
+         */
+        if (!ptsname_r(fd, tty_str, size) && !grantpt(fd) && !unlockpt(fd))
+            return fd;
+#else
         const char *name = ptsname(fd);
 
         if (name) {
@@ -105,9 +112,6 @@
             if (!grantpt(fd) && !unlockpt(fd))
                 return fd;
         }
-#else
-        if (!ptsname_r(fd, tty_str, size) && !grantpt(fd) && !unlockpt(fd))
-            return fd;
 #endif
         close(fd);
     }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]