Changeset 2725 in MondoRescue for branches/2.2.9/mindi-busybox/libbb/remove_file.c
- Timestamp:
- Feb 25, 2011, 9:26:54 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.9/mindi-busybox/libbb/remove_file.c
r1765 r2725 5 5 * Copyright (C) 2001 Matt Kraai <kraai@alumni.carnegiemellon.edu> 6 6 * 7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.7 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 8 8 */ 9 9 … … 12 12 /* Used from NOFORK applets. Must not allocate anything */ 13 13 14 int remove_file(const char *path, int flags)14 int FAST_FUNC remove_file(const char *path, int flags) 15 15 { 16 16 struct stat path_stat; … … 18 18 if (lstat(path, &path_stat) < 0) { 19 19 if (errno != ENOENT) { 20 bb_perror_msg("can not stat '%s'", path);20 bb_perror_msg("can't stat '%s'", path); 21 21 return -1; 22 22 } 23 23 if (!(flags & FILEUTILS_FORCE)) { 24 bb_perror_msg("can not remove '%s'", path);24 bb_perror_msg("can't remove '%s'", path); 25 25 return -1; 26 26 } … … 64 64 65 65 if (closedir(dp) < 0) { 66 bb_perror_msg("can not close '%s'", path);66 bb_perror_msg("can't close '%s'", path); 67 67 return -1; 68 68 } … … 75 75 76 76 if (rmdir(path) < 0) { 77 bb_perror_msg("can not remove '%s'", path);77 bb_perror_msg("can't remove '%s'", path); 78 78 return -1; 79 79 } … … 83 83 84 84 /* !ISDIR */ 85 if ((!(flags & FILEUTILS_FORCE) && access(path, W_OK) < 0 86 && !S_ISLNK(path_stat.st_mode) && isatty(0)) 85 if ((!(flags & FILEUTILS_FORCE) 86 && access(path, W_OK) < 0 87 && !S_ISLNK(path_stat.st_mode) 88 && isatty(0)) 87 89 || (flags & FILEUTILS_INTERACTIVE) 88 90 ) { … … 93 95 94 96 if (unlink(path) < 0) { 95 bb_perror_msg("can not remove '%s'", path);97 bb_perror_msg("can't remove '%s'", path); 96 98 return -1; 97 99 }
Note:
See TracChangeset
for help on using the changeset viewer.