opts_parse_any(cfg, argc, argv, i);
}
opts_parse_any(cfg, argc, argv, i);
}
f->last_read = last_read;
f->pos_init = cfg->total_width;
f->pos_curr = f->pos_init;
f->last_read = last_read;
f->pos_init = cfg->total_width;
f->pos_curr = f->pos_init;
}
opts_parse_any(cfg, argc, argv, i);
}
}
opts_parse_any(cfg, argc, argv, i);
}
if (timespeccmp(&td, &(f->ttl), >=)) {
/* TODO: Maybe configurable expiry character. */
memset(buf + f->pos_init, '_', f->pos_final - f->pos_init);
if (timespeccmp(&td, &(f->ttl), >=)) {
/* TODO: Maybe configurable expiry character. */
memset(buf + f->pos_init, '_', f->pos_final - f->pos_init);
- error("Failed to read: \"%s\". errno: %d, msg: %s\n",
- f->name, errno, strerror(errno));
+ khlib_error(
+ "Failed to read: \"%s\". errno: %d, msg: %s\n",
+ f->name, errno, strerror(errno)
+ );
for (Fifo *f = cfg->fifos; f; f = f->next) {
/* TODO: Create the FIFO if it doesn't already exist. */
if (lstat(f->name, &st) < 0) {
for (Fifo *f = cfg->fifos; f; f = f->next) {
/* TODO: Create the FIFO if it doesn't already exist. */
if (lstat(f->name, &st) < 0) {
ready = pselect(maxfd + 1, &fds, NULL, NULL, ti, NULL);
ready = pselect(maxfd + 1, &fds, NULL, NULL, ti, NULL);
- error("pselect temp failure: %d, errno: %d, msg: %s\n",
- ready, errno, strerror(errno));
+ khlib_error(
+ "pselect temp failure: %d, errno: %d, msg: %s\n",
+ ready,
+ errno,
+ strerror(errno)
+ );
- fatal("pselect failed: %d, errno: %d, msg: %s\n",
- ready, errno, strerror(errno));
+ khlib_fatal(
+ "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) {
if (FD_ISSET(f->fd, &fds)) {
}
}
/* At-least-once ensures that expiries are still checked on timeouts. */
do {
for (Fifo *f = cfg->fifos; f; f = f->next) {
if (FD_ISSET(f->fd, &fds)) {
/* 1st pass to check file existence and type */
for (Fifo *f = cfg.fifos; f; f = f->next) {
if (lstat(f->name, &st) < 0) {
/* 1st pass to check file existence and type */
for (Fifo *f = cfg.fifos; f; f = f->next) {
if (lstat(f->name, &st) < 0) {
width += (seplen * (nfifos - 1));
buf = calloc(1, width + 1);
if (buf == NULL)
width += (seplen * (nfifos - 1));
buf = calloc(1, width + 1);
if (buf == NULL)
/* TODO: Handle signals */
for (;;) {
clock_gettime(CLOCK_MONOTONIC, &t0); // FIXME: check errors
fifo_read_all(&cfg, &ti, buf);
if (cfg.output_to_x_root_window) {
if (XStoreName(d, DefaultRootWindow(d), buf) < 0)
/* TODO: Handle signals */
for (;;) {
clock_gettime(CLOCK_MONOTONIC, &t0); // FIXME: check errors
fifo_read_all(&cfg, &ti, buf);
if (cfg.output_to_x_root_window) {
if (XStoreName(d, DefaultRootWindow(d), buf) < 0)
}
clock_gettime(CLOCK_MONOTONIC, &t1); // FIXME: check errors
timespecsub(&t1, &t0, &td);
}
clock_gettime(CLOCK_MONOTONIC, &t1); // FIXME: check errors
timespecsub(&t1, &t0, &td);
* pipe more frequently than the interval.
*/
timespecsub(&ti, &td, &tc);
* pipe more frequently than the interval.
*/
timespecsub(&ti, &td, &tc);