bug-coreutils
[Top][All Lists]
Advanced

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

minor gnulib fixups to help port latest coreutils to Solaris 10


From: Paul Eggert
Subject: minor gnulib fixups to help port latest coreutils to Solaris 10
Date: Tue, 20 Feb 2007 23:56:03 -0800
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)

I installed this to work around some porting problems on Solaris 10.
dirfd needs declaring.  And cc complains about rpl_putenv being
redeclared with a different type, since Solaris 10 header files
declare it with a char * arg.

2007-02-20  Paul Eggert  <address@hidden>

        Minor fixups to port to Solaris 10 with Sun C 5.8.
        * lib/getcwd.c [!_LIBC]: Include dirfd.h, since we use dirfd.
        * modules/getcwd (Depends-on): Add dirfd.
        * lib/putenv.c (putenv): #undef it.
        (rpl_putenv): New decl.
        (malloc, free): Include <stdlib.h> rather than prototyping separately.

Index: lib/getcwd.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/getcwd.c,v
retrieving revision 1.20
diff -u -p -r1.20 getcwd.c
--- lib/getcwd.c        19 Feb 2007 20:03:22 -0000      1.20
+++ lib/getcwd.c        21 Feb 2007 07:53:52 -0000
@@ -19,6 +19,7 @@
 #if !_LIBC
 # include <config.h>
 # include <unistd.h>
+# include "dirfd.h"
 #endif

 #include <errno.h>
Index: lib/putenv.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/putenv.c,v
retrieving revision 1.32
diff -u -p -r1.32 putenv.c
--- lib/putenv.c        13 Sep 2006 22:38:14 -0000      1.32
+++ lib/putenv.c        21 Feb 2007 07:53:52 -0000
@@ -20,6 +20,12 @@

 #include <config.h>

+/* undef putenv here, because some (e.g., Solaris 10) declare putenv in
+   with a non-const argument.  That would conflict with the declaration of
+   rpl_putenv below (due to the #define putenv rpl_putenv from config.h).  */
+#undef putenv
+int rpl_putenv (char const *);
+
 #include <stddef.h>

 /* Include errno.h *after* sys/types.h to work around header problems
@@ -29,15 +35,8 @@
 # define __set_errno(ev) ((errno) = (ev))
 #endif

-/* Don't include stdlib.h because some (e.g., Solaris 7) declare putenv
-   with a non-const argument.  That would conflict with the declaration of
-   rpl_putenv below (due to the #define putenv rpl_putenv from config.h).  */
-
-void *malloc ();
-void free ();
-
+#include <stdlib.h>
 #include <string.h>
-
 #include <unistd.h>

 #if HAVE_GNU_LD
Index: modules/getcwd
===================================================================
RCS file: /cvsroot/gnulib/gnulib/modules/getcwd,v
retrieving revision 1.13
diff -u -p -r1.13 getcwd
--- modules/getcwd      19 Feb 2007 02:24:42 -0000      1.13
+++ modules/getcwd      21 Feb 2007 07:53:52 -0000
@@ -10,6 +10,7 @@ m4/getcwd.m4
 Depends-on:
 mempcpy
 d-ino
+dirfd
 extensions
 stdbool
 unistd




reply via email to

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