Browse Source

Use Gnulib ‘free-posix’ module

Paxutils uses it so we should too.
* gnulib.modules: Add ‘free-posix’.
* src/misc.c (remove_any_file): Assume ‘free’ keeps errno.
Paul Eggert 1 year ago
parent
commit
5d6736e394
2 changed files with 1 additions and 2 deletions
  1. 1 0
      gnulib.modules
  2. 0 2
      src/misc.c

+ 1 - 0
gnulib.modules

@@ -42,6 +42,7 @@ file-has-acl
 fileblocks
 fnmatch-gnu
 fprintftime
+free-posix
 fseeko
 fstatat
 full-write

+ 0 - 2
src/misc.c

@@ -695,13 +695,11 @@ remove_any_file (const char *file_name, enum remove_option option)
 		char *file_name_buffer = make_file_name (file_name, entry);
 		int r = remove_any_file (file_name_buffer,
                                          RECURSIVE_REMOVE_OPTION);
-		int e = errno;
 		free (file_name_buffer);
 
 		if (! r)
 		  {
 		    free (directory);
-		    errno = e;
 		    return 0;
 		  }
 	      }