1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-13 17:18:18 +03:00

run_program: log "info" not "error" if program is missing

This commit is contained in:
Scott James Remnant 2007-05-16 20:06:39 +02:00 committed by Kay Sievers
parent ca4f2c41b0
commit 8246d00d88

View File

@ -158,9 +158,13 @@ int run_program(const char *command, const char *subsystem,
close(errpipe[WRITE_END]); close(errpipe[WRITE_END]);
} }
execv(argv[0], argv); execv(argv[0], argv);
if ((errno == ENOENT) || (errno = ENOTDIR)) {
/* we should never reach this */ /* may be on a filesytem which is not mounted right now */
info("program '%s' not found", argv[0]);
} else {
/* other problems */
err("exec of program '%s' failed", argv[0]); err("exec of program '%s' failed", argv[0]);
}
_exit(1); _exit(1);
case -1: case -1:
err("fork of '%s' failed: %s", argv[0], strerror(errno)); err("fork of '%s' failed: %s", argv[0], strerror(errno));