projects
/
unix-history
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
handle restructure of C library, get machine type cleanly
[unix-history]
/
usr
/
src
/
local
/
sccscmds
/
sccscmds.ok
/
util
/
rename.c
# include
"../hdr/macros.h"
# include
"errno.h"
# include
"../hdr/fatal.h"
SCCSID
(
@
(
#)rename 2.1);
/*
rename (unlink/link)
Calls xlink() and xunlink().
*/
rename
(
oldname
,
newname
)
char
*
oldname
, *
newname
;
{
extern
int
errno
;
if
(
unlink
(
newname
) <
0
&&
errno
!=
ENOENT
)
return
(
xunlink
(
newname
));
if
(
xlink
(
oldname
,
newname
) ==
Fvalue
)
return
(-
1
);
return
(
xunlink
(
oldname
));
}