]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
simmpleinit: fix gcc warning (buffer size in read())
authorKarel Zak <kzak@redhat.com>
Tue, 3 Mar 2009 14:31:39 +0000 (15:31 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 3 Mar 2009 14:31:39 +0000 (15:31 +0100)
simpleinit.c:846:
/usr/include/bits/unistd.h:43  warning: call to ‘__read_chk_warn’
declared with attribute warning: read called with bigger length than
size of the destination buffer

Signed-off-by: Karel Zak <kzak@redhat.com>
login-utils/simpleinit.c

index 962d549bb248d5fcdba0f591366479b79244e463..cc844c90914051c67ed182bb04a6b99c69e44adf 100644 (file)
@@ -843,7 +843,7 @@ static pid_t mywait (int *status)
     }
     do_longjmp = 1;  /*  After this, SIGCHLD will cause a jump backwards  */
     sigprocmask (SIG_UNBLOCK, &ss, NULL);
-    read (initctl_fd, buffer, COMMAND_SIZE);
+    read (initctl_fd, buffer, sizeof(buffer));
     do_longjmp = 0;
     process_command (command);
     return 0;