1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-21 02:50:18 +03:00

[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.
This commit is contained in:
md@Linux.IT 2004-03-01 22:34:12 -08:00 committed by Greg KH
parent 758f236fd1
commit 92c5ddee38

View File

@ -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));