]> Savannah Git Hosting - gnulib.git/commitdiff
unlink: fix malloc errno typo
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 21 Mar 2020 23:13:28 +0000 (16:13 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 21 Mar 2020 23:13:58 +0000 (16:13 -0700)
Problem reported by Tim Rühsen in:
https://lists.gnu.org/r/bug-gnulib/2020-03/msg00044.html
* lib/unlink.c (rpl_unlink): Don’t mask malloc errno.

ChangeLog
lib/unlink.c

index 0019334ca930d5efcf4de2fa8398b924ba9bf371..9b2a112eb99c4b519294e504c6ee7b4707a900a4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2020-03-21  Paul Eggert  <eggert@cs.ucla.edu>
+
+       unlink: fix malloc errno typo
+       Problem reported by Tim Rühsen in:
+       https://lists.gnu.org/r/bug-gnulib/2020-03/msg00044.html
+       * lib/unlink.c (rpl_unlink): Don’t mask malloc errno.
+
 2020-03-16  Bruno Haible  <bruno@clisp.org>
 
        *printf-posix: Fix m4 error (regression from 2020-03-08).
index b7daa7cd36862ee320bcb3943fe0bfc2731501cd..5e0f4e177d54a1b61f212633f2b9d4545832e1b2 100644 (file)
@@ -65,10 +65,7 @@ rpl_unlink (char const *name)
           /* Trailing NUL will overwrite the trailing slash.  */
           char *short_name = malloc (len);
           if (!short_name)
-            {
-              errno = EPERM;
-              return -1;
-            }
+            return -1;
           memcpy (short_name, name, len);
           while (len && ISSLASH (short_name[len - 1]))
             short_name[--len] = '\0';