diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-01-28 02:44:47 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-01-28 02:44:47 +0100 |
commit | d46de8a1a249e179687361dcaeba27e1c586253a (patch) | |
tree | 42f790e46583f88c557ac33ea67e857654a794a4 /service.c | |
parent | 98b5b2986fa1b85fd2d2e80f867f1647b4e4e3b5 (diff) |
rework config file load logic
Diffstat (limited to 'service.c')
-rw-r--r-- | service.c | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -101,17 +101,18 @@ static int service_init(Unit *u) { s->state = SERVICE_DEAD; /* Load a .service file */ - r = unit_load_fragment(u); - - /* Load a classic init script as a fallback */ - if (r == -ENOENT) - r = service_load_sysv(s); - - if (r < 0) { + if ((r = unit_load_fragment(u)) < 0) { service_done(u); return r; } + /* Load a classic init script as a fallback, if we couldn*t find anything */ + if (r == 0) + if ((r = service_load_sysv(s)) <= 0) { + service_done(u); + return r < 0 ? r : -ENOENT; + } + /* Load dropin directory data */ if ((r = unit_load_dropin(u)) < 0) { service_done(u); |