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:
a415999
)
Catch broken pipe errors in time sensor
author
Siraaj Khandkar
<siraaj@khandkar.net>
Tue, 24 Mar 2020 22:57:58 +0000
(18:57 -0400)
committer
Siraaj Khandkar
<siraaj@khandkar.net>
Tue, 24 Mar 2020 22:57:58 +0000
(18:57 -0400)
x5/khatus_sensor_time.c
patch
|
blob
|
blame
|
history
diff --git
a/x5/khatus_sensor_time.c
b/x5/khatus_sensor_time.c
index
ad170ef
..
869134c
100644
(file)
--- a/
x5/khatus_sensor_time.c
+++ b/
x5/khatus_sensor_time.c
@@
-112,10
+112,18
@@
main(int argc, char **argv)
for (i = 0; (n = write(fd, buf + i++, 1)) && r; r--)
;
if (n < 0)
- fatal("Failed to write to %s. Err num: %d, Err msg: %s\n",
- fifo_name,
- errno,
- strerror(errno));
+ switch (errno) {
+ case EPIPE:
+ error("Broken pipe. Msg buf: %s\n", buf);
+ break;
+ default:
+ fatal(
+ "Failed to write to %s. "
+ "Err num: %d, Err msg: %s\n",
+ fifo_name,
+ errno,
+ strerror(errno));
+ }
if (close(fd) < 0)
fatal("Failed to close %s. Err num: %d, Err msg: %s\n",
fifo_name,
This page took
0.026233 seconds
and
4
git commands to generate.