From c791ec2ba9614e661e978436f56ed21f918750f8 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Mon, 23 May 2011 19:37:50 -0700 Subject: 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 Signed-off-by: Jeremy Huddleston --- process.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/process.c b/process.c index 56b7aaf..1a104b1 100644 --- a/process.c +++ b/process.c @@ -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, -- cgit v1.2.1