summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sfeed_curses.13
-rw-r--r--sfeed_curses.c13
2 files changed, 9 insertions, 7 deletions
diff --git a/sfeed_curses.1 b/sfeed_curses.1
index 30d6543..be68d92 100644
--- a/sfeed_curses.1
+++ b/sfeed_curses.1
@@ -1,4 +1,4 @@
-.Dd May 4, 2022
+.Dd May 5, 2022
.Dt SFEED_CURSES 1
.Os
.Sh NAME
@@ -290,6 +290,7 @@ In non-interactive mode
.Nm
doesn't wait until the process exits.
Stdout and stderr of the program are not written as output.
+When plumbing an URL then stdin is closed also.
.Sh EXIT STATUS
.Ex -std
The exit status is 130 on SIGINT and 143 on SIGTERM.
diff --git a/sfeed_curses.c b/sfeed_curses.c
index d09f8a0..78071b7 100644
--- a/sfeed_curses.c
+++ b/sfeed_curses.c
@@ -604,8 +604,8 @@ pipeitem(const char *cmd, struct item *item, int field, int interactive)
die("fork");
case 0:
if (!interactive) {
- dup2(devnullfd, 1);
- dup2(devnullfd, 2);
+ dup2(devnullfd, 1); /* stdout */
+ dup2(devnullfd, 2); /* stderr */
}
errno = 0;
@@ -642,8 +642,9 @@ forkexec(char *argv[], int interactive)
die("fork");
case 0:
if (!interactive) {
- dup2(devnullfd, 1);
- dup2(devnullfd, 2);
+ dup2(devnullfd, 0); /* stdin */
+ dup2(devnullfd, 1); /* stdout */
+ dup2(devnullfd, 2); /* stderr */
}
if (execvp(argv[0], argv) == -1)
_exit(1);
@@ -1847,8 +1848,8 @@ markread(struct pane *p, off_t from, off_t to, int isread)
case -1:
die("fork");
case 0:
- dup2(devnullfd, 1);
- dup2(devnullfd, 2);
+ dup2(devnullfd, 1); /* stdout */
+ dup2(devnullfd, 2); /* stderr */
errno = 0;
if (!(fp = popen(cmd, "w")))