ack/lang/cem/libcc/gen/rename.c
ceriel 30959cd73f some fixes: calloc was wrong; catch traps, and let divides
by 0 generate a signal, if on a unix machine
1989-02-20 18:01:33 +00:00

10 lines
132 B
C

int
rename(from, to)
char *from, *to;
{
(void) unlink(to);
if (link(from, to) < 0) return -1;
(void) unlink(from);
return 0;
}