7fa9bda53036d4cc6ab243524cd1b74287630d31
8 #include "khatus_lib_log.h"
9 #include "khatus_lib_sensor.h"
10 #include "khatus_lib_time.h"
17 int fun(char *, void *),
21 int w
= -1; /* written */
22 int r
= -1; /* remaining */
23 int i
= -1; /* buffer position */
26 debug("openning \"%s\"\n", fifo
);
27 fd
= open(fifo
, O_WRONLY
);
29 fatal("Failed to open FIFO file: \"%s\". Error: %s\n",
32 debug("openned. fd: %d\n", fd
);
34 buf
[r
] = END_OF_MESSAGE
;
35 for (i
= 0; (w
= write(fd
, buf
+ i
++, 1)) && r
; r
--)
40 error("Broken pipe. Msg buf: %s\n", buf
);
44 "Failed to write to %s. "
45 "Err num: %d, Err msg: %s\n",
51 fatal("Failed to close %s. Err num: %d, Err msg: %s\n",
56 debug("closed. fd: %d\n", fd
);
This page took 0.07651 seconds and 3 git commands to generate.