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:
17e4ecd
)
Use read time _after_ IO became available
author
Siraaj Khandkar
<siraaj@khandkar.net>
Wed, 25 Mar 2020 00:45:09 +0000
(20:45 -0400)
committer
Siraaj Khandkar
<siraaj@khandkar.net>
Wed, 25 Mar 2020 00:45:09 +0000
(20:45 -0400)
x5/khatus.c
patch
|
blob
|
blame
|
history
diff --git
a/x5/khatus.c
b/x5/khatus.c
index
43a828b
..
18abc19
100644
(file)
--- a/
x5/khatus.c
+++ b/
x5/khatus.c
@@
-397,12
+397,13
@@
fifo_read_one(Fifo *f, struct timespec t, char *buf)
}
void
}
void
-fifo_read_all(Config *cfg,
struct timespec t,
char *buf)
+fifo_read_all(Config *cfg, char *buf)
{
fd_set fds;
int maxfd = -1;
int ready = 0;
struct stat st;
{
fd_set fds;
int maxfd = -1;
int ready = 0;
struct stat st;
+ struct timespec t;
FD_ZERO(&fds);
for (Fifo *f = cfg->fifos; f; f = f->next) {
FD_ZERO(&fds);
for (Fifo *f = cfg->fifos; f; f = f->next) {
@@
-441,6
+442,7
@@
fifo_read_all(Config *cfg, struct timespec t, char *buf)
if (ready < 0)
/* TODO: Do we really want to fail here? */
fatal("%s", strerror(errno));
if (ready < 0)
/* TODO: Do we really want to fail here? */
fatal("%s", strerror(errno));
+ clock_gettime(CLOCK_MONOTONIC, &t);
while (ready) {
for (Fifo *f = cfg->fifos; f; f = f->next) {
if (FD_ISSET(f->fd, &fds)) {
while (ready) {
for (Fifo *f = cfg->fifos; f; f = f->next) {
if (FD_ISSET(f->fd, &fds)) {
@@
-559,7
+561,7
@@
main(int argc, char *argv[])
* fifo_read_all and desired time of next TTL check?
*/
/* TODO: How long to wait on IO? Max TTL? */
* fifo_read_all and desired time of next TTL check?
*/
/* TODO: How long to wait on IO? Max TTL? */
- fifo_read_all(cfg,
t0,
buf);
+ fifo_read_all(cfg, buf);
if (cfg->output_to_x_root_window) {
if (XStoreName(display, DefaultRootWindow(display), buf) < 0)
fatal("XStoreName failed.\n");
if (cfg->output_to_x_root_window) {
if (XStoreName(display, DefaultRootWindow(display), buf) < 0)
fatal("XStoreName failed.\n");
This page took
0.029231 seconds
and
4
git commands to generate.