utime: Handle more Windows error codes.
authorBruno Haible <bruno@clisp.org>
Sun, 7 May 2017 19:09:25 +0000 (21:09 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 7 May 2017 19:09:25 +0000 (21:09 +0200)
* lib/utime.c (utime): Handle ERROR_BAD_NETPATH.
Based on explanations by Billy O'Neal.

ChangeLog
lib/utime.c

index 91b2c5f13340131c3c50dbae00c68194cb3a70a1..75537dcaf59d82e0bae6cf78c572c9007aa94c3c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-05-07 Bruno Haible  <bruno@clisp.org>
+
+       utime: Handle more Windows error codes.
+       * lib/utime.c (utime): Handle ERROR_BAD_NETPATH.
+       Based on explanations by Billy O'Neal.
+
 2017-05-05 Bruno Haible  <bruno@clisp.org>
 
        crypto/rijndael: Fix "strict-aliasing rules" warnings, alignment issues.
index ac5c78bcb01e4bb850a852471b62784c760e9c9f..230d36b52c728562fb4efd3ecb2de75c6bd19e38 100644 (file)
@@ -193,6 +193,7 @@ utime (const char *name, const struct utimbuf *ts)
       case ERROR_FILE_NOT_FOUND: /* The last component of rname does not exist.  */
       case ERROR_PATH_NOT_FOUND: /* Some directory component in rname does not exist.  */
       case ERROR_BAD_PATHNAME:   /* rname is such as '\\server'.  */
+      case ERROR_BAD_NETPATH:    /* rname is such as '\\nonexistentserver\share'.  */
       case ERROR_BAD_NET_NAME:   /* rname is such as '\\server\nonexistentshare'.  */
       case ERROR_INVALID_NAME:   /* rname contains wildcards, misplaced colon, etc.  */
       case ERROR_DIRECTORY:
@@ -201,7 +202,6 @@ utime (const char *name, const struct utimbuf *ts)
 
       case ERROR_ACCESS_DENIED:  /* rname is such as 'C:\System Volume Information\foo'.  */
       case ERROR_SHARING_VIOLATION: /* rname is such as 'C:\pagefile.sys'.  */
-                                    /* XXX map to EACCESS or EPERM? */
         errno = (ts != NULL ? EPERM : EACCES);
         break;