if (names) {
FOREACH_WORD(w, l, names, state) {
- if (!(e = strndup(w, l)))
+ if (!(e = strndup(w, l))) {
+ r = -ENOMEM;
goto fail;
+ }
r = unit_add_name(u, e);
free(e);
if (wants) {
FOREACH_WORD(w, l, wants, state) {
- if (!(e = strndup(w, l)))
+ if (!(e = strndup(w, l))) {
+ r = -ENOMEM;
goto fail;
+ }
r = unit_add_dependency_by_name(u, UNIT_WANTS, e);
free(e);
int job_finish_and_invalidate(Job *j, bool success) {
Unit *u;
Unit *other;
- UnitType t;
+ JobType t;
Iterator i;
assert(j);
* don't care about failing commands. */
if (s->control_command->command_next &&
- (success || (s->state == SERVICE_EXEC_STOP || s->state == SERVICE_EXEC_STOP_POST)))
+ (success || (s->state == SERVICE_STOP || s->state == SERVICE_STOP_POST)))
/* There is another command to *
* execute, so let's do that. */
log_debug("%s control process exited, code=%s status=%i", unit_id(u), sigchld_code_to_string(code), status);
if (s->control_command->command_next &&
- (success || (s->state == SOCKET_EXEC_STOP_PRE || s->state == SOCKET_EXEC_STOP_POST))) {
+ (success || (s->state == SOCKET_STOP_PRE || s->state == SOCKET_STOP_POST))) {
log_debug("%s running next command for the state %s", unit_id(u), state_string_table[s->state]);
socket_run_next(s, success);
} else {
for (f = s, t = r; *f; f++) {
- if (*f < ' ' || *f >= 127 ||
- *f == '\\' || strchr(bad, *f)) {
+ if ((*f < ' ') || (*f >= 127) ||
+ (*f == '\\') || strchr(bad, *f)) {
*(t++) = '\\';
*(t++) = 'x';
*(t++) = hexchar(*f >> 4);