bug-gnulib
[Top][All Lists]
Advanced

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

[Bug-gnulib] mkdir, rmdir, savedir patches to assume C89 or better


From: Paul Eggert
Subject: [Bug-gnulib] mkdir, rmdir, savedir patches to assume C89 or better
Date: 09 Sep 2003 15:29:44 -0700
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

I installed this:

2003-09-09  Paul Eggert  <address@hidden>

        * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
        * savedir.c: Likewise.
        * mkdir.c (free): Remove decl.
        * rmdir.c (rmdir): Define with a prototype.
        * savedir.c: Include savedir.h first, to test interface.
        * mkdir-slash.m4 (gl_PREREQ_MKDIR): Don't check for stdlib.h,
        string.h, free.
        * savedir.m4 (gl_SAVEDIR): Don't check for standard C headers.

Index: lib/mkdir.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/mkdir.c,v
retrieving revision 1.16
diff -p -u -r1.16 mkdir.c
--- lib/mkdir.c 16 Sep 2001 12:42:14 -0000      1.16
+++ lib/mkdir.c 9 Sep 2003 22:24:21 -0000
@@ -1,6 +1,7 @@
 /* On some systems, mkdir ("foo/", 0700) fails because of the trailing
    slash.  On those systems, this wrapper removes the trailing slash.
-   Copyright (C) 2001 Free Software Foundation, Inc.
+
+   Copyright (C) 2001, 2003 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -28,25 +29,11 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <stdio.h>
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-
-#if HAVE_STRING_H
-# include <string.h>
-#else
-# include <strings.h>
-#endif
+#include <stdlib.h>
+#include <string.h>
 
 #include "dirname.h"
 #include "xalloc.h"
-
-#ifndef HAVE_DECL_FREE
-"this configure-time declaration test was not run"
-#endif
-#if !HAVE_DECL_FREE
-void free ();
-#endif
 
 /* This function is required at least for NetBSD 1.5.2.  */
 
Index: lib/rmdir.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/rmdir.c,v
retrieving revision 1.10
diff -p -u -r1.10 rmdir.c
--- lib/rmdir.c 7 Aug 2000 15:48:18 -0000       1.10
+++ lib/rmdir.c 9 Sep 2003 22:24:21 -0000
@@ -1,5 +1,6 @@
 /* BSD compatible remove directory function for System V
-   Copyright (C) 1988, 1990 Free Software Foundation, Inc.
+
+   Copyright (C) 1988, 1990, 1999, 2003 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -41,8 +42,7 @@ extern int errno;
    Return 0 if successful, -1 if not.  */
 
 int
-rmdir (dpath)
-     char *dpath;
+rmdir (char const *dpath)
 {
   pid_t cpid;
   int status;
Index: lib/savedir.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/savedir.c,v
retrieving revision 1.21
diff -p -u -r1.21 savedir.c
--- lib/savedir.c       29 May 2003 07:21:59 -0000      1.21
+++ lib/savedir.c       9 Sep 2003 22:24:21 -0000
@@ -23,6 +23,8 @@
 # include <config.h>
 #endif
 
+#include "savedir.h"
+
 #include <sys/types.h>
 
 #include <errno.h>
@@ -52,13 +54,10 @@ extern int errno;
 # define CLOSEDIR(d) closedir (d)
 #endif
 
-#ifdef STDC_HEADERS
-# include <stdlib.h>
-# include <string.h>
-#endif
 #include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
 
-#include "savedir.h"
 #include "xalloc.h"
 
 /* Return a freshly allocated string containing the filenames
Index: m4/mkdir-slash.m4
===================================================================
RCS file: /cvsroot/gnulib/gnulib/m4/mkdir-slash.m4,v
retrieving revision 1.3
diff -p -u -r1.3 mkdir-slash.m4
--- m4/mkdir-slash.m4   31 Dec 2002 13:43:06 -0000      1.3
+++ m4/mkdir-slash.m4   9 Sep 2003 22:24:21 -0000
@@ -36,8 +36,4 @@ AC_DEFUN([UTILS_FUNC_MKDIR_TRAILING_SLAS
 ])
 
 # Prerequisites of lib/mkdir.c.
-AC_DEFUN([gl_PREREQ_MKDIR],
-[
-  AC_CHECK_HEADERS_ONCE(stdlib.h string.h)
-  AC_CHECK_DECLS_ONCE(free)
-])
+AC_DEFUN([gl_PREREQ_MKDIR], [:])
Index: m4/savedir.m4
===================================================================
RCS file: /cvsroot/gnulib/gnulib/m4/savedir.m4,v
retrieving revision 1.1
diff -p -u -r1.1 savedir.m4
--- m4/savedir.m4       31 Dec 2002 13:42:07 -0000      1.1
+++ m4/savedir.m4       9 Sep 2003 22:24:21 -0000
@@ -1,5 +1,5 @@
-# savedir.m4 serial 1
-dnl Copyright (C) 2002 Free Software Foundation, Inc.
+# savedir.m4 serial 2
+dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
 dnl This file is free software, distributed under the terms of the GNU
 dnl General Public License.  As a special exception to the GNU General
 dnl Public License, this file may be distributed as part of a program
@@ -9,7 +9,6 @@ dnl the same distribution terms as the r
 AC_DEFUN([gl_SAVEDIR],
 [
   dnl Prerequisites of lib/savedir.c.
-  AC_REQUIRE([AC_HEADER_STDC])
   AC_REQUIRE([AC_HEADER_DIRENT])
   AC_REQUIRE([AC_FUNC_CLOSEDIR_VOID])
 ])




reply via email to

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