#endif /* if ENABLE_FEATURE_IFUPDOWN_IPV4 */
+/* Returns pointer to the next word, or NULL.
+ * In 1st case, advances *buf to the word after this one.
+ */
static char *next_word(char **buf)
{
unsigned length;
if (word[length] != '\0')
word[length++] = '\0';
- *buf = word + length;
+ *buf = skip_whitespace(word + length);
return word;
}
pid_t child;
int status;
- fflush(NULL);
+ fflush_all();
child = vfork();
switch (child) {
case -1: /* failure */
xpiped_pair(infd);
xpiped_pair(outfd);
- fflush(NULL);
+ fflush_all();
pid = vfork();
switch (pid) {
/* parent */
close(infd.rd);
close(outfd.wr);
- *in = fdopen(infd.wr, "w");
- *out = fdopen(outfd.rd, "r");
+ *in = xfdopen_for_write(infd.wr);
+ *out = xfdopen_for_read(outfd.rd);
return pid;
}