]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
vol: use OS_UNLINK() instead of unlink()
authorJeffrey Altman <jaltman@your-file-system.com>
Sat, 15 Jan 2011 16:49:54 +0000 (11:49 -0500)
committerDerrick Brashear <shadow@dementia.org>
Fri, 4 Feb 2011 13:26:46 +0000 (05:26 -0800)
OS_UNLINK provides the platform specific mechanism
for unlinking objects.

Reviewed-on: http://gerrit.openafs.org/3670
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 038264b4d62803bd71ac0d7706b56b7f18f31dca)

Change-Id: I58a6acbe7328faa1d0118073f24321ead378efe4
Reviewed-on: http://gerrit.openafs.org/3834
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
src/vol/namei_ops.c

index df990fc7396f4bfe18894047d551a9454abbf268..50d50b1e30487d35c1d0fbbf19a97f972c7b04d6 100644 (file)
@@ -1150,7 +1150,7 @@ namei_replace_file_by_hardlink(IHandle_t *hLink, IHandle_t *hTarget)
     namei_HandleToName(&nameLink, hLink);
     namei_HandleToName(&nameTarget, hTarget);
 
-    unlink(nameLink.n_path);
+    OS_UNLINK(nameLink.n_path);
     code = link(nameTarget.n_path, nameLink.n_path);
     return code;
 }
@@ -1185,7 +1185,7 @@ namei_copy_on_write(IHandle_t *h)
        buf = malloc(8192);
        if (!buf) {
            close(fd);
-           unlink(path);
+           OS_UNLINK(path);
            FDH_CLOSE(fdP);
            return ENOMEM;
        }
@@ -1206,7 +1206,7 @@ namei_copy_on_write(IHandle_t *h)
        if (size)
            code = EIO;
        else {
-           unlink(name.n_path);
+           OS_UNLINK(name.n_path);
            code = rename(path, name.n_path);
        }
     }
@@ -2951,7 +2951,7 @@ namei_ConvertROtoRWvolume(char *pname, afs_uint32 volumeId)
     MoveFileEx(n.n_path, newpath, MOVEFILE_WRITE_THROUGH);
 #else
     link(newpath, n.n_path);
-    unlink(newpath);
+    OS_UNLINK(newpath);
 #endif
 
     t_ih.ih_ino = namei_MakeSpecIno(ih->ih_vid, VI_LARGEINDEX);
@@ -2970,7 +2970,7 @@ namei_ConvertROtoRWvolume(char *pname, afs_uint32 volumeId)
     MoveFileEx(n.n_path, newpath, MOVEFILE_WRITE_THROUGH);
 #else
     link(newpath, n.n_path);
-    unlink(newpath);
+    OS_UNLINK(newpath);
 #endif
 
     OS_UNLINK(oldpath);