diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-04-05 21:25:15 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-04-05 21:25:15 +0000 |
commit | 1bb552b1d9da749050274e0a9cb10b672db22d77 (patch) | |
tree | a638c7bbef95bd2c9d72c2e16a5cf4f7b6298458 /libbb | |
parent | 9020d850bf2b0fd547b545e5e366c7ed284a33cb (diff) | |
download | busybox-w32-1bb552b1d9da749050274e0a9cb10b672db22d77.tar.gz busybox-w32-1bb552b1d9da749050274e0a9cb10b672db22d77.tar.bz2 busybox-w32-1bb552b1d9da749050274e0a9cb10b672db22d77.zip |
libbb: add xunlink()
patch: do not try to delete same file twice
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/xfuncs.c | 6 |
1 files changed, 6 insertions, 0 deletions
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) | |||
122 | return ret; | 122 | return ret; |
123 | } | 123 | } |
124 | 124 | ||
125 | void xunlink(const char *pathname) | ||
126 | { | ||
127 | if (unlink(pathname)) | ||
128 | bb_perror_msg_and_die("cannot remove file '%s'", pathname); | ||
129 | } | ||
130 | |||
125 | // Turn on nonblocking I/O on a fd | 131 | // Turn on nonblocking I/O on a fd |
126 | int ndelay_on(int fd) | 132 | int ndelay_on(int fd) |
127 | { | 133 | { |