]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
Merge branch 'waitpid--suppress-message' of https://github.com/masatake/util-linux
authorKarel Zak <kzak@redhat.com>
Mon, 11 Sep 2023 07:12:42 +0000 (09:12 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 11 Sep 2023 07:12:42 +0000 (09:12 +0200)
* 'waitpid--suppress-message' of https://github.com/masatake/util-linux:
  waitpid: warn of "exited" only when --verbose is given

misc-utils/waitpid.c
tests/ts/misc/waitpid

index faf86ab6b79a28ea3258affcdd1e42cd614b8238..0a4e03d16714136e895be9f40ee712046b5fddbd 100644 (file)
@@ -64,7 +64,8 @@ static int *open_pidfds(size_t n_pids, pid_t *pids)
                pidfds[i] = pidfd_open(pids[i], 0);
                if (pidfds[i] == -1) {
                        if (allow_exited && errno == ESRCH) {
-                               warnx(_("PID %d has exited, skipping"), pids[i]);
+                               if (verbose)
+                                       warnx(_("PID %d has exited, skipping"), pids[i]);
                                continue;
                        }
                        err_nosys(EXIT_FAILURE, _("could not open pid %u"), pids[i]);
index ae5ab6f928ded41a6f8be9edfecaf97eb21130a3..daed74fe089c9475e35997368ee04dc1286997b9 100755 (executable)
@@ -44,7 +44,7 @@ echo $? >> "$TS_OUTPUT"
 ts_finalize_subtest
 
 ts_init_subtest exited
-"$TS_CMD_WAITPID" -e 2147483647 >> "$TS_OUTPUT" 2>> "$TS_ERRLOG"
+"$TS_CMD_WAITPID" -v -e 2147483647 >> "$TS_OUTPUT" 2>> "$TS_ERRLOG"
 echo $? >> "$TS_ERRLOG"
 ts_finalize_subtest