mirror of
https://github.com/troglobit/finit.git
synced 2026-10-18 10:59:34 +00:00
initctl: let -n ignore errors from enable/disable as well
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
7703d00e82
commit
8f1d1717f8
3 files changed
+5
-4
No files matched your search
+3
-3
@@ -282,7 +282,7 @@ int serv_enable(char *arg)
|
||||
|
||||
snprintf(argpath, sizeof(argpath), "%s/enabled/%s", finit_rcsd, arg);
|
||||
if (fexist(argpath))
|
||||
ERRX(1, "%s already enabled", arg);
|
||||
ERRX(noerr ? 0 : 1, "%s already enabled", arg);
|
||||
|
||||
return symlink(path, argpath) != 0;
|
||||
}
|
||||
@@ -308,10 +308,10 @@ int do_disable(char *arg, int check)
|
||||
dbg("Failed changing to %s/enabled/: %s", finit_rcsd, strerror(errno));
|
||||
|
||||
if (check && stat(arg, &st))
|
||||
ERRX(6, "%s not (an) enabled (service).", arg);
|
||||
ERRX(noerr ? 0 : 6, "%s not (an) enabled (service).", arg);
|
||||
|
||||
if (check && (st.st_mode & S_IFMT) == S_IFLNK)
|
||||
ERRX(1, "cannot disable %s, not a symlink.", arg);
|
||||
ERRX(noerr ? 0 : 1, "cannot disable %s, not a symlink.", arg);
|
||||
|
||||
return remove(arg) != 0;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user