summaryrefslogtreecommitdiff
path: root/misc/logsave.c
diff options
context:
space:
mode:
Diffstat (limited to 'misc/logsave.c')
-rw-r--r--misc/logsave.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/misc/logsave.c b/misc/logsave.c
index c37473cb..f6cc42a4 100644
--- a/misc/logsave.c
+++ b/misc/logsave.c
@@ -32,13 +32,13 @@ extern char *optarg;
extern int optind;
#endif
-int outfd = -1;
-int outbufsize = 0;
-void *outbuf = 0;
-int verbose = 0;
-int do_skip = 0;
-int skip_mode = 0;
-pid_t child_pid = -1;
+static int outfd = -1;
+static int outbufsize = 0;
+static void *outbuf = 0;
+static int verbose = 0;
+static int do_skip = 0;
+static int skip_mode = 0;
+static pid_t child_pid = -1;
static void usage(char *progname)
{
@@ -190,6 +190,7 @@ static int run_program(char **argv)
dup2(fds[1],1); /* fds[1] replaces stdout */
dup2(fds[1],2); /* fds[1] replaces stderr */
close(fds[0]); /* don't need this here */
+ close(fds[1]);
execvp(argv[0], argv);
perror(argv[0]);
@@ -209,7 +210,7 @@ static int run_program(char **argv)
rc = WEXITSTATUS(status);
if (rc) {
send_output(argv[0], 0, SEND_BOTH);
- sprintf(buffer, " died with exit status %d\n", rc);
+ sprintf(buffer, " exited with status code %d\n", rc);
send_output(buffer, 0, SEND_BOTH);
}
} else {