]> arthur.barton.de Git - netatalk.git/commitdiff
VFS copyfile error handling
authorFrank Lahm <franklahm@googlemail.com>
Thu, 2 Feb 2012 14:46:30 +0000 (15:46 +0100)
committerFrank Lahm <franklahm@googlemail.com>
Thu, 2 Feb 2012 14:46:30 +0000 (15:46 +0100)
libatalk/vfs/vfs.c

index 89b7a23ad57d5ab4b7e43f8149a06a90c59e45b1..befa4aa7a7887e7c6b2be6a4cff5701c975f82b8 100644 (file)
@@ -616,7 +616,17 @@ static int RF_copyfile_ea(VFS_FUNC_ARGS_COPYFILE)
     EC_ZERO(bcatcstr(d, "/._"));
     EC_ZERO(bcatcstr(d, name));
 
-    EC_ZERO(copy_file(sfd, cfrombstr(s), cfrombstr(d), 0666));
+    if (copy_file(sfd, cfrombstr(s), cfrombstr(d), 0666) != 0) {
+        switch (errno) {
+        case ENOENT:
+            break;
+        default:
+            LOG(log_error, logtype_afpd, "[VFS] copyfile(\"%s\" -> \"%s\"): %s",
+                cfrombstr(s), cfrombstr(d), strerror(errno));
+            EC_FAIL;
+                    
+        }
+    }
 
 EC_CLEANUP:
     bdestroy(s);