mdev: plug a few memory and fd leaks; simplify code a bit

This commit is contained in:
Denis Vlasenko
2008-03-27 22:45:44 +00:00
parent e1caabbb75
commit cf26ab70c1
3 changed files with 73 additions and 74 deletions

View File

@@ -82,8 +82,10 @@ int remove_file(const char *path, int flags)
}
/* !ISDIR */
if ((!(flags & FILEUTILS_FORCE) && access(path, W_OK) < 0
&& !S_ISLNK(path_stat.st_mode) && isatty(0))
if ((!(flags & FILEUTILS_FORCE)
&& access(path, W_OK) < 0
&& !S_ISLNK(path_stat.st_mode)
&& isatty(0))
|| (flags & FILEUTILS_INTERACTIVE)
) {
fprintf(stderr, "%s: remove '%s'? ", applet_name, path);