aboutsummaryrefslogtreecommitdiffstats
path: root/prototypes/connections
diff options
context:
space:
mode:
Diffstat (limited to 'prototypes/connections')
-rw-r--r--prototypes/connections/edit-tui.c2
-rw-r--r--prototypes/connections/server.c4
-rw-r--r--prototypes/connections/test-async.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/prototypes/connections/edit-tui.c b/prototypes/connections/edit-tui.c
index d7b1442..2b320ee 100644
--- a/prototypes/connections/edit-tui.c
+++ b/prototypes/connections/edit-tui.c
@@ -55,7 +55,7 @@ static void wake_signal(int signal_number) {
else 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;
}
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 */ }
}
}
diff --git a/prototypes/connections/test-async.c b/prototypes/connections/test-async.c
index ad5f15a..e31b1d7 100644
--- a/prototypes/connections/test-async.c
+++ b/prototypes/connections/test-async.c
@@ -38,7 +38,7 @@ static void *write_after_signal(void *context) {
worker->effect.value, &worker->reply,
&worker->revision);
}
- (void)write(worker->done, &byte, 1);
+ if (write(worker->done, &byte, 1) < 0) { /* full: its reader is woken already */ }
return NULL;
}