public
/
Ack-5.5.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Pristine Ack-5.5
[Ack-5.5.git]
/
lang
/
cem
/
libcc.ansi
/
stdio
/
rename.c
1
/*
2
* rename.c - rename a file
3
*/
4
/* $Id: rename.c,v 1.5 1994/06/24 11:51:13 ceriel Exp $ */
5
6
#if !defined(_POSIX_SOURCE)
7
#include <stdio.h>
8
9
int _link(const char *name1, const char *name2);
10
11
int
12
rename(const char *old, const char *new) {
13
if (!_link(old, new))
14
return remove(old);
15
else return -1;
16
}
17
#endif