Browse Source

Modified to use rename() instead of link()/unlink() to rename files.

dtrg 18 years ago
parent
commit
7068d0d301
1 changed files with 2 additions and 3 deletions
  1. 2 3
      util/LLgen/src/machdep.c

+ 2 - 3
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
 }