version 1.15, 1998/06/11 06:20:18 |
version 1.16, 1998/06/12 17:51:51 |
|
|
} |
} |
|
|
/* |
/* |
* Delete a file, but only if the file is a plain file. |
* Delete or truncate a file, but only if the file is a plain file. |
*/ |
*/ |
int |
int |
rm(name) |
rm(name) |
|
|
errno = EISDIR; |
errno = EISDIR; |
return(-1); |
return(-1); |
} |
} |
return(unlink(name)); |
if (unlink(name) == -1) { |
|
if (errno == EPERM) |
|
return(truncate(name, 0)); |
|
else |
|
return(-1); |
|
} |
|
return(0); |
} |
} |
|
|
static int sigdepth; /* depth of holdsigs() */ |
static int sigdepth; /* depth of holdsigs() */ |