From: dtrg Date: Tue, 25 Jul 2006 23:24:20 +0000 (+0000) Subject: Modified to use rename() instead of link()/unlink() to rename files. X-Git-Tag: release-6-0-pre-1~74 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=7068d0d3013620607d46f6dd83e85e5ed0e245c7;p=ack.git Modified to use rename() instead of link()/unlink() to rename files. --- diff --git a/util/LLgen/src/machdep.c b/util/LLgen/src/machdep.c index 0c9dcbf18..780951495 100644 --- a/util/LLgen/src/machdep.c +++ b/util/LLgen/src/machdep.c @@ -45,9 +45,8 @@ RENAME(x,y) string x,y; { #ifdef USE_SYS if(! sys_rename(x,y)) fatal(1,"Cannot rename to %s",y); #else - unlink(y); - if (link(x,y) != 0) fatal(1,"Cannot rename to %s",y); - unlink(x); + if (rename(x, y) == -1) + fatal(1, "Cannot rename to %s", y); #endif }