search for: xstrtod64

Displaying 10 results from an estimated 10 matches for "xstrtod64".

2015 Oct 22
1
[PATCH] Bugfix in number parsing in vfs_min_size.
...d, 3 insertions(+), 3 deletions(-) diff --git a/daemon/ext2.c b/daemon/ext2.c index 342d217..6543574 100644 --- a/daemon/ext2.c +++ b/daemon/ext2.c @@ -336,7 +336,7 @@ ext_minimum_size (const char *device) for (i = 0; lines[i] != NULL; ++i) { if (STRPREFIX (lines[i], pattern)) { if (XSTRTOD64 (lines[i] + strlen (pattern), - NULL, 20, &ret, NULL) != LONGINT_OK) { + NULL, 10, &ret, NULL) != LONGINT_OK) { reply_with_error ("cannot parse minimum size"); return -1; } diff --git a/daemon/ntfs.c b/daemon/ntfs.c...
2015 Oct 27
1
[PATCHv3] Added btrfs support to vfs_minimum_size.
...s btrfs-progs >= 4.2"); + + r = command (&out, &err, str_btrfs, "inspect-internal", + "min-dev-size", sysroot_path (path), NULL); + + if (r == -1) { + reply_with_error ("%s", err); + return -1; + } + +#if __WORDSIZE == 64 +#define XSTRTOD64 xstrtol +#else +#define XSTRTOD64 xstrtoll +#endif + + if (XSTRTOD64 (out, NULL, 10, &ret, NULL) != LONGINT_OK) { + reply_with_error ("cannot parse minimum size"); + return -1; + } + +#undef XSTRTOD64 + + return ret; +} diff --git a/daemon/daemon.h b/daemon/daemon.h index 8bc...
2015 Oct 20
4
[PATCHv3 0/2] Introduce vfs_min_size API to get minimum filesystem size.
Tried to make it in accordance with your comments. Difference to v1: Added reply_with_error where necessary. Changed name get_min_size -> vfs_min_size. Difference to v2: Changed name to vfs_minimum_size. Changed parsing to xstrtol + STR* macros where possible. Maxim Perevedentsev (2): New API: vfs_min_size Include resize2fs_P into vfs_min_size. daemon/Makefile.am | 1 +
2015 Oct 22
2
[PATCH] Added btrfs support for vfs_min_size.
...needs btrfs-progs >= 4.2"); + + int r = command (&out, &err, str_btrfs, "inspect-internal", + "min-dev-size", path, NULL); + + if (r == -1) { + reply_with_error ("%s", err); + return -1; + } + +#if __WORDSIZE == 64 +#define XSTRTOD64 xstrtol +#else +#define XSTRTOD64 xstrtoll +#endif + + if (XSTRTOD64 (out, NULL, 10, &ret, NULL) != LONGINT_OK) { + reply_with_error ("cannot parse minimum size"); + return -1; + } + +#undef XSTRTOD64 + + return ret; +} + diff --git a/daemon/daemon.h b/daemon/daemon.h index 8...
2015 Oct 20
8
[PATCHv4 0/2] Introduce vfs_minimum_size API to get minimum filesystem size.
Tried to make it in accordance with your comments. Difference to v1: Added reply_with_error where necessary. Changed name get_min_size -> vfs_min_size. Difference to v2: Changed name to vfs_minimum_size. Changed parsing to xstrtol + STR* macros where possible. Difference to v3: Decapitalize error messages. Maxim Perevedentsev (2): New API: vfs_minimum_size Include resize2fs_P into
2015 Oct 20
0
[PATCHv3 1/2] New API: vfs_min_size
...uot;-ff", device, NULL); + + lines = split_lines (out); + if (lines == NULL) + return -1; + + if (verbose) { + for (i = 0; lines[i] != NULL; ++i) + fprintf (stderr, "ntfs_minimum_size: lines[%zu] = \"%s\"\n", i, lines[i]); + } + +#if __WORDSIZE == 64 +#define XSTRTOD64 xstrtol +#else +#define XSTRTOD64 xstrtoll +#endif + + if (r == -1) { + /* If volume is full, ntfsresize returns error. */ + for (i = 0; lines[i] != NULL; ++i) { + if (strstr (lines[i], full_pattern)) + is_full = 1; + else if (STRPREFIX (lines[i], cluster_size_pattern)) { +...
2015 Oct 20
0
[PATCHv4 1/2] New API: vfs_minimum_size
...uot;-ff", device, NULL); + + lines = split_lines (out); + if (lines == NULL) + return -1; + + if (verbose) { + for (i = 0; lines[i] != NULL; ++i) + fprintf (stderr, "ntfs_minimum_size: lines[%zu] = \"%s\"\n", i, lines[i]); + } + +#if __WORDSIZE == 64 +#define XSTRTOD64 xstrtol +#else +#define XSTRTOD64 xstrtoll +#endif + + if (r == -1) { + /* If volume is full, ntfsresize returns error. */ + for (i = 0; lines[i] != NULL; ++i) { + if (strstr (lines[i], full_pattern)) + is_full = 1; + else if (STRPREFIX (lines[i], cluster_size_pattern)) { +...
2015 Oct 20
0
[PATCHv3 2/2] Include resize2fs_P into vfs_min_size.
...;, device, NULL); @@ -300,17 +327,36 @@ do_resize2fs_P (const char *device) if (lines == NULL) return -1; - for (i = 0; lines[i] != NULL; ++i) { - if (verbose) - fprintf (stderr, "resize2fs_P: lines[%zu] = \"%s\"\n", i, lines[i]); +#if __WORDSIZE == 64 +#define XSTRTOD64 xstrtol +#else +#define XSTRTOD64 xstrtoll +#endif - if ((p = strstr (lines[i], pattern))) { - if (sscanf (p + strlen(pattern), "%" SCNd64, &ret) != 1) + for (i = 0; lines[i] != NULL; ++i) { + if (STRPREFIX (lines[i], pattern)) { + if (XSTRTOD64 (lines[i] + strlen (p...
2015 Oct 23
0
Re: [PATCH] Added btrfs support for vfs_min_size.
...command (&out, &err, str_btrfs, "inspect-internal", > + "min-dev-size", path, NULL); Same here. > + if (r == -1) { > + reply_with_error ("%s", err); > + return -1; > + } > + > +#if __WORDSIZE == 64 > +#define XSTRTOD64 xstrtol > +#else > +#define XSTRTOD64 xstrtoll > +#endif > + > + if (XSTRTOD64 (out, NULL, 10, &ret, NULL) != LONGINT_OK) { > + reply_with_error ("cannot parse minimum size"); > + return -1; > + } > + > +#undef XSTRTOD64 > + > + return ret;...
2015 Oct 23
1
[PATCHv2] Added btrfs support for vfs_min_size.
...s btrfs-progs >= 4.2"); + + r = command (&out, &err, str_btrfs, "inspect-internal", + "min-dev-size", sysroot_path (path), NULL); + + if (r == -1) { + reply_with_error ("%s", err); + return -1; + } + +#if __WORDSIZE == 64 +#define XSTRTOD64 xstrtol +#else +#define XSTRTOD64 xstrtoll +#endif + + if (XSTRTOD64 (out, NULL, 10, &ret, NULL) != LONGINT_OK) { + reply_with_error ("cannot parse minimum size"); + return -1; + } + +#undef XSTRTOD64 + + return ret; +} + diff --git a/daemon/daemon.h b/daemon/daemon.h index 8...