aboutsummaryrefslogtreecommitdiffstats
path: root/prototypes/connections/server.c
diff options
context:
space:
mode:
authoreunhhu <[email protected]>2026-10-01 16:40:11 +0100
committereunhhu <[email protected]>2026-10-01 16:40:11 +0100
commit1fdf72444cdcf5041022c75ed616a1dcd458175b (patch)
tree73e1c333f2a1a1867db18bb346172f054bdf2912 /prototypes/connections/server.c
parent2963fb5a7deb0cca24c3aa410a11ebc0f8fb559a (diff)
downloadpure-1fdf72444cdcf5041022c75ed616a1dcd458175b.tar.gz
pure-1fdf72444cdcf5041022c75ed616a1dcd458175b.zip
Look at a wake write's result in the prototype, as fortified builds ask
Ubuntu's gcc defines _FORTIFY_SOURCE, which marks write's result as one to use, and a (void) cast does not quiet it: the prototype did not build there (research 029). Debian's does not define it; the Pi gives the same error with -D_FORTIFY_SOURCE=3.
Diffstat (limited to 'prototypes/connections/server.c')
-rw-r--r--prototypes/connections/server.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/prototypes/connections/server.c b/prototypes/connections/server.c
index 505bb71..af4ddd4 100644
--- a/prototypes/connections/server.c
+++ b/prototypes/connections/server.c
@@ -88,7 +88,7 @@ static void stop_server(int sig) {
stopping = 1;
if (wake_write >= 0) {
const char byte = 1;
- (void)write((int)wake_write, &byte, 1);
+ if (write((int)wake_write, &byte, 1) < 0) { /* full: its reader is woken already */ }
}
errno = saved_errno;
}
@@ -217,7 +217,7 @@ static void *effect_worker(void *context) {
job->state = JOB_DONE;
pthread_mutex_unlock(&server->job_mutex);
const char byte = 1;
- (void)write(server->effect_wake, &byte, 1);
+ if (write(server->effect_wake, &byte, 1) < 0) { /* full: its reader is woken already */ }
}
}