pid = run_piped(cmd, argv, i, o, e);
if (stdinf) {
- *stdinf = fdopen(ifd, "r");
+ *stdinf = fdopen(ifd, "w");
if (*stdinf == NULL) {
pr_err("Error opening file stream for fd %d: %m\n",
ifd);
}
if (stdoutf) {
- *stdoutf = fdopen(ofd, "w");
+ *stdoutf = fdopen(ofd, "r");
if (*stdoutf == NULL) {
pr_err("Error opening file stream for fd %d: %m\n",
ofd);