Displaying 16 results from an estimated 16 matches for "do_inotify_files".
2014 Sep 23
0
[PATCH 09/13] syntax-check: fix prohibit_path_max_allocation check
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
---
daemon/inotify.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/daemon/inotify.c b/daemon/inotify.c
index 36e5ede..b847b7d 100644
--- a/daemon/inotify.c
+++ b/daemon/inotify.c
@@ -309,7 +309,7 @@ do_inotify_files (void)
unsigned int i;
FILE *fp = NULL;
guestfs_int_inotify_event_list *events;
- char buf[PATH_MAX];
+ char *buf = NULL;
char tempfile[] = "/tmp/inotifyXXXXXX";
int fd;
char cmd[64];
@@ -361,6 +361,12 @@ do_inotify_files (void)
return NULL;
}
+ buf = malloc...
2009 Aug 10
2
daemon/ warnings
...d "comparison between signed and unsigned integer expressions"
warnings. If it's at all hard or risky to avoid this type of warning,
then it's not worthwhile. Here, it's easy and safe.
* daemon/inotify.c (inotify_posn): Declare local to be of unsigned 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[6...
2014 Sep 23
1
Re: [PATCH 09/13] syntax-check: fix prohibit_path_max_allocation check
...on(-)
While I'd personally get rid of PATH_MAX at all, I understand the Linux
inotify implementation relies on it...
>
> diff --git a/daemon/inotify.c b/daemon/inotify.c
> index 36e5ede..b847b7d 100644
> --- a/daemon/inotify.c
> +++ b/daemon/inotify.c
> @@ -309,7 +309,7 @@ do_inotify_files (void)
> unsigned int i;
> FILE *fp = NULL;
> guestfs_int_inotify_event_list *events;
> - char buf[PATH_MAX];
> + char *buf = NULL;
Make it CLEANUP_FREE, so you don't need to manually free it later (and
gets freed in every exit point of the function).
--
Pino Tosca...
2011 Jun 09
15
[PATCH 00/13] Fix errors found using Coverity static analyzer.
I ran the Coverity static analyzer[1] on libguestfs, and fixed many
errors as a result.
Coverity found some errors in gnulib, but it doesn't seem to be worth
following those up since the version of gnulib we are using is so old.
There are a couple more errors (possibly 1 false-positive) which I'm
going to send in a separate email.
BTW all the errors found by Coverity were in the daemon
2012 Feb 01
1
[PATCH] Clarify the error message when unavailable functions are called (RHBZ#679737).
...00,7 @@ do_inotify_rm_watch (int wd)
return 0;
#else
- NOT_AVAILABLE (-1);
+ NOT_AVAILABLE (inotify, -1);
#endif
}
@@ -314,7 +314,7 @@ do_inotify_read (void)
free (ret);
return NULL;
#else
- NOT_AVAILABLE (NULL);
+ NOT_AVAILABLE (inotify, NULL);
#endif
}
@@ -405,6 +405,6 @@ do_inotify_files (void)
unlink (tempfile);
return NULL;
#else
- NOT_AVAILABLE (NULL);
+ NOT_AVAILABLE (inotify, NULL);
#endif
}
diff --git a/daemon/luks.c b/daemon/luks.c
index 02620ef..148a0ab 100644
--- a/daemon/luks.c
+++ b/daemon/luks.c
@@ -1,5 +1,5 @@
/* libguestfs - the guestfsd daemon
- * Copyrig...
2016 Jul 07
0
[PATCH 2/2] daemon: fix cleanup of stringsbuf usages
...enames.size);
return NULL;
}
- return filenames.argv;
+ return take_stringsbuf (&filenames);
}
char *
diff --git a/daemon/inotify.c b/daemon/inotify.c
index 562365b..277c94c 100644
--- a/daemon/inotify.c
+++ b/daemon/inotify.c
@@ -307,7 +307,7 @@ do_inotify_read (void)
char **
do_inotify_files (void)
{
- DECLARE_STRINGSBUF (ret);
+ CLEANUP_FREE_STRINGSBUF DECLARE_STRINGSBUF (ret);
unsigned int i;
FILE *fp = NULL;
guestfs_int_inotify_event_list *events;
@@ -380,7 +380,7 @@ do_inotify_files (void)
goto error;
unlink (tempfile);
- return ret.argv;
+ return take_strin...
2016 Jul 07
2
[PATCH 1/2] daemon: free the string on stringsbuf add failure
If add_string_nodup fails free the passed string instead of leaking it,
as that string would have been owned by the stringbuf.
Adapt few places to this behaviour.
---
daemon/btrfs.c | 4 +---
daemon/devsparts.c | 8 ++++----
daemon/guestfsd.c | 1 +
3 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/daemon/btrfs.c b/daemon/btrfs.c
index 9b52aa8..d70565a 100644
---
2012 Mar 13
2
[PATCH 0/2] 'int' to 'size_t' changes
These two patches are probably not completely independent, but
separating them is a lot of work.
With *both* patches applied, all the tests and extra-tests pass.
That's no guarantee however that there isn't a mistake, so I don't
think this patch is a candidate for the 1.16 branch, until it's had a
lot more testing in development.
Rich.
2014 Sep 23
27
[PATCH 00/13] syntax-check
Hi Rich,
This series includes patches to make `make syntax-check` pass.
Some of the fix require change to maint.mk, but the file is not in git
repo. Is it intended?
Thanks!
Hu Tao (13):
syntax-check: dirty hack to pass bindtextdomain check
syntax-check: fix error_message_period check
syntax-check: fix makefile_at_at_check
syntax-check: fix prohibit_assert_without_use check
2012 Aug 30
2
[PATCH v2] daemon: collect list of called external commands
...x 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/daemon/isoinfo.c b/daemon/isoinfo.c
index c0ee1...
2012 Aug 30
1
[PATCH] collect list of called external commands
...ex 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/daemon/isoinfo.c b/daemon/isoinfo.c
index c0ee1...
2017 Jul 27
0
[PATCH v2] daemon: Remove GUESTFSD_EXT_CMD.
...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/daemon/isoinfo.c b/daemon/isoinfo.c
index 3e1ac...
2017 Jul 24
0
[PATCH 2/2] daemon: Replace GUESTFSD_EXT_CMD with --print-external-commands.
....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/daemon/isoinfo.c b/daemon/isoinfo.c
index 3e1ac...
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.
...Should have optional string fields XXX. */
if (in->in_name == NULL) {
- reply_with_perror ("strdup");
- goto error;
+ reply_with_perror ("strdup");
+ goto error;
}
/* Estimate space used by this event in the message. */
@@ -279,7 +279,7 @@ do_inotify_files (void)
const char *name = events->guestfs_int_inotify_event_list_val[i].in_name;
if (name[0] != '\0')
- fprintf (fp, "%s\n", name);
+ fprintf (fp, "%s\n", name);
}
xdr_free ((xdrproc_t) xdr_guestfs_int_inotify_event_list, (char *) even...