]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
control: Fix hangup for non privsep builds
authorRoy Marples <roy@marples.name>
Sun, 12 Nov 2023 11:30:01 +0000 (11:30 +0000)
committerRoy Marples <roy@marples.name>
Sun, 12 Nov 2023 11:30:26 +0000 (11:30 +0000)
Fix related to #262.

src/control.c

index 5325ac35095330844e7e52b8a1c6c5a12f0d9600..93041f8266fb494baed5925ecb4057a1be78db2b 100644 (file)
@@ -113,8 +113,9 @@ control_handle_read(struct fd_list *fd)
        ssize_t bytes;
 
        bytes = read(fd->fd, buffer, sizeof(buffer) - 1);
-       if (bytes == -1) {
+       if (bytes == -1)
                logerr(__func__);
+       if (bytes == -1 || bytes == 0) {
                control_hangup(fd);
                return;
        }