Modified to use rename() instead of link()/unlink() to rename files.
This commit is contained in:
parent
2d5e79ec0a
commit
1f78b7ff4e
@ -45,9 +45,8 @@ RENAME(x,y) string x,y; {
|
|||||||
#ifdef USE_SYS
|
#ifdef USE_SYS
|
||||||
if(! sys_rename(x,y)) fatal(1,"Cannot rename to %s",y);
|
if(! sys_rename(x,y)) fatal(1,"Cannot rename to %s",y);
|
||||||
#else
|
#else
|
||||||
unlink(y);
|
if (rename(x, y) == -1)
|
||||||
if (link(x,y) != 0) fatal(1,"Cannot rename to %s",y);
|
fatal(1, "Cannot rename to %s", y);
|
||||||
unlink(x);
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user