summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormd@Linux.IT <md@Linux.IT>2004-03-01 22:34:12 -0800
committerGreg KH <gregkh@suse.de>2005-04-26 21:35:06 -0700
commit92c5ddee382d06de63c10aa81a18255d0b789812 (patch)
tree0360af2e47916f939c649e473759453bd884faa7
parent758f236fd1385fc7d95c719ec03e4e22ef205bf8 (diff)
[PATCH] no error on enoent
no_error_on_enoent: do not exit with an error and delete all files when a device or directory does not exist.
-rw-r--r--udev-remove.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/udev-remove.c b/udev-remove.c
index e62d1fb122..dcd460bedc 100644
--- a/udev-remove.c
+++ b/udev-remove.c
@@ -51,6 +51,8 @@ static int delete_path(char *path)
/* remove if empty */
retval = rmdir(path);
+ if (errno == ENOENT)
+ retval = 0;
if (retval) {
if (errno == ENOTEMPTY)
return 0;
@@ -77,6 +79,8 @@ static int delete_node(struct udevice *dev)
info("removing device node '%s'", filename);
retval = unlink(filename);
+ if (errno == ENOENT)
+ retval = 0;
if (retval) {
dbg("unlink(%s) failed with error '%s'",
filename, strerror(errno));
@@ -109,6 +113,8 @@ static int delete_node(struct udevice *dev)
dbg("unlinking symlink '%s'", filename);
retval = unlink(filename);
+ if (errno == ENOENT)
+ retval = 0;
if (retval) {
dbg("unlink(%s) failed with error '%s'",
filename, strerror(errno));