Fix a few errors with the last few commits

This commit is contained in:
Roy Marples 2007-10-05 11:31:17 +00:00
parent 9ff89f8027
commit 632bd4d1f0
2 changed files with 7 additions and 7 deletions

View File

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

View File

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