]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
kcmp.2: EXAMPLES: Use octal permissions instead of S_I* macros
authorAlejandro Colomar <alx.manpages@gmail.com>
Tue, 3 May 2022 20:32:30 +0000 (22:32 +0200)
committerAlejandro Colomar <alx.manpages@gmail.com>
Tue, 3 May 2022 20:32:30 +0000 (22:32 +0200)
Octal is much more readable.

Reported-by: checkpatch(1)
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
man2/kcmp.2

index 18efaad2b1e1d42f73024d6e4976fc470a298fc3..72ca65d3da58c89b5c23fbdbcc037981360f5796 100644 (file)
@@ -374,7 +374,7 @@ main(void)
     int fd1, fd2, fd3;
     char pathname[] = "/tmp/kcmp.test";
 
-    fd1 = open(pathname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR);
+    fd1 = open(pathname, O_CREAT | O_RDWR, 0600);
     if (fd1 == \-1)
         errExit("open");
 
@@ -391,7 +391,7 @@ main(void)
         test_kcmp("Compare duplicate FDs from different processes:",
                   getpid(), getppid(), fd1, fd1);
 
-        fd2 = open(pathname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR);
+        fd2 = open(pathname, O_CREAT | O_RDWR, 0600);
         if (fd2 == \-1)
             errExit("open");
         printf("Child opened file on FD %d\en", fd2);