home
/
code
/
khatus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
716cc2b
)
Handle pselect errors
author
Siraaj Khandkar
<siraaj@khandkar.net>
Wed, 25 Mar 2020 01:43:35 +0000
(21:43 -0400)
committer
Siraaj Khandkar
<siraaj@khandkar.net>
Wed, 25 Mar 2020 01:43:35 +0000
(21:43 -0400)
x5/khatus.c
patch
|
blob
|
blame
|
history
diff --git
a/x5/khatus.c
b/x5/khatus.c
index
6ffa538
..
117fb98
100644
(file)
--- a/
x5/khatus.c
+++ b/
x5/khatus.c
@@
-429,8
+429,19
@@
fifo_read_all(Config *cfg, struct timespec *ti, char *buf)
debug("selecting...\n");
ready = pselect(maxfd + 1, &fds, NULL, NULL, ti, NULL);
debug("ready: %d\n", ready);
debug("selecting...\n");
ready = pselect(maxfd + 1, &fds, NULL, NULL, ti, NULL);
debug("ready: %d\n", ready);
- assert(ready >= 0);
clock_gettime(CLOCK_MONOTONIC, &t);
clock_gettime(CLOCK_MONOTONIC, &t);
+ if (ready == -1) {
+ switch (errno) {
+ case EINTR:
+ error("pselect temp failure: %d, errno: %d, msg: %s\n",
+ ready, errno, strerror(errno));
+ /* TODO: Reconsider what to do here. */
+ return;
+ default:
+ error("pselect failed: %d, errno: %d, msg: %s\n",
+ ready, errno, strerror(errno));
+ }
+ }
/* At-least-once ensures that expiries are still checked on timeouts. */
do {
for (Fifo *f = cfg->fifos; f; f = f->next) {
/* At-least-once ensures that expiries are still checked on timeouts. */
do {
for (Fifo *f = cfg->fifos; f; f = f->next) {
This page took
0.020994 seconds
and
4
git commands to generate.