bug-gnulib
[Top][All Lists]
Advanced

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

Re: portable openpty, forkpty


From: Bruno Haible
Subject: Re: portable openpty, forkpty
Date: Fri, 16 Apr 2010 02:42:16 +0200
User-agent: KMail/1.9.9

Simon Josefsson wrote:
> HAVE_OPENPTY is not set in config.h though -- isn't that a bug?  The
> system has openpty.
> ...
> Single stepping rpl_openpty:
> 
>   master = open ("/dev/ptmx", O_RDWR | O_NOCTTY);
>   if (master < 0)
> =>  return -1;
> 
> And indeed my Mac OS X system doesn't have /dev/ptmx:

In the case the system does not have /dev/ptmx and has an openpty function,
the safest approach is to use that functions - we don't know which device
files it may try.

But this works only if HAVE_OPENPTY is defined, and - you're right - the
problem is that it does not get defined.

This should fix it:


2010-04-15  Bruno Haible  <address@hidden>

        openpty: Fix mistake from 2010-03-21.
        * m4/pty.m4 (gl_FUNC_OPENPTY): Define HAVE_OPENPTY when openpty exists.
        Reported by Simon Josefsson.

--- m4/pty.m4.orig      Fri Apr 16 02:37:59 2010
+++ m4/pty.m4   Fri Apr 16 02:37:57 2010
@@ -1,4 +1,4 @@
-# pty.m4 serial 6
+# pty.m4 serial 7
 dnl Copyright (C) 2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -119,6 +119,8 @@
     if test $gl_cv_func_openpty_const != yes; then
       REPLACE_OPENPTY=1
       AC_LIBOBJ([openpty])
+      AC_DEFINE([HAVE_OPENPTY], [1],
+        [Define to 1 if the system has the 'openpty' function.])
     fi
   else
     dnl The system does not have openpty.




reply via email to

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