diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-03-27 22:45:44 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-03-27 22:45:44 +0000 |
commit | cf26ab70c11416401cd53e6a6a5fb4d5c2583246 (patch) | |
tree | 70c34ca3fb93d01700181279a9875900c02abc08 /libbb/remove_file.c | |
parent | e1caabbb75ecf3537586aa3bbbe5921f3f1d43b7 (diff) | |
download | busybox-w32-cf26ab70c11416401cd53e6a6a5fb4d5c2583246.tar.gz busybox-w32-cf26ab70c11416401cd53e6a6a5fb4d5c2583246.tar.bz2 busybox-w32-cf26ab70c11416401cd53e6a6a5fb4d5c2583246.zip |
mdev: plug a few memory and fd leaks; simplify code a bit
Diffstat (limited to 'libbb/remove_file.c')
-rw-r--r-- | libbb/remove_file.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libbb/remove_file.c b/libbb/remove_file.c index 3edc91dae..21878dc3b 100644 --- a/libbb/remove_file.c +++ b/libbb/remove_file.c | |||
@@ -82,8 +82,10 @@ int remove_file(const char *path, int flags) | |||
82 | } | 82 | } |
83 | 83 | ||
84 | /* !ISDIR */ | 84 | /* !ISDIR */ |
85 | if ((!(flags & FILEUTILS_FORCE) && access(path, W_OK) < 0 | 85 | if ((!(flags & FILEUTILS_FORCE) |
86 | && !S_ISLNK(path_stat.st_mode) && isatty(0)) | 86 | && access(path, W_OK) < 0 |
87 | && !S_ISLNK(path_stat.st_mode) | ||
88 | && isatty(0)) | ||
87 | || (flags & FILEUTILS_INTERACTIVE) | 89 | || (flags & FILEUTILS_INTERACTIVE) |
88 | ) { | 90 | ) { |
89 | fprintf(stderr, "%s: remove '%s'? ", applet_name, path); | 91 | fprintf(stderr, "%s: remove '%s'? ", applet_name, path); |