aboutsummaryrefslogtreecommitdiff
path: root/src/rc.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-10-05 10:36:53 +0000
committerRoy Marples <roy@marples.name>2007-10-05 10:36:53 +0000
commit3bfba57f5b2d89a5022fac932e46ca467a4b9f26 (patch)
treec730a290d7c3c261db1d8bdf65f1662e749ecaf8 /src/rc.c
parent05b8eff319536ade894d07705bc74abaf425788e (diff)
Punt rc_rm_dir
Diffstat (limited to 'src/rc.c')
-rw-r--r--src/rc.c34
1 files changed, 32 insertions, 2 deletions
diff --git a/src/rc.c b/src/rc.c
index 7117a1ee..ffcfffe5 100644
--- a/src/rc.c
+++ b/src/rc.c
@@ -1026,7 +1026,24 @@ int main (int argc, char **argv)
eerrorx ("failed to load deptree");
/* Clean the failed services state dir now */
- rc_rm_dir (RC_SVCDIR "/failed", false);
+ if ((dp = opendir (RC_SVCDIR "/failed"))) {
+ while ((d = readdir (dp))) {
+ if (d->d_name[0] == '.' &&
+ (d->d_name[1] == '\0' ||
+ (d->d_name[1] == '.' && d->d_name[2] == '\0')))
+ continue;
+
+ asprintf (&tmp, RC_SVCDIR "/failed/%s", d->d_name);
+ if (tmp) {
+ if (unlink (tmp))
+ eerror ("%s: unlink `%s': %s", applet, tmp,
+ strerror (errno));
+ free (tmp);
+ }
+ }
+ closedir (dp);
+ rmdir (RC_SVCDIR "/failed");
+ }
mkdir (RC_STOPPING, 0755);
@@ -1037,12 +1054,25 @@ int main (int argc, char **argv)
here when we are ready for them */
if ((dp = opendir (DEVBOOT))) {
while ((d = readdir (dp))) {
+ if (d->d_name[0] == '.' &&
+ (d->d_name[1] == '\0' ||
+ (d->d_name[1] == '.' && d->d_name[2] == '\0')))
+ continue;
+
if (rc_service_exists (d->d_name) &&
rc_service_plugable (d->d_name))
rc_service_mark (d->d_name, RC_SERVICE_COLDPLUGGED);
+
+ tmp = asprintf (&tmp, RC_SVCDIR "/failed/%s", d->d_name);
+ if (tmp) {
+ if (unlink (tmp))
+ eerror ("%s: unlink `%s': %s", applet, tmp,
+ strerror (errno));
+ free (tmp);
+ }
}
closedir (dp);
- rc_rm_dir (DEVBOOT, true);
+ rmdir (DEVBOOT);
}
#else
/* BSD's on the other hand populate /dev automagically and use devd.