From 29794f9b99099ebcbee157359bc4fa1d4cdf9c1c Mon Sep 17 00:00:00 2001 From: Albert S Date: Mon, 30 Sep 2013 19:45:48 +0200 Subject: [PATCH] Bugfix: read from stdin before we check whether we got somem entries... --- adhocify.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/adhocify.c b/adhocify.c index 7f75ff9..141d085 100644 --- a/adhocify.c +++ b/adhocify.c @@ -309,7 +309,7 @@ void check_forkbomb(const char *path_logfile, const char *path_prog) void queue_watches_from_stdin() { char *line = NULL; - size_t n = 0; + size_t n = 0; ssize_t r; while((r = getline(&line, &n, stdin)) != -1) { @@ -471,15 +471,15 @@ int main(int argc, char **argv) } } + if(fromstdin) + queue_watches_from_stdin(); + if(watchlist_head == NULL) { watchpath = cur_wkdir(); watchqueue_addpath(watchpath); } - if(fromstdin) - queue_watches_from_stdin(); - if(mask == 0) mask |= IN_CLOSE_WRITE;