summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
5f81deb)
If a signal occurred before the while loop is reached, it was lost.
+static sig_atomic_t signaled = 0;
+
+
static void sig_handler(int signal) {
(void)signal;
static void sig_handler(int signal) {
(void)signal;
}
static void setup_signals(void) {
struct sigaction action;
}
static void setup_signals(void) {
struct sigaction action;
ssize_t r;
assert(SSIZE_MAX <= SIZE_MAX);
ssize_t r;
assert(SSIZE_MAX <= SIZE_MAX);
- while ((r = read(fd, buffer, sizeof(buffer))) > 0) {
+ while (!signaled && (r = read(fd, buffer, sizeof(buffer))) > 0) {
size_t space;
ssize_t r2;
size_t space;
ssize_t r2;