libbb: add xunlink()

patch: do not try to delete same file twice
This commit is contained in:
Denis Vlasenko
2007-04-05 21:25:15 +00:00
parent 9020d850bf
commit 1bb552b1d9
4 changed files with 19 additions and 16 deletions

View File

@ -122,6 +122,12 @@ int xopen3(const char *pathname, int flags, int mode)
return ret;
}
void xunlink(const char *pathname)
{
if (unlink(pathname))
bb_perror_msg_and_die("cannot remove file '%s'", pathname);
}
// Turn on nonblocking I/O on a fd
int ndelay_on(int fd)
{