From 357448c46daec12f0dd7dfa12f1f2f1c1e89fed8 Mon Sep 17 00:00:00 2001 From: vda Date: Thu, 5 Apr 2007 21:25:15 +0000 Subject: libbb: add xunlink() patch: do not try to delete same file twice git-svn-id: svn://busybox.net/trunk/busybox@18342 69ca8d6d-28ef-0310-b511-8ec308f3f277 --- libbb/xfuncs.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libbb') diff --git a/libbb/xfuncs.c b/libbb/xfuncs.c index b08f92d81..c18a1d998 100644 --- a/libbb/xfuncs.c +++ b/libbb/xfuncs.c @@ -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) { -- cgit v1.2.3-55-g6feb