search for: inotify_fd

Displaying 12 results from an estimated 12 matches for "inotify_fd".

2005 Aug 22
2
Re: Dovecot inotify problem
...and the > followup from akpm. Thanks for the link. I don't think akpm is right, unless something is really odd here. Could you add debugging output for me please? Maybe something like (this is not a patch you can apply, look at line 164 in src/lib/ioloop-notify-inotify.c) ctx->inotify_fd = inotify_init(); + i_warning("inotify_init returned fd %d", ctx->inotify_fd); if (ctx->inotify_fd == -1) { and line 106: IN_CLOSE | IN_MODIFY); + i_warning("inotify_add_watch returned %d", watchdescriptor); if (...
2017 Mar 03
2
[PATCH 1/2] Use gnulib set_nonblocking_flag function instead of fcntl.
...fy.h> #endif +#include "nonblocking.h" + #include "guestfs_protocol.h" #include "daemon.h" #include "actions.h" @@ -112,8 +114,8 @@ do_inotify_init (int max_events) reply_with_perror ("inotify_init"); return -1; } - if (fcntl (inotify_fd, F_SETFL, O_NONBLOCK) == -1) { - reply_with_perror ("fcntl: O_NONBLOCK"); + if (set_nonblocking_flag (inotify_fd, 1) == -1) { + reply_with_perror ("set_nonblocking_flag"); close (inotify_fd); inotify_fd = -1; return -1; diff --git a/lib/conn-socket.c b/lib/...
2009 Aug 10
2
daemon/ warnings
...ned type. (do_inotify_read, do_inotify_files): Likewise. --- daemon/inotify.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/daemon/inotify.c b/daemon/inotify.c index 1b90f2b..8bb8ed2 100644 --- a/daemon/inotify.c +++ b/daemon/inotify.c @@ -33,7 +33,7 @@ static int inotify_fd = -1; static char inotify_buf[64*1024*1024]; /* Event buffer, [0..posn-1] is valid */ -static int inotify_posn = 0; +static size_t inotify_posn = 0; /* Because inotify_init does NEED_ROOT, NEED_INOTIFY implies NEED_ROOT. */ #define NEED_INOTIFY(errcode) \ @@ -184,7 +184,8 @@ do_inotify_re...
2012 Jan 24
14
[PATCH 00/14] Run the daemon under valgrind and fix resultant errors.
This patch series lets you run the daemon under valgrind. Many errors were found and fixed. With the complete series applied, valgrind doesn't show any errors.
2012 Feb 01
1
[PATCH] Clarify the error message when unavailable functions are called (RHBZ#679737).
From: "Richard W.M. Jones" <rjones at redhat.com> Callers are supposed to use the availability API to check for functions that may not be available in particular builds of libguestfs. If they don't do this, currently they tend to get obscure error messages, eg: libguestfs: error: zerofree: /dev/vda1: zerofree: No such file or directory This commit changes the error
2012 Aug 30
2
[PATCH v2] daemon: collect list of called external commands
...aemon/inotify.c b/daemon/inotify.c index ed425b8..cb0a366 100644 --- a/daemon/inotify.c +++ b/daemon/inotify.c @@ -35,6 +35,8 @@ #include "optgroups.h" #ifdef HAVE_SYS_INOTIFY_H +GUESTFSD_EXT_CMD(str_sort, sort); + /* Currently open inotify handle, or -1 if not opened. */ static int inotify_fd = -1; @@ -318,7 +320,7 @@ do_inotify_files (void) return NULL; } - snprintf (cmd, sizeof cmd, "sort -u > %s", tempfile); + snprintf (cmd, sizeof cmd, "%s -u > %s", str_sort, tempfile); fp = popen (cmd, "w"); if (fp == NULL) { diff --git a/da...
2012 Aug 30
1
[PATCH] collect list of called external commands
...daemon/inotify.c b/daemon/inotify.c index ed425b8..3cbb237 100644 --- a/daemon/inotify.c +++ b/daemon/inotify.c @@ -35,6 +35,8 @@ #include "optgroups.h" #ifdef HAVE_SYS_INOTIFY_H +GUESTFS_EXT_CMD(str_sort, sort); + /* Currently open inotify handle, or -1 if not opened. */ static int inotify_fd = -1; @@ -318,7 +320,7 @@ do_inotify_files (void) return NULL; } - snprintf (cmd, sizeof cmd, "sort -u > %s", tempfile); + snprintf (cmd, sizeof cmd, "%s -u > %s", str_sort, tempfile); fp = popen (cmd, "w"); if (fp == NULL) { diff --git a/da...
2017 Jul 27
0
[PATCH v2] daemon: Remove GUESTFSD_EXT_CMD.
...n/inotify.c b/daemon/inotify.c index b9bfed713..aa2350900 100644 --- a/daemon/inotify.c +++ b/daemon/inotify.c @@ -38,7 +38,6 @@ #include "optgroups.h" #ifdef HAVE_SYS_INOTIFY_H -GUESTFSD_EXT_CMD(str_sort, sort); /* Currently open inotify handle, or -1 if not opened. */ static int inotify_fd = -1; @@ -327,7 +326,7 @@ do_inotify_files (void) return NULL; } - snprintf (cmd, sizeof cmd, "%s -u > %s", str_sort, tempfile); + snprintf (cmd, sizeof cmd, "sort -u > %s", tempfile); fp = popen (cmd, "w"); if (fp == NULL) { diff --git a/daem...
2017 Jul 24
0
[PATCH 2/2] daemon: Replace GUESTFSD_EXT_CMD with --print-external-commands.
...5ceaacfe7 100644 --- a/daemon/inotify.c +++ b/daemon/inotify.c @@ -38,7 +38,8 @@ #include "optgroups.h" #ifdef HAVE_SYS_INOTIFY_H -GUESTFSD_EXT_CMD(str_sort, sort); + +DECLARE_EXTERNAL_COMMANDS ("sort") /* Currently open inotify handle, or -1 if not opened. */ static int inotify_fd = -1; @@ -327,7 +328,7 @@ do_inotify_files (void) return NULL; } - snprintf (cmd, sizeof cmd, "%s -u > %s", str_sort, tempfile); + snprintf (cmd, sizeof cmd, "sort -u > %s", tempfile); fp = popen (cmd, "w"); if (fp == NULL) { diff --git a/daem...
2017 Jul 27
3
[PATCH v2] daemon: Remove GUESTFSD_EXT_CMD.
This is a simpler patch that removes GUESTFSD_EXT_CMD completely.
2017 Jul 24
6
[PATCH 0/2] daemon: Replace GUESTFSD_EXT_CMD with --print-external-commands.
Replace GUESTFSD_EXT_CMD with a command line option ‘./guestfsd --print-external-commands’
2009 Aug 03
1
[PATCH 1/2] Convert all TABs-as-indentation to spaces.
...size_t n, int *argtypes, int *size) { if (n > 0) { argtypes[0] = PA_STRING; diff --git a/daemon/inotify.c b/daemon/inotify.c index 43f282d..4bc6f17 100644 --- a/daemon/inotify.c +++ b/daemon/inotify.c @@ -165,10 +165,10 @@ do_inotify_read (void) int n, r; r = read (inotify_fd, inotify_buf + inotify_posn, - sizeof (inotify_buf) - inotify_posn); + sizeof (inotify_buf) - inotify_posn); if (r == -1) { if (errno == EWOULDBLOCK || errno == EAGAIN) /* End of list. */ - break; + break; reply_with_perror ("read"); got...