summaryrefslogtreecommitdiff
path: root/usr.bin/sendbug/sendbug.c
diff options
context:
space:
mode:
authorRay Lai <ray@cvs.openbsd.org>2007-04-06 20:29:19 +0000
committerRay Lai <ray@cvs.openbsd.org>2007-04-06 20:29:19 +0000
commitf07b850734efce9374373f2bd90b3c750d5c2428 (patch)
treed121d1c407ba8db9f1c6a8480371998661dd53e4 /usr.bin/sendbug/sendbug.c
parent47c50248c1d6305fed37f4b7429b498f2e445611 (diff)
Don't shadow variables. Enable -Wshadow.
Diffstat (limited to 'usr.bin/sendbug/sendbug.c')
-rw-r--r--usr.bin/sendbug/sendbug.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/usr.bin/sendbug/sendbug.c b/usr.bin/sendbug/sendbug.c
index 6a1a555ba2c..151147b8e99 100644
--- a/usr.bin/sendbug/sendbug.c
+++ b/usr.bin/sendbug/sendbug.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sendbug.c,v 1.37 2007/04/06 07:24:53 ray Exp $ */
+/* $OpenBSD: sendbug.c,v 1.38 2007/04/06 20:29:18 ray Exp $ */
/*
* Written by Ray Lai <ray@cyth.net>.
@@ -217,7 +217,7 @@ dmesg(FILE *fp)
}
int
-editit(char *tmpfile)
+editit(char *pathname)
{
char *argp[] = {"sh", "-c", NULL, NULL}, *ed, *p;
sig_t sighup, sigint, sigquit;
@@ -229,7 +229,7 @@ editit(char *tmpfile)
ed = getenv("EDITOR");
if (ed == NULL || ed[0] == '\0')
ed = _PATH_VI;
- if (asprintf(&p, "%s %s", ed, tmpfile) == -1)
+ if (asprintf(&p, "%s %s", ed, pathname) == -1)
return (-1);
argp[2] = p;
@@ -294,38 +294,38 @@ prompt(void)
}
int
-sendmail(const char *tmppath)
+sendmail(const char *pathname)
{
int filedes[2];
if (pipe(filedes) == -1) {
- warn("pipe: unsent report in %s", tmppath);
+ warn("pipe: unsent report in %s", pathname);
return (-1);
}
switch (fork()) {
case -1:
warn("fork error: unsent report in %s",
- tmppath);
+ pathname);
return (-1);
case 0:
close(filedes[1]);
if (dup2(filedes[0], STDIN_FILENO) == -1) {
warn("dup2 error: unsent report in %s",
- tmppath);
+ pathname);
return (-1);
}
close(filedes[0]);
execl("/usr/sbin/sendmail", "sendmail",
"-oi", "-t", (void *)NULL);
warn("sendmail error: unsent report in %s",
- tmppath);
+ pathname);
return (-1);
default:
close(filedes[0]);
/* Pipe into sendmail. */
- if (send_file(tmppath, filedes[1]) == -1) {
+ if (send_file(pathname, filedes[1]) == -1) {
warn("send_file error: unsent report in %s",
- tmppath);
+ pathname);
return (-1);
}
close(filedes[1]);