In all three cases, sd_event_loop() will return the exit code anyway.
If sd_event_loop() returns negative, failure is logged and results in an
immediate return. Otherwise, we don't care if sd_event_loop() returns 0
or positive, because the return value feeds into DEFINE_MAIN_FUNCTION(), which
doesn't make the distinction.
static int process_forward(sd_event *event, PTYForward **forward, int master, PTYForwardFlags flags, const char *name) {
char last_char = 0;
bool machine_died;
- int ret = 0, r;
+ int r;
assert(event);
assert(master >= 0);
log_info("Connection to machine %s terminated.", name);
}
- sd_event_get_exit_code(event, &ret);
- return ret;
+ return 0;
}
static int parse_machine_uid(const char *spec, const char **machine, char **uid) {
if (r < 0)
return log_error_errno(r, "Event loop failed: %m");
- (void) sd_event_get_exit_code(m->event, &r);
-
- return r;
+ return 0;
}
DEFINE_MAIN_FUNCTION(run);
log_debug_errno(r, "Failed to touch %s, ignoring: %m", CLOCK_FILE);
}
- (void) sd_event_get_exit_code(m->event, &r);
-
- return r;
+ return 0;
}
DEFINE_MAIN_FUNCTION(run);