From 10217bb0e231c820d0012150151511d99c877ff3 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Thu, 22 Aug 2024 08:33:34 -0700 Subject: [PATCH] libsysprof-capture: fix set_fd_blocking() It was missing an include for the define and the variable was flat out wrong when porting. Fixes: #124 --- src/libsysprof-capture/sysprof-collector.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libsysprof-capture/sysprof-collector.c b/src/libsysprof-capture/sysprof-collector.c index c8fad1b8..eaf7e084 100644 --- a/src/libsysprof-capture/sysprof-collector.c +++ b/src/libsysprof-capture/sysprof-collector.c @@ -58,6 +58,7 @@ #include #include +#include #include #include #ifdef __linux__ @@ -140,7 +141,7 @@ set_fd_blocking (int fd) { #ifdef F_GETFL long fcntl_flags; - fcntl_flags = fcntl (peer_fd, F_GETFL); + fcntl_flags = fcntl (fd, F_GETFL); if (fcntl_flags == -1) return false; @@ -151,7 +152,7 @@ set_fd_blocking (int fd) fcntl_flags &= ~O_NDELAY; #endif - if (fcntl (peer_fd, F_SETFL, fcntl_flags) == -1) + if (fcntl (fd, F_SETFL, fcntl_flags) == -1) return false; return true;