Displaying 2 results from an estimated 2 matches for "stdio_dump_plugin".
2020 Apr 14
0
[nbdkit PATCH v2 3/3] server: More tests of stdin/out handling
...;st2) == -1)
+ assert (false);
+ if (st1.st_dev != st2.st_dev || st1.st_ino != st2.st_ino)
+ return false;
+
+ if (fstat (STDOUT_FILENO, &st2) == -1)
+ assert (false);
+ if (st1.st_dev != st2.st_dev || st1.st_ino != st2.st_ino)
+ return false;
+
+ return true;
+}
+
+static void
+stdio_dump_plugin (void)
+{
+ char *buf = NULL;
+ size_t len = 0;
+ bool check = stdio_check ();
+
+ assert (check == false);
+
+ /* Reading from stdin during .dump_plugin is unusual, but not forbidden */
+ if (getline (&buf, &len, stdin) == -1)
+ assert (false);
+ /* The point of .dump_plugin is t...
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 |