]> git.eshelyaron.com Git - emacs.git/commitdiff
movemail: treat EACCES etc. failures as permanent
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 23 Nov 2012 08:28:06 +0000 (00:28 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 23 Nov 2012 08:28:06 +0000 (00:28 -0800)
* movemail.c (main): Treat any link failure other than EEXIST as a
permanent failure, not just EPERM.  EACCES, for example.

lib-src/ChangeLog
lib-src/movemail.c

index 8e835795e6a94d5ebe6621f01bee5940c778f28a..b85ba12a5b2039a05e3fbb24da065b5b3b048c96 100644 (file)
@@ -1,3 +1,9 @@
+2012-11-23  Paul Eggert  <eggert@cs.ucla.edu>
+
+       movemail: treat EACCES etc. failures as permanent
+       * movemail.c (main): Treat any link failure other than EEXIST as a
+       permanent failure, not just EPERM.  EACCES, for example.
+
 2012-11-21  Paul Eggert  <eggert@cs.ucla.edu>
 
        Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
index adc5dd9640945d527f07898342074396a9d06a67..264b3d292c63fa4e8f72a6086615c12d142f72b4 100644 (file)
@@ -328,11 +328,8 @@ main (int argc, char **argv)
 
          tem = link (tempname, lockname);
 
-#ifdef EPERM
-         if (tem < 0 && errno == EPERM)
-           fatal ("Unable to create hard link between %s and %s",
-                  tempname, lockname);
-#endif
+         if (tem < 0 && errno != EEXIST)
+           pfatal_with_name (lockname);
 
          unlink (tempname);
          if (tem >= 0)