bug-gnulib
[Top][All Lists]
Advanced

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

Re: AC_FUNC_CLOSEDIR_VOID


From: Paul Eggert
Subject: Re: AC_FUNC_CLOSEDIR_VOID
Date: Wed, 28 Jun 2006 15:27:22 -0700
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)

"Derek R. Price" <address@hidden> writes:

> 2006-06-28  Derek R. Price  <address@hidden>
>
>       * lib/savedir.c: Assume closedir returns an error code.
>       * m4/savedir.m4: Remove AC_FUNC_CLOSEDIR_VOID requirement.

Thanks, I installed that into gnulib and coreutils.  Coreutils needed
a bit more, so I'll CC: this to bug-coreutils.

2006-06-28  Paul Eggert  <address@hidden>

        * src/system.h (CLOSEDIR): Remove.  All uses changed to closedir.
        Autoconf 2.60 says this stuff was obsolete.

2006-06-28  Derek R. Price  <address@hidden>

        * lib/savedir.c (CLOSEDIR): Remove.  All uses changed to closedir.
        Autoconf 2.60 says this stuff was obsolete.
        * m4/savedir.m4: Remove AC_FUNC_CLOSEDIR_VOID requirement.

Index: lib/savedir.c
===================================================================
RCS file: /fetish/cu/lib/savedir.c,v
retrieving revision 1.29
diff -p -u -r1.29 savedir.c
--- lib/savedir.c       10 Jan 2006 17:47:57 -0000      1.29
+++ lib/savedir.c       28 Jun 2006 22:15:02 -0000
@@ -1,6 +1,6 @@
 /* savedir.c -- save the list of files in a directory in a string
 
-   Copyright 1990, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 Free
+   Copyright 1990, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006 Free
    Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
@@ -44,13 +44,6 @@
 # endif
 #endif
 
-#ifdef CLOSEDIR_VOID
-/* Fake a return value. */
-# define CLOSEDIR(d) (closedir (d), 0)
-#else
-# define CLOSEDIR(d) closedir (d)
-#endif
-
 #include <stddef.h>
 #include <stdlib.h>
 #include <string.h>
@@ -117,7 +110,7 @@ savedirstream (DIR *dirp)
     }
   name_space[used] = '\0';
   save_errno = errno;
-  if (CLOSEDIR (dirp) != 0)
+  if (closedir (dirp) != 0)
     save_errno = errno;
   if (save_errno != 0)
     {
Index: m4/savedir.m4
===================================================================
RCS file: /fetish/cu/m4/savedir.m4,v
retrieving revision 1.4
diff -p -u -r1.4 savedir.m4
--- m4/savedir.m4       29 Jan 2005 00:16:39 -0000      1.4
+++ m4/savedir.m4       28 Jun 2006 22:15:02 -0000
@@ -1,5 +1,5 @@
 # savedir.m4 serial 4
-dnl Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -11,5 +11,4 @@ AC_DEFUN([gl_SAVEDIR],
 
   dnl Prerequisites of lib/savedir.c.
   AC_REQUIRE([AC_HEADER_DIRENT])
-  AC_REQUIRE([AC_FUNC_CLOSEDIR_VOID])
 ])
Index: src/ls.c
===================================================================
RCS file: /fetish/cu/src/ls.c,v
retrieving revision 1.415
diff -p -u -r1.415 ls.c
--- src/ls.c    30 May 2006 06:22:16 -0000      1.415
+++ src/ls.c    28 Jun 2006 22:15:03 -0000
@@ -2377,7 +2377,7 @@ print_dir (char const *name, char const 
        break;
     }
 
-  if (CLOSEDIR (dirp) != 0)
+  if (closedir (dirp) != 0)
     {
       file_failure (command_line_arg, _("closing directory %s"), name);
       /* Don't return; print whatever we got.  */
Index: src/pwd.c
===================================================================
RCS file: /fetish/cu/src/pwd.c,v
retrieving revision 1.60
diff -p -u -r1.60 pwd.c
--- src/pwd.c   11 Mar 2006 20:40:18 -0000      1.60
+++ src/pwd.c   28 Jun 2006 22:15:03 -0000
@@ -216,7 +216,7 @@ find_dir_entry (struct stat *dot_sb, str
        }
     }
 
-  if (dirp == NULL || CLOSEDIR (dirp) != 0)
+  if (dirp == NULL || closedir (dirp) != 0)
     {
       /* Note that this diagnostic serves for both readdir
         and closedir failures.  */
Index: src/remove.c
===================================================================
RCS file: /fetish/cu/src/remove.c,v
retrieving revision 1.152
diff -p -u -r1.152 remove.c
--- src/remove.c        26 Jun 2006 13:29:48 -0000      1.152
+++ src/remove.c        28 Jun 2006 22:15:03 -0000
@@ -423,7 +423,7 @@ AD_pop_and_chdir (DIR **dirp, Dirstack_s
     {
       struct stat sb;
       int fd = openat (dirfd (*dirp), "..", O_RDONLY);
-      if (CLOSEDIR (*dirp) != 0)
+      if (closedir (*dirp) != 0)
        {
          error (0, errno, _("FATAL: failed to close directory %s"),
                 quote (full_filename (*prev_dir)));
@@ -474,7 +474,7 @@ AD_pop_and_chdir (DIR **dirp, Dirstack_s
     }
   else
     {
-      if (CLOSEDIR (*dirp) != 0)
+      if (closedir (*dirp) != 0)
        {
          error (0, errno, _("FATAL: failed to close directory %s"),
                 quote (full_filename (*prev_dir)));
@@ -1162,7 +1162,7 @@ The following directory is part of the c
              }
 
            *subdir = xstrdup (f);
-           if (CLOSEDIR (*dirp) != 0)
+           if (closedir (*dirp) != 0)
              {
                error (0, 0, _("failed to close directory %s"),
                       quote (full_filename (".")));
@@ -1337,7 +1337,7 @@ remove_dir (int fd_cwd, Dirstack_state *
   AD_stack_pop (ds);
 
  closedir_and_return:;
-  if (dirp != NULL && CLOSEDIR (dirp) != 0)
+  if (dirp != NULL && closedir (dirp) != 0)
     {
       error (0, 0, _("failed to close directory %s"),
             quote (full_filename (".")));
Index: src/system.h
===================================================================
RCS file: /fetish/cu/src/system.h,v
retrieving revision 1.146
diff -p -u -r1.146 system.h
--- src/system.h        12 Apr 2006 20:15:08 -0000      1.146
+++ src/system.h        28 Jun 2006 22:15:03 -0000
@@ -241,13 +241,6 @@ initialize_exit_failure (int status)
 # endif /* HAVE_NDIR_H */
 #endif /* HAVE_DIRENT_H */
 
-#if CLOSEDIR_VOID
-/* Fake a return value. */
-# define CLOSEDIR(d) (closedir (d), 0)
-#else
-# define CLOSEDIR(d) closedir (d)
-#endif
-
 enum
 {
   NOT_AN_INODE_NUMBER = 0




reply via email to

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