]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Actually read the signal from the buffer
authorRoy Marples <roy@marples.name>
Wed, 7 Nov 2007 10:42:30 +0000 (10:42 +0000)
committerRoy Marples <roy@marples.name>
Wed, 7 Nov 2007 10:42:30 +0000 (10:42 +0000)
signals.c

index bb36cf6c2c12bae9993dd425c29e2cc66e991161..81829c9b380cc61a5d3fde7426d3aa2f5440639c 100644 (file)
--- a/signals.c
+++ b/signals.c
@@ -112,6 +112,9 @@ int signal_read (fd_set *rfds)
                memset (buf, 0, buflen);
                bytes = read (signal_pipe[0], buf, buflen);
 
+               if (bytes >= sizeof (sig))
+                       memcpy (&sig, buf, sizeof (sig));
+
                /* We need to clear us from rfds if nothing left in the buffer
                 * in case we are called many times */
                if (bytes == sizeof (sig))