[patch] getgrouplist.3: tfix in example

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In example of getgrouplist, if getpwnam returns NULL, the program
exits. The exit code EXIT_SUCCESS looks like a mistake, since the
program also calls perror right before.

This patch changes the exit code to EXIT_FAILURE.

Best regards, Fedor.

---
 man3/getgrouplist.3 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man3/getgrouplist.3 b/man3/getgrouplist.3
index 41389b6c3..239913ce6 100644
--- a/man3/getgrouplist.3
+++ b/man3/getgrouplist.3
@@ -165,7 +165,7 @@ main(int argc, char *argv[])
     pw = getpwnam(argv[1]);
     if (pw == NULL) {
         perror("getpwnam");
-        exit(EXIT_SUCCESS);
+        exit(EXIT_FAILURE);
     }
 \&
     /* Retrieve group list. */
-- 
2.34.1




[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux