some fixes: calloc was wrong; catch traps, and let divides
by 0 generate a signal, if on a unix machine
This commit is contained in:
9
lang/cem/libcc/gen/rename.c
Normal file
9
lang/cem/libcc/gen/rename.c
Normal file
@@ -0,0 +1,9 @@
|
||||
int
|
||||
rename(from, to)
|
||||
char *from, *to;
|
||||
{
|
||||
(void) unlink(to);
|
||||
if (link(from, to) < 0) return -1;
|
||||
(void) unlink(from);
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user