diff options
author | Roy Marples <roy@marples.name> | 2008-03-24 10:13:49 +0000 |
---|---|---|
committer | Roy Marples <roy@marples.name> | 2008-03-24 10:13:49 +0000 |
commit | 79719b538693c10cf8881da4357dd16a1117af34 (patch) | |
tree | 6b72d10e2c7e9cf5fa15d9a3243b3c3ac38e050c /src | |
parent | 486d5176749922bf0eb1ffc7d99a4b1b62740be3 (diff) |
Fix adding services to the boot runlevel, #43
Diffstat (limited to 'src')
-rw-r--r-- | src/librc/librc.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/librc/librc.c b/src/librc/librc.c index 788dcfa5..ac183773 100644 --- a/src/librc/librc.c +++ b/src/librc/librc.c @@ -906,13 +906,14 @@ bool rc_service_add(const char *runlevel, const char *service) /* We need to ensure that only things in /etc/init.d are added * to the boot runlevel */ if (strcmp (runlevel, RC_LEVEL_BOOT) == 0) { - free(init); - p = realpath(dirname (init), path); - if (! *p) + p = realpath(dirname(init), path); + if (! *p) { + free(init); return false; - retval = (strcmp(path, RC_INITDIR) == 0); - if (! retval) { + } + if (strcmp(path, RC_INITDIR) != 0) { + free(init); errno = EPERM; return false; } |