]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-process-util: add (void) cast to make coverity happy
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 27 Nov 2017 21:52:32 +0000 (21:52 +0000)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 28 Nov 2017 08:25:39 +0000 (09:25 +0100)
The intent is for the call to succeed only when privileged, so make
that clear.

src/test/test-process-util.c

index 47733788f3e6421ab7962f209f9f909584ab9426..9b65f103d7324756a33ccfc514797da7e6ca74e9 100644 (file)
@@ -425,7 +425,7 @@ static void test_rename_process_multi(void) {
         /* child */
         test_rename_process_now("one", 1);
         test_rename_process_now("more", 0); /* longer than "one", hence truncated */
         /* child */
         test_rename_process_now("one", 1);
         test_rename_process_now("more", 0); /* longer than "one", hence truncated */
-        setresuid(99, 99, 99);
+        (void) setresuid(99, 99, 99); /* change uid when running privileged */
         test_rename_process_now("time!", 0);
         test_rename_process_now("0", 1); /* shorter than "one", should fit */
         test_rename_process_one("", -EINVAL);
         test_rename_process_now("time!", 0);
         test_rename_process_now("0", 1); /* shorter than "one", should fit */
         test_rename_process_one("", -EINVAL);