415
415
GIOCondition cond;
417
if (!self->watches_running)
417
if (self->watches_running)
420
log_proto_prepare(self->proto, &fd, &cond);
422
self->fd_watch.fd = fd;
424
if (self->pollable_state < 0)
419
log_proto_prepare(self->proto, &fd, &cond);
421
self->fd_watch.fd = fd;
423
if (self->pollable_state < 0)
425
/* auto-detect if the fd can be polled using ivykis */
426
if (is_file_regular(fd))
427
self->pollable_state = 0;
428
else if (iv_fd_register_try(&self->fd_watch) == 0)
429
self->pollable_state = 1;
431
self->pollable_state = 0;
433
else if (self->pollable_state > 0)
434
iv_fd_register(&self->fd_watch);
436
log_writer_update_watches(self);
437
self->watches_running = TRUE;
426
if (is_file_regular(fd))
427
self->pollable_state = 0;
429
self->pollable_state = !iv_fd_register_try(&self->fd_watch);
431
else if (self->pollable_state > 0)
432
iv_fd_register(&self->fd_watch);
434
log_writer_update_watches(self);
435
self->watches_running = TRUE;