search for: handle_script_error

Displaying 14 results from an estimated 14 matches for "handle_script_error".

2023 Aug 30
2
[nbdkit PATCH] sh: Allow pwrite to not consume all data
...ot;%s: write: %m", argv0); @@ -555,7 +550,7 @@ call (const char **argv) CLEANUP_FREE_STRING string rbuf = empty_vector; CLEANUP_FREE_STRING string ebuf = empty_vector; - r = call3 (NULL, 0, &rbuf, &ebuf, argv); + r = call3 (NULL, 0, NULL, &rbuf, &ebuf, argv); return handle_script_error (argv[0], &ebuf, r); } @@ -568,7 +563,7 @@ call_read (string *rbuf, const char **argv) int r; CLEANUP_FREE_STRING string ebuf = empty_vector; - r = call3 (NULL, 0, rbuf, &ebuf, argv); + r = call3 (NULL, 0, NULL, rbuf, &ebuf, argv); r = handle_script_error (argv[0], &eb...
2023 Aug 31
1
[nbdkit PATCH] sh: Allow pwrite to not consume all data
...; @@ -555,7 +550,7 @@ call (const char **argv) > CLEANUP_FREE_STRING string rbuf = empty_vector; > CLEANUP_FREE_STRING string ebuf = empty_vector; > > - r = call3 (NULL, 0, &rbuf, &ebuf, argv); > + r = call3 (NULL, 0, NULL, &rbuf, &ebuf, argv); > return handle_script_error (argv[0], &ebuf, r); > } > > @@ -568,7 +563,7 @@ call_read (string *rbuf, const char **argv) > int r; > CLEANUP_FREE_STRING string ebuf = empty_vector; > > - r = call3 (NULL, 0, rbuf, &ebuf, argv); > + r = call3 (NULL, 0, NULL, rbuf, &ebuf, argv); >...
2023 Aug 31
1
[nbdkit PATCH] sh: Allow pwrite to not consume all data
...; @@ -555,7 +550,7 @@ call (const char **argv) > CLEANUP_FREE_STRING string rbuf = empty_vector; > CLEANUP_FREE_STRING string ebuf = empty_vector; > > - r = call3 (NULL, 0, &rbuf, &ebuf, argv); > + r = call3 (NULL, 0, NULL, &rbuf, &ebuf, argv); > return handle_script_error (argv[0], &ebuf, r); > } > > @@ -568,7 +563,7 @@ call_read (string *rbuf, const char **argv) > int r; > CLEANUP_FREE_STRING string ebuf = empty_vector; > > - r = call3 (NULL, 0, rbuf, &ebuf, argv); > + r = call3 (NULL, 0, NULL, rbuf, &ebuf, argv); >...
2019 Jul 02
1
[nbdkit PATCH] sh: Parse a larger number of error messages
...b/plugins/sh/call.c index f69523c1..585bd32c 100644 --- a/plugins/sh/call.c +++ b/plugins/sh/call.c @@ -42,6 +42,7 @@ #include <poll.h> #include <sys/types.h> #include <sys/wait.h> +#include <ctype.h> #include <nbdkit-plugin.h> @@ -267,32 +268,36 @@ static void handle_script_error (char *ebuf, size_t len) { int err; - size_t skip; + size_t skip = 0; char *p; - if (strcmp (ebuf, "EPERM ") == 0) { + if (strncasecmp (ebuf, "EPERM", 5) == 0) { err = EPERM; - skip = 6; + skip = 5; } - else if (strcmp (ebuf, "EIO ") == 0) {...
2023 Aug 31
1
[nbdkit PATCH] sh: Allow pwrite to not consume all data
...nst char **argv) > > CLEANUP_FREE_STRING string rbuf = empty_vector; > > CLEANUP_FREE_STRING string ebuf = empty_vector; > > > > - r = call3 (NULL, 0, &rbuf, &ebuf, argv); > > + r = call3 (NULL, 0, NULL, &rbuf, &ebuf, argv); > > return handle_script_error (argv[0], &ebuf, r); > > } > > > > @@ -568,7 +563,7 @@ call_read (string *rbuf, const char **argv) > > int r; > > CLEANUP_FREE_STRING string ebuf = empty_vector; > > > > - r = call3 (NULL, 0, rbuf, &ebuf, argv); > > + r = call3 (NUL...
2023 Aug 31
2
[nbdkit PATCH] sh: Allow pwrite to not consume all data
...all (const char **argv) >> CLEANUP_FREE_STRING string rbuf = empty_vector; >> CLEANUP_FREE_STRING string ebuf = empty_vector; >> >> - r = call3 (NULL, 0, &rbuf, &ebuf, argv); >> + r = call3 (NULL, 0, NULL, &rbuf, &ebuf, argv); >> return handle_script_error (argv[0], &ebuf, r); >> } >> >> @@ -568,7 +563,7 @@ call_read (string *rbuf, const char **argv) >> int r; >> CLEANUP_FREE_STRING string ebuf = empty_vector; >> >> - r = call3 (NULL, 0, rbuf, &ebuf, argv); >> + r = call3 (NULL, 0, NULL...
2023 Aug 31
2
[nbdkit PATCH] sh: Allow pwrite to not consume all data
...gt;> CLEANUP_FREE_STRING string rbuf = empty_vector; > >> CLEANUP_FREE_STRING string ebuf = empty_vector; > >> > >> - r = call3 (NULL, 0, &rbuf, &ebuf, argv); > >> + r = call3 (NULL, 0, NULL, &rbuf, &ebuf, argv); > >> return handle_script_error (argv[0], &ebuf, r); > >> } > >> > >> @@ -568,7 +563,7 @@ call_read (string *rbuf, const char **argv) > >> int r; > >> CLEANUP_FREE_STRING string ebuf = empty_vector; > >> > >> - r = call3 (NULL, 0, rbuf, &ebuf, argv); &...
2023 Aug 31
1
[nbdkit PATCH] sh: Allow pwrite to not consume all data
...>>> CLEANUP_FREE_STRING string rbuf = empty_vector; >>> CLEANUP_FREE_STRING string ebuf = empty_vector; >>> >>> - r = call3 (NULL, 0, &rbuf, &ebuf, argv); >>> + r = call3 (NULL, 0, NULL, &rbuf, &ebuf, argv); >>> return handle_script_error (argv[0], &ebuf, r); >>> } >>> >>> @@ -568,7 +563,7 @@ call_read (string *rbuf, const char **argv) >>> int r; >>> CLEANUP_FREE_STRING string ebuf = empty_vector; >>> >>> - r = call3 (NULL, 0, rbuf, &ebuf, argv); >>...
2020 May 19
1
[PATCH nbdkit] sh: Don't need to cast parameter of ascii_is* to (unsigned char).
...Eric Blake Fixes: commit 9f34db74786fdc92b290a7d47e4b003bd84fec69. --- plugins/sh/call.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/sh/call.c b/plugins/sh/call.c index b2d4a794..741022b6 100644 --- a/plugins/sh/call.c +++ b/plugins/sh/call.c @@ -443,7 +443,7 @@ handle_script_error (const char *argv0, char *ebuf, size_t len) } if (skip && ebuf[skip]) { - if (!ascii_isspace ((unsigned char) ebuf[skip])) { + if (!ascii_isspace (ebuf[skip])) { /* Treat 'EINVALID' as EIO, not EINVAL */ err = EIO; skip = 0; @@ -451,7 +451,7 @@ han...
2023 Aug 31
0
[nbdkit PATCH] sh: Allow pwrite to not consume all data
...uf = empty_vector; > >>>> CLEANUP_FREE_STRING string ebuf = empty_vector; > >>>> > >>>> - r = call3 (NULL, 0, &rbuf, &ebuf, argv); > >>>> + r = call3 (NULL, 0, NULL, &rbuf, &ebuf, argv); > >>>> return handle_script_error (argv[0], &ebuf, r); > >>>> } > >>>> > >>>> @@ -568,7 +563,7 @@ call_read (string *rbuf, const char **argv) > >>>> int r; > >>>> CLEANUP_FREE_STRING string ebuf = empty_vector; > >>>> > >>&...
2023 Aug 31
1
[nbdkit PATCH] sh: Allow pwrite to not consume all data
...REE_STRING string rbuf = empty_vector; > >>> CLEANUP_FREE_STRING string ebuf = empty_vector; > >>> > >>> - r = call3 (NULL, 0, &rbuf, &ebuf, argv); > >>> + r = call3 (NULL, 0, NULL, &rbuf, &ebuf, argv); > >>> return handle_script_error (argv[0], &ebuf, r); > >>> } > >>> > >>> @@ -568,7 +563,7 @@ call_read (string *rbuf, const char **argv) > >>> int r; > >>> CLEANUP_FREE_STRING string ebuf = empty_vector; > >>> > >>> - r = call3 (NULL,...
2020 May 19
1
[PATCH nbdkit] common/include: Add locale-safe ascii_strcasecmp and ascii_strncasecmp.
...call.c index 741022b6..aa0fe8a0 100644 --- a/plugins/sh/call.c +++ b/plugins/sh/call.c @@ -48,6 +48,7 @@ #include <nbdkit-plugin.h> #include "ascii-ctype.h" +#include "ascii-string.h" #include "cleanup.h" #include "utils.h" @@ -383,48 +384,48 @@ handle_script_error (const char *argv0, char *ebuf, size_t len) } /* Recognize the errno values that match NBD protocol errors */ - if (strncasecmp (ebuf, "EPERM", 5) == 0) { + if (ascii_strncasecmp (ebuf, "EPERM", 5) == 0) { err = EPERM; skip = 5; } - else if (strncasecmp (...
2019 Aug 23
1
[nbdkit PATCH 1/3] server: Add internal support for NBDKIT_FLAG_FAST_ZERO
...support */ case 8: err = EOPNOTSUPP; break; /* Other errno values that server/protocol.c treats specially */ case 9: err = EROFS; break; diff --git a/plugins/sh/call.c b/plugins/sh/call.c index b86e7c9c..ab43e5ea 100644 --- a/plugins/sh/call.c +++ b/plugins/sh/call.c @@ -347,7 +347,6 @@ handle_script_error (char *ebuf, size_t len) err = ESHUTDOWN; skip = 9; } - /* Necessary for .zero support */ else if (strncasecmp (ebuf, "ENOTSUP", 7) == 0) { err = ENOTSUP; skip = 7; -- 2.21.0
2019 Aug 23
22
cross-project patches: Add NBD Fast Zero support
This is a cover letter to a series of patches being proposed in tandem to four different projects: - nbd: Document a new NBD_CMD_FLAG_FAST_ZERO command flag - qemu: Implement the flag for both clients and server - libnbd: Implement the flag for clients - nbdkit: Implement the flag for servers, including the nbd passthrough client If you want to test the patches together, I've pushed a