summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2009-03-30 00:39:27 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2009-03-30 00:39:27 +0000
commit25ea10ee960af7af620c11c11ea49e6451caf367 (patch)
treeff19412ca099870cdc9813315feb001dfffd28bc
parent7ca33071ba8e4bba4f0bac977608489fdc538b42 (diff)
lint; mostly unused variables, carefully checked against all platforms
-rw-r--r--sbin/disklabel/disklabel.c10
-rw-r--r--sbin/disklabel/editor.c12
2 files changed, 12 insertions, 10 deletions
diff --git a/sbin/disklabel/disklabel.c b/sbin/disklabel/disklabel.c
index 165291e79d2..68ed5ad275b 100644
--- a/sbin/disklabel/disklabel.c
+++ b/sbin/disklabel/disklabel.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disklabel.c,v 1.144 2009/03/29 19:58:27 weingart Exp $ */
+/* $OpenBSD: disklabel.c,v 1.145 2009/03/30 00:39:26 deraadt Exp $ */
/*
* Copyright (c) 1987, 1993
@@ -39,7 +39,7 @@ static const char copyright[] =
#endif /* not lint */
#ifndef lint
-static const char rcsid[] = "$OpenBSD: disklabel.c,v 1.144 2009/03/29 19:58:27 weingart Exp $";
+static const char rcsid[] = "$OpenBSD: disklabel.c,v 1.145 2009/03/30 00:39:26 deraadt Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -84,11 +84,11 @@ static const char rcsid[] = "$OpenBSD: disklabel.c,v 1.144 2009/03/29 19:58:27 w
char *dkname, *specname;
char tmpfil[] = _PATH_TMPFILE;
-char namebuf[BBSIZE], *np = namebuf;
struct disklabel lab;
char bootarea[BBSIZE];
#if NUMBOOT > 0
+char namebuf[BBSIZE], *np = namebuf;
int installboot; /* non-zero if we should install a boot program */
char *bootbuf; /* pointer to buffer with remainder of boot prog */
int bootsize; /* size of remaining boot program */
@@ -386,8 +386,10 @@ makelabel(char *type, char *name, struct disklabel *lp)
int
writelabel(int f, char *boot, struct disklabel *lp)
{
+#if NUMBOOT > 0
int writeable;
off_t sectoffset = 0;
+#endif
#if NUMBOOT > 0
setbootflag(lp);
@@ -610,7 +612,7 @@ struct dos_partition *
readmbr(int f)
{
struct dos_partition *dp, *first = NULL;
- int part, n = 8;
+ int n = 8;
dp = findopenbsd(f, DOSBBSECTOR, &first, &n);
if (dp != NULL)
diff --git a/sbin/disklabel/editor.c b/sbin/disklabel/editor.c
index baf72f5337b..d954651aa37 100644
--- a/sbin/disklabel/editor.c
+++ b/sbin/disklabel/editor.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: editor.c,v 1.182 2009/03/29 05:37:13 deraadt Exp $ */
+/* $OpenBSD: editor.c,v 1.183 2009/03/30 00:39:26 deraadt Exp $ */
/*
* Copyright (c) 1997-2000 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -17,7 +17,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: editor.c,v 1.182 2009/03/29 05:37:13 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: editor.c,v 1.183 2009/03/30 00:39:26 deraadt Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -293,21 +293,21 @@ editor(struct disklabel *lp, int f, char *dev, char *fstabfile, int aflag)
case 'M': {
sig_t opipe = signal(SIGPIPE, SIG_IGN);
- char *pager, *cmd = NULL;
+ char *pager, *comm = NULL;
extern const u_char manpage[];
extern const int manpage_sz;
if ((pager = getenv("PAGER")) == NULL || *pager == '\0')
pager = _PATH_LESS;
- if (asprintf(&cmd, "gunzip -qc|%s", pager) != -1 &&
- (fp = popen(cmd, "w")) != NULL) {
+ if (asprintf(&comm, "gunzip -qc|%s", pager) != -1 &&
+ (fp = popen(comm, "w")) != NULL) {
(void) fwrite(manpage, manpage_sz, 1, fp);
pclose(fp);
} else
warn("unable to execute %s", pager);
- free(cmd);
+ free(comm);
(void)signal(SIGPIPE, opipe);
break;
}