bug-gnulib
[Top][All Lists]
Advanced

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

[PATCH] test-forkpty: fix expected signature


From: Eric Blake
Subject: [PATCH] test-forkpty: fix expected signature
Date: Thu, 15 Apr 2010 07:57:23 -0600

* tests/test-forkpty.c (SIGNATURE_CHECK): Add appropriate const.
Reported by Simon Josefsson.

Signed-off-by: Eric Blake <address@hidden>
---

> I get a warning during compile though:
> 
> test-forkpty.c:24: warning: initialization from incompatible pointer type
> 

Oops - bug on my part.  I'm pushing this.

> According to the Mac OS X manpage the signature is:
> 
>      pid_t
>      forkpty(int *amaster, char *name, struct termios *termp,
>          struct winsize *winp);
> 
> Libc has this signature:
> 
> extern int forkpty (int *__amaster, char *__name,
>                     const struct termios *__termp,
>                     const struct winsize *__winp) __THROW;
> 
> Is pid_t and int guaranteed to be the same size?

No, they are not necessarily the same size.

But at this point, I haven't spent any time trying to tackle the MacOS
issues, just the signature check.

 ChangeLog            |    6 ++++++
 tests/test-forkpty.c |    4 ++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 7098e41..61d9292 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-04-15  Eric Blake  <address@hidden>
+
+       test-forkpty: fix expected signature
+       * tests/test-forkpty.c (SIGNATURE_CHECK): Add appropriate const.
+       Reported by Simon Josefsson.
+
 2010-04-15  Jim Meyering  <address@hidden>

        maint.mk: texinfo_suffix_re_: correct the default regexp
diff --git a/tests/test-forkpty.c b/tests/test-forkpty.c
index d87a107..bbccb22 100644
--- a/tests/test-forkpty.c
+++ b/tests/test-forkpty.c
@@ -21,8 +21,8 @@
 #include <pty.h>

 #include "signature.h"
-SIGNATURE_CHECK (forkpty, int, (int *, char *, struct termios *,
-                                struct winsize *));
+SIGNATURE_CHECK (forkpty, int, (int *, char *, struct termios const *,
+                                struct winsize const *));

 #include <stdio.h>

-- 
1.6.6.1





reply via email to

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