From 632bd4d1f03cd0d4b6bf397b0768063f6713c12d Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Fri, 5 Oct 2007 11:31:17 +0000 Subject: Fix a few errors with the last few commits --- src/env-update.c | 6 +++--- src/rc.c | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/env-update.c b/src/env-update.c index 2f97719f..1ee13eff 100644 --- a/src/env-update.c +++ b/src/env-update.c @@ -137,8 +137,9 @@ int env_update (int argc, char **argv) if (d->d_name[0] == '.') continue; + path = rc_strcatpaths (ENVDIR, d->d_name, (char *) NULL); j = strlen (d->d_name); - if (stat (d->d_name, &buf) == 0 && S_ISDIR (buf.st_mode) == 0 && + if (stat (path, &buf) == 0 && S_ISDIR (buf.st_mode) == 0 && j > 2 && d->d_name[0] >= '0' && d->d_name[0] <= '9' && @@ -148,9 +149,7 @@ int env_update (int argc, char **argv) (j < 4 || strcmp (d->d_name + j - 4, ".bak") != 0) && (j < 5 || strcmp (d->d_name + j - 5, ".core") != 0)) { - path = rc_strcatpaths (ENVDIR, d->d_name, (char *) NULL); entries = rc_config_load (path); - free (path); STRLIST_FOREACH (entries, entry, j) { char *tmpent = rc_xstrdup (entry); @@ -169,6 +168,7 @@ int env_update (int argc, char **argv) } rc_strlist_free (entries); } + free (path); } closedir (dp); diff --git a/src/rc.c b/src/rc.c index 9472edb5..aa3e4373 100644 --- a/src/rc.c +++ b/src/rc.c @@ -1078,7 +1078,7 @@ int main (int argc, char **argv) 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); + asprintf (&tmp, DEVBOOT "/%s", d->d_name); if (tmp) { if (unlink (tmp)) eerror ("%s: unlink `%s': %s", applet, tmp, @@ -1106,9 +1106,9 @@ int main (int argc, char **argv) i = (strlen ("net.") + strlen (d->d_name) + 1); tmp = rc_xmalloc (sizeof (char *) * i); snprintf (tmp, i, "net.%s", d->d_name); - if (rc_service_exists (d->d_name) && - rc_service_plugable (d->d_name)) - rc_service_mark (d->d_name, RC_SERVICE_COLDPLUGGED); + if (rc_service_exists (tmp) && + rc_service_plugable (tmp)) + rc_service_mark (tmp, RC_SERVICE_COLDPLUGGED); CHAR_FREE (tmp); } closedir (dp); -- cgit v1.2.3