search for: stdio_get_ready

Displaying 3 results from an estimated 3 matches for "stdio_get_ready".

2020 Aug 05
2
[PATCH nbdkit 1/2] server: Call .get_ready before redirecting stdin/stdout to /dev/null.
...configured = true; - top->get_ready (top); start_serving (); diff --git a/tests/test-stdio-plugin.c b/tests/test-stdio-plugin.c index 618eae83..86447278 100644 --- a/tests/test-stdio-plugin.c +++ b/tests/test-stdio-plugin.c @@ -122,6 +122,14 @@ stdio_config_complete (void) static int stdio_get_ready (void) +{ + bool check = stdio_check (); + assert (check == false); + return 0; +} + +static int +stdio_after_fork (void) { bool check = stdio_check (); assert (check == true); @@ -163,6 +171,7 @@ static struct nbdkit_plugin plugin = { .config = stdio_config, .config_comp...
2020 Apr 14
0
[nbdkit PATCH v2 3/3] server: More tests of stdin/out handling
...din during .config_complete is safe except under -s */ + if (getline (&buf, &len, stdin) == -1) + assert (false); + /* Output during .config_complete is unusual, but not forbidden */ + printf ("%s=%s\n", msg, buf); + free (buf); + } + return 0; +} + +static int +stdio_get_ready (void) +{ + bool check = stdio_check (); + assert (check == true); + return 0; +} + +static void * +stdio_open (int readonly) +{ + bool check = stdio_check (); + assert (check == true); + return NBDKIT_HANDLE_NOT_NEEDED; +} + +static int64_t +stdio_get_size (void *handle) +{ + bool check = s...
2020 Apr 14
6
[nbdkit PATCH v2 0/3] more consistent stdin/out handling
In v2: - use int instead of bool in the public header - split the tests from the code - don't overload test-layers; instead, add new tests - add a missing fflush exposed by the new tests - other minor cleanups Eric Blake (3): server: Add nbdkit_stdio_safe server: Sanitize stdin/out before running plugin code server: More tests of stdin/out handling docs/nbdkit-plugin.pod |