summaryrefslogtreecommitdiffstats
path: root/usr.bin/sendbug/sendbug.c
diff options
context:
space:
mode:
authorray <ray@openbsd.org>2007-04-07 04:58:50 +0000
committerray <ray@openbsd.org>2007-04-07 04:58:50 +0000
commit4c3857486b9da37aa49fb07a283b8cbfbbe1efef (patch)
tree3dfe98a955edfd7d0a2ecb46516ce6f91a341840 /usr.bin/sendbug/sendbug.c
parentUse __progname and warn instead of fprintf where appropriate. (diff)
downloadwireguard-openbsd-4c3857486b9da37aa49fb07a283b8cbfbbe1efef.tar.xz
wireguard-openbsd-4c3857486b9da37aa49fb07a283b8cbfbbe1efef.zip
Sprinkle const poison, remove unneeded variable.
Diffstat (limited to 'usr.bin/sendbug/sendbug.c')
-rw-r--r--usr.bin/sendbug/sendbug.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/usr.bin/sendbug/sendbug.c b/usr.bin/sendbug/sendbug.c
index c849059a565..7cd321aca11 100644
--- a/usr.bin/sendbug/sendbug.c
+++ b/usr.bin/sendbug/sendbug.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sendbug.c,v 1.41 2007/04/07 00:40:43 ray Exp $ */
+/* $OpenBSD: sendbug.c,v 1.42 2007/04/07 04:58:50 ray Exp $ */
/*
* Written by Ray Lai <ray@cyth.net>.
@@ -31,7 +31,7 @@
int checkfile(const char *);
void dmesg(FILE *);
-int editit(char *);
+int editit(const char *);
void init(void);
int matchline(const char *, const char *, size_t);
int prompt(void);
@@ -222,11 +222,11 @@ dmesg(FILE *fp)
}
int
-editit(char *pathname)
+editit(const char *pathname)
{
char *argp[] = {"sh", "-c", NULL, NULL}, *ed, *p;
sig_t sighup, sigint, sigquit;
- pid_t pid, xpid;
+ pid_t pid;
int st;
ed = getenv("VISUAL");
@@ -262,8 +262,7 @@ editit(char *pathname)
}
free(p);
for (;;) {
- xpid = waitpid(pid, &st, WUNTRACED);
- if (xpid == -1) {
+ if (waitpid(pid, &st, WUNTRACED) == -1) {
if (errno != EINTR)
return (-1);
} else if (WIFSTOPPED(st))