diff options
author | Jeremy Huddleston <jeremyhu@apple.com> | 2011-05-23 19:37:50 -0700 |
---|---|---|
committer | Jeremy Huddleston <jeremyhu@apple.com> | 2011-05-23 19:40:53 -0700 |
commit | c791ec2ba9614e661e978436f56ed21f918750f8 (patch) | |
tree | 9ea28f1d29e144327cdfa1180c90a3abfdfbccf9 | |
parent | 90640776b88b32cea2316670a3b29f7785aadc7a (diff) |
auth_finalize: Attempt to rename() if link() fails
On some file systems (like AFP), hard links are not supported. If
link fails, try rename() before giving up.
Reported-by: Jamie Kennea <jamie@pompey.org>
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
-rw-r--r-- | process.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -700,7 +700,8 @@ int auth_finalize (void) #if defined(WIN32) || defined(__UNIXOS2__) if (rename(temp_name, iceauth_filename) == -1) #else - if (link (temp_name, iceauth_filename) == -1) + /* Attempt to rename() if link() fails, since this may be on a FS that does not support hard links */ + if (link (temp_name, iceauth_filename) == -1 && rename(temp_name, iceauth_filename) == -1) #endif { fprintf (stderr, |