diff options
author | djm@openbsd.org <djm@openbsd.org> | 2017-08-18 05:48:04 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2017-08-23 19:47:06 +1000 |
commit | b074c3c3f820000a21953441cea7699c4b17d72f (patch) | |
tree | 9304faf8fcaef5893524a7283450de2b75b1d8ea /misc.c | |
parent | de4ae07f12dabf8815ecede54235fce5d22e3f63 (diff) | |
download | openssh-git-b074c3c3f820000a21953441cea7699c4b17d72f.tar.gz |
upstream commit
add a "quiet" flag to exited_cleanly() that supresses
errors about exit status (failure due to signal is still reported)
Upstream-ID: db85c39c3aa08e6ff67fc1fb4ffa89f807a9d2f0
Diffstat (limited to 'misc.c')
-rw-r--r-- | misc.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -1,4 +1,4 @@ -/* $OpenBSD: misc.c,v 1.112 2017/08/18 05:36:45 djm Exp $ */ +/* $OpenBSD: misc.c,v 1.113 2017/08/18 05:48:04 djm Exp $ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. * Copyright (c) 2005,2006 Damien Miller. All rights reserved. @@ -1570,7 +1570,7 @@ subprocess(const char *tag, struct passwd *pw, const char *command, /* Returns 0 if pid exited cleanly, non-zero otherwise */ int -exited_cleanly(pid_t pid, const char *tag, const char *cmd) +exited_cleanly(pid_t pid, const char *tag, const char *cmd, int quiet) { int status; @@ -1584,7 +1584,8 @@ exited_cleanly(pid_t pid, const char *tag, const char *cmd) error("%s %s exited on signal %d", tag, cmd, WTERMSIG(status)); return -1; } else if (WEXITSTATUS(status) != 0) { - error("%s %s failed, status %d", tag, cmd, WEXITSTATUS(status)); + do_log2(quiet ? SYSLOG_LEVEL_DEBUG1 : SYSLOG_LEVEL_INFO, + "%s %s failed, status %d", tag, cmd, WEXITSTATUS(status)); return -1; } return 0; |