Displaying 20 results from an estimated 24 matches for "errptr".
Did you mean:
err_ptr
2016 Feb 23
3
[PATCH 1/2] lib: Allow the COMPILE_REGEXP macro to be used everywhere.
Since the daemon links to pcre and use regular expressions, and since
the COMPILE_REGEXP macro doesn't depend on any aspects of the
library-side code (eg. the guestfs_h handle etc), we can allow the
daemon to use the COMPILE_REGEXP macro. Move the macro to
"guestfs-internal-all.h" to permit this.
---
src/guestfs-internal-all.h | 26 ++++++++++++++++++++++++++
src/guestfs-internal.h
2013 Jan 24
5
[PATCH] btrfs: Fix btrfs_subvolume_list on F18
...fixed, but different versions
+ * of btrfs may display different sets of data. Specifically, older versions
+ * of btrfs do not display gen.
*/
nr_subvolumes = count_strings (lines);
@@ -384,33 +390,64 @@ do_btrfs_subvolume_list (const char *fs)
return NULL;
}
+ const char *errptr;
+ int erroffset;
+ pcre *re = pcre_compile ("ID\\s+(\\d+).*\\s"
+ "top level\\s+(\\d+).*\\s"
+ "path\\s(.*)",
+ 0, &errptr, &erroffset, NULL);
+ if (re == NULL) {
+ reply_with_...
2015 Jun 17
6
[PATCH v4 0/3] btrfs: use CLEANUP_FREE_STRING_LIST for list free
As Pino's comment, we should take advantage of
macro CLEANUP_FREE_STRING_LIST
v4: remove some redundant strdup
v3: fix test case failure
v2: properly initialize lines
Chen Hanxiao (3):
do_btrfs_qgroup_show: fix a bad return value
do_btrfs_subvolume_list: fix a bad return value
btrfs: use CLEANUP_FREE_STRING_LIST for list free
daemon/btrfs.c | 70
2015 Feb 11
0
[PATCH v3 1/2] New API: btrfs_balance_status
...fs_balance_status (const char *path)
+{
+ const size_t MAX_ARGS = 64;
+ const char *argv[MAX_ARGS];
+ size_t i = 0;
+ CLEANUP_FREE char *path_buf = NULL;
+ CLEANUP_FREE char *err = NULL;
+ char *out;
+ int r;
+ guestfs_int_btrfsbalance *ret;
+ char **lines;
+ size_t nlines;
+ const char *errptr;
+ int erroffset;
+#define N_MATCH 2
+ int ovector[N_MATCH * 3];
+ pcre *re = NULL;
+
+ path_buf = sysroot_path (path);
+ if (path_buf == NULL) {
+ reply_with_perror ("malloc");
+ return NULL;
+ }
+
+ ADD_ARG (argv, i, str_btrfs);
+ ADD_ARG (argv, i, "balance");
+...
2015 Feb 13
0
[PATCH v4 1/2] New API: btrfs_balance_status
...fs_balance_status (const char *path)
+{
+ const size_t MAX_ARGS = 64;
+ const char *argv[MAX_ARGS];
+ size_t i = 0;
+ CLEANUP_FREE char *path_buf = NULL;
+ CLEANUP_FREE char *err = NULL;
+ char *out;
+ int r;
+ guestfs_int_btrfsbalance *ret;
+ char **lines;
+ size_t nlines;
+ const char *errptr;
+ int erroffset;
+#define N_MATCH 2
+ int ovector[N_MATCH * 3];
+ pcre *re = NULL;
+
+ path_buf = sysroot_path (path);
+ if (path_buf == NULL) {
+ reply_with_perror ("malloc");
+ return NULL;
+ }
+
+ ADD_ARG (argv, i, str_btrfs);
+ ADD_ARG (argv, i, "balance");
+...
2015 Feb 02
0
Re: [PATCH 1/2] New API: btrfs_balance_status
...fsbalance_status = strdup("none");
Where you call strdup, you have to check that the return value is not
NULL, and if it is call reply_with_perror ("strdup").
> + return ret;
> + }
> +
> + re = pcre_compile ("Balance on '.*' is (.*)", 0, &errptr, &erroffset, NULL);
> + if (re == NULL) {
> + reply_with_error ("pcre_compile (%i): %s", erroffset, errptr);
> + goto error;
> + }
> + if (pcre_exec (re, NULL, lines[0], strlen (lines[0]), 0, 0,
> + ovector, N_MATCH * 3) < 0) {
> + r...
2015 Feb 13
3
[PATCH v4 0/2] add btrfs_balance_status and btrfs_scrub_status
v4:
- add reply_with_error when nlines < 1
- remove `i == X' tests.
v3:
- rebase on upstream
- fix some comments
v2:
- add check for the length of lines[]
- the code parsing 'btrfs scrub -R status' output is changed into a loop
Hu Tao (2):
New API: btrfs_balance_status
New API: btfs_scrub_status
daemon/btrfs.c | 268
2015 Feb 13
1
Re: [PATCH v4 1/2] New API: btrfs_balance_status
...ize_t MAX_ARGS = 64;
> + const char *argv[MAX_ARGS];
> + size_t i = 0;
> + CLEANUP_FREE char *path_buf = NULL;
> + CLEANUP_FREE char *err = NULL;
> + char *out;
> + int r;
> + guestfs_int_btrfsbalance *ret;
> + char **lines;
> + size_t nlines;
> + const char *errptr;
> + int erroffset;
> +#define N_MATCH 2
> + int ovector[N_MATCH * 3];
> + pcre *re = NULL;
> +
> + path_buf = sysroot_path (path);
> + if (path_buf == NULL) {
> + reply_with_perror ("malloc");
> + return NULL;
> + }
> +
> + ADD_ARG (argv,...
2015 Feb 02
5
[PATCH 1/2] New API: btrfs_balance_status
...sbalance *
+do_btrfs_balance_status (const char *path)
+{
+ const size_t MAX_ARGS = 64;
+ const char *argv[MAX_ARGS];
+ size_t i = 0;
+ CLEANUP_FREE char *path_buf = NULL;
+ CLEANUP_FREE char *err = NULL;
+ char *out;
+ int r;
+ guestfs_int_btrfsbalance *ret;
+ char **lines;
+ const char *errptr;
+ int erroffset;
+#define N_MATCH 2
+ int ovector[N_MATCH * 3];
+ pcre *re = NULL;
+
+ path_buf = sysroot_path (path);
+ if (path_buf == NULL) {
+ reply_with_perror ("malloc");
+ return NULL;
+ }
+
+ ADD_ARG (argv, i, str_btrfs);
+ ADD_ARG (argv, i, "balance");
+...
2015 Jun 17
2
Re: [PATCH v4 2/3] do_btrfs_subvolume_list: fix a bad return value
...ubvolume_list_val == NULL) {
> reply_with_perror ("malloc");
> - goto error;
> + free (ret);
> + return NULL;
> }
You don't need the change here, if later in the "error:" label you keep
the "if (ret)" condition.
> const char *errptr;
> @@ -530,20 +531,27 @@ do_btrfs_subvolume_list (const mountable_t *fs)
>
> #undef XSTRTOU64
>
> - memmove (line, line + ovector[6], ovector[7] - ovector[6] + 1);
> - this->btrfssubvolume_path = line;
> + this->btrfssubvolume_path =
> + strndup...
2015 Feb 03
2
[PATCH v2 0/2] add btrfs_balance_status and btrfs_scrub_status
changes in v2:
- add check for the length of lines[]
- the code parsing 'btrfs scrub -R status' output is changed into a loop
Hu Tao (2):
New API: btrfs_balance_status
New API: btfs_scrub_status.
daemon/btrfs.c | 263 +++++++++++++++++++++++++++++++
generator/actions.ml | 26 +++
generator/structs.ml | 34 ++++
2015 Jun 15
7
[PATCH v3 0/3] btrfs: use CLEANUP_FREE_STRING_LIST for list free
As Pino's comment, we should take advantage of
macro CLEANUP_FREE_STRING_LIST
v3: fix test case failure
v2: properly initialize lines
Chen Hanxiao (3):
do_btrfs_qgroup_show: fix a bad return value
do_btrfs_subvolume_list: fix a bad return value
btrfs: use CLEANUP_FREE_STRING_LIST for list free
daemon/btrfs.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
2015 Feb 15
4
[PATCH v5 0/2] add btrfs_balance_status and btrfs_scrub_status
v5:
- fix tests failure
v4:
- add reply_with_error when nlines < 1
- remove `i == X' tests.
v3:
- rebase on upstream
- fix some comments
v2:
- add check for the length of lines[]
- the code parsing 'btrfs scrub -R status' output is changed into a loop
Hu Tao (2):
New API: btrfs_balance_status
New API: btfs_scrub_status
daemon/btrfs.c
2015 Feb 11
4
[PATCH v3 0/2] add btrfs_balance_status and btrfs_scrub_status
v3:
- rebase on upstream
- fix some comments
v2:
- add check for the length of lines[]
- the code parsing 'btrfs scrub -R status' output is changed into a loop
Hu Tao (2):
New API: btrfs_balance_status
New API: btfs_scrub_status
daemon/btrfs.c | 263 +++++++++++++++++++++++++++++++
generator/actions.ml | 26 +++
2020 Mar 26
0
[PATCH 5/6] drm/nouveau/therm: convert to use i2c_new_client_device()
Move away from the deprecated API and return the shiny new ERRPTR where
useful.
Signed-off-by: Wolfram Sang <wsa+renesas at sang-engineering.com>
---
drivers/gpu/drm/nouveau/nvkm/subdev/therm/ic.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/ic.c b/drivers/gpu/drm/nouveau/nvkm/subdev/the...
2015 Jun 12
1
[PATCH] btrfs: use CLEANUP_FREE_STRING_LIST for list free
...2);
if (ret)
free (ret->guestfs_int_btrfsqgroup_list_val);
free (ret);
@@ -1707,7 +1703,7 @@ do_btrfs_balance_status (const char *path)
char *out;
int r;
guestfs_int_btrfsbalance *ret;
- char **lines;
+ CLEANUP_FREE_STRING_LIST char **lines;
size_t nlines;
const char *errptr;
int erroffset;
@@ -1833,7 +1829,7 @@ do_btrfs_scrub_status (const char *path)
char *out;
int r;
guestfs_int_btrfsscrub *ret;
- char **lines;
+ CLEANUP_FREE_STRING_LIST char **lines;
path_buf = sysroot_path (path);
if (path_buf == NULL) {
--
2.1.0
2015 Jun 12
1
[PATCH v2] btrfs: use CLEANUP_FREE_STRING_LIST for list free
...700,10 @@ do_btrfs_balance_status (const char *path)
size_t i = 0;
CLEANUP_FREE char *path_buf = NULL;
CLEANUP_FREE char *err = NULL;
+ CLEANUP_FREE_STRING_LIST char **lines = NULL;
char *out;
int r;
guestfs_int_btrfsbalance *ret;
- char **lines;
size_t nlines;
const char *errptr;
int erroffset;
@@ -1830,10 +1826,10 @@ do_btrfs_scrub_status (const char *path)
size_t i = 0;
CLEANUP_FREE char *path_buf = NULL;
CLEANUP_FREE char *err = NULL;
+ CLEANUP_FREE_STRING_LIST char **lines = NULL;
char *out;
int r;
guestfs_int_btrfsscrub *ret;
- char **lines;...
2015 Jun 15
0
[PATCH v2 3/3] btrfs: use CLEANUP_FREE_STRING_LIST for list free
...704,10 @@ do_btrfs_balance_status (const char *path)
size_t i = 0;
CLEANUP_FREE char *path_buf = NULL;
CLEANUP_FREE char *err = NULL;
+ CLEANUP_FREE_STRING_LIST char **lines = NULL;
char *out;
int r;
guestfs_int_btrfsbalance *ret;
- char **lines;
size_t nlines;
const char *errptr;
int erroffset;
@@ -1830,10 +1830,10 @@ do_btrfs_scrub_status (const char *path)
size_t i = 0;
CLEANUP_FREE char *path_buf = NULL;
CLEANUP_FREE char *err = NULL;
+ CLEANUP_FREE_STRING_LIST char **lines = NULL;
char *out;
int r;
guestfs_int_btrfsscrub *ret;
- char **lines;...
2015 Jun 17
0
[PATCH v4 3/3] btrfs: use CLEANUP_FREE_STRING_LIST for list free
...692,10 @@ do_btrfs_balance_status (const char *path)
size_t i = 0;
CLEANUP_FREE char *path_buf = NULL;
CLEANUP_FREE char *err = NULL;
+ CLEANUP_FREE_STRING_LIST char **lines = NULL;
char *out;
int r;
guestfs_int_btrfsbalance *ret;
- char **lines;
size_t nlines;
const char *errptr;
int erroffset;
@@ -1817,10 +1817,10 @@ do_btrfs_scrub_status (const char *path)
size_t i = 0;
CLEANUP_FREE char *path_buf = NULL;
CLEANUP_FREE char *err = NULL;
+ CLEANUP_FREE_STRING_LIST char **lines = NULL;
char *out;
int r;
guestfs_int_btrfsscrub *ret;
- char **lines;...
2015 Jun 17
0
[PATCH v4 2/3] do_btrfs_subvolume_list: fix a bad return value
..._btrfs_subvolume_list (const mountable_t *fs)
calloc (nr_subvolumes, sizeof (struct guestfs_int_btrfssubvolume));
if (ret->guestfs_int_btrfssubvolume_list_val == NULL) {
reply_with_perror ("malloc");
- goto error;
+ free (ret);
+ return NULL;
}
const char *errptr;
@@ -530,20 +531,27 @@ do_btrfs_subvolume_list (const mountable_t *fs)
#undef XSTRTOU64
- memmove (line, line + ovector[6], ovector[7] - ovector[6] + 1);
- this->btrfssubvolume_path = line;
+ this->btrfssubvolume_path =
+ strndup (line + ovector[6], ovector[7] - ovector...