/* TODO: Create the FIFO if it doesn't already exist. */
if (lstat(f->name, &st) < 0) {
error("Cannot stat \"%s\". Error: %s\n", f->name, strerror(errno));
/* TODO: Create the FIFO if it doesn't already exist. */
if (lstat(f->name, &st) < 0) {
error("Cannot stat \"%s\". Error: %s\n", f->name, strerror(errno));
continue;
}
if (!(st.st_mode & S_IFIFO)) {
error("\"%s\" is not a FIFO\n", f->name);
continue;
}
if (!(st.st_mode & S_IFIFO)) {
error("\"%s\" is not a FIFO\n", f->name);
if (f->fd == -1) {
/* TODO: Consider backing off retries for failed fifos. */
error("Failed to open \"%s\"\n", f->name);
if (f->fd == -1) {
/* TODO: Consider backing off retries for failed fifos. */
error("Failed to open \"%s\"\n", f->name);
for (Fifo *f = cfg->fifos; f; f = f->next) {
if (FD_ISSET(f->fd, &fds)) {
debug("reading: %s\n", f->name);
for (Fifo *f = cfg->fifos; f; f = f->next) {
if (FD_ISSET(f->fd, &fds)) {
debug("reading: %s\n", f->name);
for (;;) {
/* TODO: Check TTL and maybe blank-out */
/* TODO: How to trigger TTL check? On select? Alarm signal? */
for (;;) {
/* TODO: Check TTL and maybe blank-out */
/* TODO: How to trigger TTL check? On select? Alarm signal? */
- /* TODO: Set timeout on read_all based on diff of last time of
- * read_all and desired time of next TTL check.
+ /* TODO: Set timeout on fifo_read_all based on diff of last time of
+ * fifo_read_all and desired time of next TTL check.
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");