From 0b24b840446f8a8427052816017e36f75f476810 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 28 Jun 2006 22:21:48 +0000 Subject: * src/system.h (CLOSEDIR): Remove. All uses changed to closedir. --- src/ls.c | 2 +- src/pwd.c | 2 +- src/remove.c | 8 ++++---- src/system.h | 7 ------- 4 files changed, 6 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/ls.c b/src/ls.c index b2a74c8a1..2e9159430 100644 --- a/src/ls.c +++ b/src/ls.c @@ -2377,7 +2377,7 @@ print_dir (char const *name, char const *realname, bool command_line_arg) 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. */ diff --git a/src/pwd.c b/src/pwd.c index 3a7ff5aac..235d53a17 100644 --- a/src/pwd.c +++ b/src/pwd.c @@ -216,7 +216,7 @@ find_dir_entry (struct stat *dot_sb, struct file_name *file_name, } } - if (dirp == NULL || CLOSEDIR (dirp) != 0) + if (dirp == NULL || closedir (dirp) != 0) { /* Note that this diagnostic serves for both readdir and closedir failures. */ diff --git a/src/remove.c b/src/remove.c index 4ee59cec3..a219955bc 100644 --- a/src/remove.c +++ b/src/remove.c @@ -423,7 +423,7 @@ AD_pop_and_chdir (DIR **dirp, Dirstack_state *ds, char **prev_dir) { 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_state *ds, char **prev_dir) } 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 cycle:\n %s\n"), } *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 *ds, char const *dir, 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 ("."))); diff --git a/src/system.h b/src/system.h index ab4826682..7ddbd7dbe 100644 --- a/src/system.h +++ b/src/system.h @@ -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 -- cgit v1.2.3-54-g00ecf