From 7df77203ad3d33388748a9fc3b22380b16b2e588 Mon Sep 17 00:00:00 2001 From: Tom Meyer-Mallorie Date: Sat, 7 Oct 2023 22:51:00 +0100 Subject: [PATCH] Correctly set O_NONBLOCK flag and disallow further reception using shutdown on saned data fd once a connection is open. --- frontend/saned.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/saned.c b/frontend/saned.c index 575499861..d71d428c5 100644 --- a/frontend/saned.c +++ b/frontend/saned.c @@ -2256,8 +2256,8 @@ process_request (Wire * w) strerror (errno)); return 1; } - fcntl (data_fd, F_SETFL, 1); /* set non-blocking */ - shutdown (data_fd, 0); + fcntl (data_fd, F_SETFL, O_NONBLOCK); /* set non-blocking */ + shutdown (data_fd, SHUT_RD); do_scan (w, h, data_fd); close (data_fd); }