From: Sascha Wildner Date: Sat, 18 Dec 2004 21:43:46 +0000 (+0000) Subject: Clean (void) casts from sbin X-Git-Tag: v2.0.1~9474 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/7cee7052fb9889cb1b48cccf789495c37c670294 Clean (void) casts from sbin --- diff --git a/sbin/adjkerntz/adjkerntz.c b/sbin/adjkerntz/adjkerntz.c index 3d07f411ce..29e5800820 100644 --- a/sbin/adjkerntz/adjkerntz.c +++ b/sbin/adjkerntz/adjkerntz.c @@ -25,7 +25,7 @@ * * @(#)Copyright (C) 1993-1996 by Andrey A. Chernov, Moscow, Russia. All rights reserved. * $FreeBSD: src/sbin/adjkerntz/adjkerntz.c,v 1.25.2.1 2001/07/30 10:38:04 dd Exp $ - * $DragonFly: src/sbin/adjkerntz/adjkerntz.c,v 1.4 2003/11/01 17:15:57 drhodus Exp $ + * $DragonFly: src/sbin/adjkerntz/adjkerntz.c,v 1.5 2004/12/18 21:43:38 swildner Exp $ */ /* @@ -118,7 +118,7 @@ int main(int argc, char **argv) openlog("adjkerntz", LOG_PID|LOG_PERROR, LOG_DAEMON); - (void) signal(SIGHUP, SIG_IGN); + signal(SIGHUP, SIG_IGN); if (init && daemon(0, 1)) { syslog(LOG_ERR, "daemon: %m"); @@ -126,8 +126,8 @@ int main(int argc, char **argv) } again: - (void) sigprocmask(SIG_BLOCK, &mask, NULL); - (void) signal(SIGTERM, fake); + sigprocmask(SIG_BLOCK, &mask, NULL); + signal(SIGTERM, fake); diff = 0; stv = NULL; @@ -185,9 +185,9 @@ recalculate: "Warning: nonexistent local time."); syslog(LOG_WARNING, "Will retry after %d minutes.", REPORT_PERIOD / 60); - (void) signal(SIGTERM, SIG_DFL); - (void) sigprocmask(SIG_UNBLOCK, &mask, NULL); - (void) sleep(REPORT_PERIOD); + signal(SIGTERM, SIG_DFL); + sigprocmask(SIG_UNBLOCK, &mask, NULL); + sleep(REPORT_PERIOD); goto again; } offset = -local.tm_gmtoff; @@ -237,9 +237,9 @@ recalculate: "Warning: nonexistent final local time."); syslog(LOG_WARNING, "Will retry after %d minutes.", REPORT_PERIOD / 60); - (void) signal(SIGTERM, SIG_DFL); - (void) sigprocmask(SIG_UNBLOCK, &mask, NULL); - (void) sleep(REPORT_PERIOD); + signal(SIGTERM, SIG_DFL); + sigprocmask(SIG_UNBLOCK, &mask, NULL); + sleep(REPORT_PERIOD); goto again; } offset = -local.tm_gmtoff; @@ -358,7 +358,7 @@ recalculate: if (init && wall_clock) { sleep_mode = False; /* wait for signals and acts like -a */ - (void) sigsuspend(&emask); + sigsuspend(&emask); goto again; } diff --git a/sbin/atm/atm/atm.c b/sbin/atm/atm/atm.c index 67143c39be..3ee65e7774 100644 --- a/sbin/atm/atm/atm.c +++ b/sbin/atm/atm/atm.c @@ -24,7 +24,7 @@ * notice must be reproduced on all copies. * * @(#) $FreeBSD: src/sbin/atm/atm/atm.c,v 1.3.2.1 2000/07/01 06:02:14 ps Exp $ - * @(#) $DragonFly: src/sbin/atm/atm/atm.c,v 1.3 2003/09/28 14:39:16 hmp Exp $ + * @(#) $DragonFly: src/sbin/atm/atm/atm.c,v 1.4 2004/12/18 21:43:38 swildner Exp $ */ /* @@ -432,7 +432,7 @@ attach(int argc, char **argv, struct cmd *cmdp) } exit(1); } - (void)close(s); + close(s); } @@ -497,7 +497,7 @@ detach(int argc, char **argv, struct cmd *cmdp) } exit(1); } - (void)close(s); + close(s); } @@ -679,7 +679,7 @@ pvc_add(int argc, char **argv, struct cmd *cmdp) } exit(1); } - (void)close(s); + close(s); } @@ -785,7 +785,7 @@ arp_add(int argc, char **argv, struct cmd *cmdp) } exit(1); } - (void)close(s); + close(s); } @@ -934,7 +934,7 @@ vcc_dlt(int argc, char **argv, struct cmd *cmdp, struct atmdelreq *apr) } exit(1); } - (void)close(s); + close(s); } @@ -1010,7 +1010,7 @@ arp_dlt(int argc, char **argv, struct cmd *cmdp) } exit(1); } - (void)close(s); + close(s); } diff --git a/sbin/atm/atm/atm_set.c b/sbin/atm/atm/atm_set.c index 830ee4f78f..c6f482f401 100644 --- a/sbin/atm/atm/atm_set.c +++ b/sbin/atm/atm/atm_set.c @@ -24,7 +24,7 @@ * notice must be reproduced on all copies. * * @(#) $FreeBSD: src/sbin/atm/atm/atm_set.c,v 1.3.2.1 2000/07/01 06:02:14 ps Exp $ - * @(#) $DragonFly: src/sbin/atm/atm/atm_set.c,v 1.3 2003/09/28 14:39:16 hmp Exp $ + * @(#) $DragonFly: src/sbin/atm/atm/atm_set.c,v 1.4 2004/12/18 21:43:38 swildner Exp $ */ /* @@ -248,7 +248,7 @@ set_arpserver(int argc, char **argv, struct cmd *cmdp) exit(1); } - (void)close(s); + close(s); } @@ -341,7 +341,7 @@ set_macaddr(int argc, char **argv, struct cmd *cmdp) exit(1); } - (void)close(s); + close(s); } @@ -426,7 +426,7 @@ set_netif(int argc, char **argv, struct cmd *cmdp) perror("ioctl (AIOCSET) set NIF"); exit(1); } - (void)close(s); + close(s); } @@ -519,5 +519,5 @@ set_prefix(int argc, char **argv, struct cmd *cmdp) exit(1); } - (void)close(s); + close(s); } diff --git a/sbin/atm/fore_dnld/fore_dnld.c b/sbin/atm/fore_dnld/fore_dnld.c index 3cf94cbcf7..9a0043eb85 100644 --- a/sbin/atm/fore_dnld/fore_dnld.c +++ b/sbin/atm/fore_dnld/fore_dnld.c @@ -24,7 +24,7 @@ * notice must be reproduced on all copies. * * @(#) $FreeBSD: src/sbin/atm/fore_dnld/fore_dnld.c,v 1.6.2.2 2000/12/11 01:03:24 obrien Exp $ - * @(#) $DragonFly: src/sbin/atm/fore_dnld/fore_dnld.c,v 1.5 2004/02/04 17:39:58 joerg Exp $ + * @(#) $DragonFly: src/sbin/atm/fore_dnld/fore_dnld.c,v 1.6 2004/12/18 21:43:38 swildner Exp $ */ /* @@ -1069,7 +1069,7 @@ main( int argc, char **argv ) perror ( "mmap ram" ); fprintf(stderr, "%s download failed\n", air->acp_intf); - (void) close(fd); + close(fd); continue; } Mon = (Mon960 *)(ram + MON960_BASE); @@ -1097,7 +1097,7 @@ main( int argc, char **argv ) default: fprintf(stderr, "%s unknown status\n", air->acp_intf); - (void) close(fd); + close(fd); continue; } break; @@ -1183,7 +1183,7 @@ main( int argc, char **argv ) fprintf ( stderr, "%s is up and running - no download allowed.\n", air->acp_intf ); - (void) close(fd); + close(fd); continue; } @@ -1192,7 +1192,7 @@ main( int argc, char **argv ) fprintf ( stderr, "%s is not ready for downloading.\n", air->acp_intf ); - (void) close(fd); + close(fd); continue; } @@ -1300,7 +1300,7 @@ main( int argc, char **argv ) if ( err ) { fprintf(stderr, "%s download failed\n", air->acp_intf); - (void) close(fd); + close(fd); continue; } diff --git a/sbin/atm/ilmid/ilmid.c b/sbin/atm/ilmid/ilmid.c index 68746ef082..ae78b582cd 100644 --- a/sbin/atm/ilmid/ilmid.c +++ b/sbin/atm/ilmid/ilmid.c @@ -24,7 +24,7 @@ * notice must be reproduced on all copies. * * @(#) $FreeBSD: src/sbin/atm/ilmid/ilmid.c,v 1.6.2.2 2001/03/04 07:15:30 kris Exp $ - * @(#) $DragonFly: src/sbin/atm/ilmid/ilmid.c,v 1.5 2003/11/03 19:51:04 eirikn Exp $ + * @(#) $DragonFly: src/sbin/atm/ilmid/ilmid.c,v 1.6 2004/12/18 21:43:38 swildner Exp $ */ /* @@ -960,7 +960,7 @@ asn_get_header ( bufp ) */ if ( h->pdutype != PDU_TYPE_TRAP ) { /* TRAP uses different format */ - (void) asn_get_pdu_len ( &bp, &dummy ); + asn_get_pdu_len ( &bp, &dummy ); /* Request ID */ if ( *bp++ != ASN_INTEGER ) { @@ -1119,7 +1119,7 @@ get_ticks() struct timeval timenow; struct timeval timediff; - (void) gettimeofday ( &timenow, NULL ); + gettimeofday ( &timenow, NULL ); /* * Adjust for subtraction */ @@ -1235,7 +1235,7 @@ build_pdu ( hdr, type ) /* Fill in ENTERPRISE OBJID */ *bp++ = ASN_OBJID; - (void) asn_put_objid ( &bp, &hdr->enterprise ); + asn_put_objid ( &bp, &hdr->enterprise ); /* Fill in IP address */ *bp++ = ASN_IPADDR; @@ -2488,7 +2488,7 @@ main ( argc, argv ) /* * Get our startup time */ - (void) gettimeofday ( &starttime, NULL ); + gettimeofday ( &starttime, NULL ); starttime.tv_sec--; starttime.tv_usec += 1000000; diff --git a/sbin/ccdconfig/ccdconfig.c b/sbin/ccdconfig/ccdconfig.c index e89c04f365..a77e64b313 100644 --- a/sbin/ccdconfig/ccdconfig.c +++ b/sbin/ccdconfig/ccdconfig.c @@ -32,7 +32,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sbin/ccdconfig/ccdconfig.c,v 1.16.2.2 2000/12/11 01:03:25 obrien Exp $ - * $DragonFly: src/sbin/ccdconfig/ccdconfig.c,v 1.4 2003/11/01 17:15:57 drhodus Exp $ + * $DragonFly: src/sbin/ccdconfig/ccdconfig.c,v 1.5 2004/12/18 21:43:38 swildner Exp $ */ #include @@ -370,7 +370,7 @@ do_all(int action) free(argv); } - (void)fclose(f); + fclose(f); return (rval); } @@ -433,9 +433,9 @@ resolve_ccdname(char *name) free(path); return (NULL); } - (void)sprintf(path, "%s%s%c", _PATH_DEV, name, 'a' + rawpart); + sprintf(path, "%s%s%c", _PATH_DEV, name, 'a' + rawpart); } else - (void)sprintf(path, "%s%s", _PATH_DEV, name); + sprintf(path, "%s%s", _PATH_DEV, name); return (path); } @@ -472,7 +472,7 @@ do_io(char *path, u_long cmd, struct ccd_ioctl *cciop) } #define KVM_ABORT(kd, str) { \ - (void)kvm_close((kd)); \ + kvm_close((kd)); \ warnx("%s", (str)); \ warnx("%s", kvm_geterr((kd))); \ return (1); \ @@ -564,11 +564,11 @@ dump_ccd(int argc, char **argv) free(cs); done: - (void)kvm_close(kd); + kvm_close(kd); return (0); bad: - (void)kvm_close(kd); + kvm_close(kd); return (1); } diff --git a/sbin/clri/clri.c b/sbin/clri/clri.c index fc4dfbf616..1bfedb599e 100644 --- a/sbin/clri/clri.c +++ b/sbin/clri/clri.c @@ -36,7 +36,7 @@ * @(#) Copyright (c) 1990, 1993 The Regents of the University of California. All rights reserved. * @(#)clri.c 8.2 (Berkeley) 9/23/93 * $FreeBSD: src/sbin/clri/clri.c,v 1.4 1999/08/28 00:12:32 peter Exp $ - * $DragonFly: src/sbin/clri/clri.c,v 1.4 2003/09/28 14:39:16 hmp Exp $ + * $DragonFly: src/sbin/clri/clri.c,v 1.5 2004/12/18 21:43:38 swildner Exp $ */ #include @@ -54,7 +54,7 @@ static void usage(void) { - (void)fprintf(stderr, "usage: clri filesystem inode ...\n"); + fprintf(stderr, "usage: clri filesystem inode ...\n"); exit(1); } @@ -94,7 +94,7 @@ main(int argc, char **argv) /* get the inode number. */ if ((inonum = atoi(*argv)) <= 0) errx(1, "%s is not a valid inode number", *argv); - (void)printf("clearing %d\n", inonum); + printf("clearing %d\n", inonum); /* read in the appropriate block. */ offset = ino_to_fsba(sbp, inonum); /* inode to fs blk */ @@ -120,8 +120,8 @@ main(int argc, char **argv) err(1, "%s", fs); if (write(fd, ibuf, bsize) != bsize) err(1, "%s", fs); - (void)fsync(fd); + fsync(fd); } - (void)close(fd); + close(fd); exit(0); } diff --git a/sbin/disklabel/disklabel.c b/sbin/disklabel/disklabel.c index 7a29d2bde0..8c60ba6813 100644 --- a/sbin/disklabel/disklabel.c +++ b/sbin/disklabel/disklabel.c @@ -37,7 +37,7 @@ * @(#)disklabel.c 1.2 (Symmetric) 11/28/85 * @(#)disklabel.c 8.2 (Berkeley) 1/7/94 * $FreeBSD: src/sbin/disklabel/disklabel.c,v 1.28.2.15 2003/01/24 16:18:16 des Exp $ - * $DragonFly: src/sbin/disklabel/disklabel.c,v 1.6 2004/08/30 19:27:21 eirikn Exp $ + * $DragonFly: src/sbin/disklabel/disklabel.c,v 1.7 2004/12/18 21:43:38 swildner Exp $ */ #include @@ -235,14 +235,14 @@ main(int argc, char *argv[]) dkname = argv[0]; if (dkname[0] != '/') { - (void)sprintf(np, "%s%s%c", _PATH_DEV, dkname, 'a' + RAW_PART); + sprintf(np, "%s%s%c", _PATH_DEV, dkname, 'a' + RAW_PART); specname = np; np += strlen(specname) + 1; } else specname = dkname; f = open(specname, op == READ ? O_RDONLY : O_RDWR); if (f < 0 && errno == ENOENT && dkname[0] != '/') { - (void)sprintf(specname, "%s%s", _PATH_DEV, dkname); + sprintf(specname, "%s%s", _PATH_DEV, dkname); np = namebuf + strlen(specname) + 1; f = open(specname, op == READ ? O_RDONLY : O_RDWR); } @@ -370,19 +370,17 @@ makelabel(const char *type, const char *name, struct disklabel *lp) */ if (!xxboot && lp->d_boot0) { if (*lp->d_boot0 != '/') - (void)sprintf(boot0, "%s/%s", - _PATH_BOOTDIR, lp->d_boot0); + sprintf(boot0, "%s/%s", _PATH_BOOTDIR, lp->d_boot0); else - (void)strcpy(boot0, lp->d_boot0); + strcpy(boot0, lp->d_boot0); xxboot = boot0; } #if NUMBOOT > 1 if (!bootxx && lp->d_boot1) { if (*lp->d_boot1 != '/') - (void)sprintf(boot1, "%s/%s", - _PATH_BOOTDIR, lp->d_boot1); + sprintf(boot1, "%s/%s", _PATH_BOOTDIR, lp->d_boot1); else - (void)strcpy(boot1, lp->d_boot1); + strcpy(boot1, lp->d_boot1); bootxx = boot1; } #endif @@ -390,7 +388,7 @@ makelabel(const char *type, const char *name, struct disklabel *lp) /* d_packname is union d_boot[01], so zero */ bzero(lp->d_packname, sizeof(lp->d_packname)); if (name) - (void)strncpy(lp->d_packname, name, sizeof(lp->d_packname)); + strncpy(lp->d_packname, name, sizeof(lp->d_packname)); } int @@ -432,7 +430,7 @@ writelabel(int f, const char *boot, struct disklabel *lp) l_perror("ioctl DIOCSDINFO"); return (1); } - (void)lseek(f, (off_t)0, SEEK_SET); + lseek(f, (off_t)0, SEEK_SET); #ifdef __alpha__ /* @@ -464,7 +462,7 @@ writelabel(int f, const char *boot, struct disklabel *lp) } #endif flag = 0; - (void) ioctl(f, DIOCWLABEL, &flag); + ioctl(f, DIOCWLABEL, &flag); } else if (ioctl(f, DIOCWDINFO, lp) < 0) { l_perror("ioctl DIOCWDINFO"); return (1); @@ -475,8 +473,8 @@ writelabel(int f, const char *boot, struct disklabel *lp) alt = lp->d_ncylinders * lp->d_secpercyl - lp->d_nsectors; for (i = 1; i < 11 && i < lp->d_nsectors; i += 2) { - (void)lseek(f, (off_t)((alt + i) * lp->d_secsize), - SEEK_SET); + lseek(f, (off_t)((alt + i) * lp->d_secsize), + SEEK_SET); if (write(f, boot, lp->d_secsize) < lp->d_secsize) warn("alternate label %d write", i/2); } @@ -607,12 +605,12 @@ makebootarea(char *boot, struct disklabel *dp, int f) *np++ = '\0'; if (!xxboot) { - (void)sprintf(boot0, "%s/boot1", _PATH_BOOTDIR); + sprintf(boot0, "%s/boot1", _PATH_BOOTDIR); xxboot = boot0; } #if NUMBOOT > 1 if (!bootxx) { - (void)sprintf(boot1, "%s/boot2", _PATH_BOOTDIR); + sprintf(boot1, "%s/boot2", _PATH_BOOTDIR); bootxx = boot1; } #endif @@ -651,7 +649,7 @@ makebootarea(char *boot, struct disklabel *dp, int f) #endif /* i386 */ if (read(b, boot, (int)dp->d_secsize) < 0) err(4, "%s", xxboot); - (void)close(b); + close(b); #ifdef __i386__ for (i = DOSPARTOFF, found = 0; !found && i < DOSPARTOFF + NDOSPART*sizeof(struct dos_partition); @@ -707,7 +705,7 @@ makebootarea(char *boot, struct disklabel *dp, int f) } } #endif /* NUMBOOT > 1 */ - (void)close(b); + close(b); #endif /* NUMBOOT > 0 */ /* * Make sure no part of the bootstrap is written in the area @@ -847,7 +845,7 @@ edit(struct disklabel *lp, int f) *lp = label; if (writelabel(f, bootarea, lp) == 0) { fclose(fp); - (void) unlink(tmpfil); + unlink(tmpfil); return (0); } } @@ -860,7 +858,7 @@ edit(struct disklabel *lp, int f) if (c == (int)'n') break; } - (void) unlink(tmpfil); + unlink(tmpfil); return (1); } @@ -1577,7 +1575,7 @@ getvirginlabel(void) warnx("\"auto\" requires the usage of a canonical disk name"); return (NULL); } - (void)snprintf(namebuf, BBSIZE, "%s%s", _PATH_DEV, dkname); + snprintf(namebuf, BBSIZE, "%s%s", _PATH_DEV, dkname); if ((f = open(namebuf, O_RDONLY)) == -1) { warn("cannot open %s", namebuf); return (NULL); diff --git a/sbin/dmesg/dmesg.c b/sbin/dmesg/dmesg.c index f5f15ab861..9cc0ed3a7d 100644 --- a/sbin/dmesg/dmesg.c +++ b/sbin/dmesg/dmesg.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1991, 1993 The Regents of the University of California. All rights reserved. * @(#)dmesg.c 8.1 (Berkeley) 6/5/93 * $FreeBSD: src/sbin/dmesg/dmesg.c,v 1.11.2.3 2001/08/08 22:32:15 obrien Exp $ - * $DragonFly: src/sbin/dmesg/dmesg.c,v 1.5 2004/02/04 17:39:59 joerg Exp $ + * $DragonFly: src/sbin/dmesg/dmesg.c,v 1.6 2004/12/18 21:43:38 swildner Exp $ */ #include @@ -75,7 +75,7 @@ main(int argc, char **argv) size_t buflen; int bufpos; - (void) setlocale(LC_CTYPE, ""); + setlocale(LC_CTYPE, ""); memf = nlistf = NULL; while ((ch = getopt(argc, argv, "aM:N:")) != -1) switch(ch) { @@ -169,20 +169,20 @@ main(int argc, char **argv) if (ch == '\0') continue; newl = ch == '\n'; - (void)vis(buf, ch, 0, 0); + vis(buf, ch, 0, 0); if (buf[1] == 0) - (void)putchar(buf[0]); + putchar(buf[0]); else - (void)printf("%s", buf); + printf("%s", buf); } while (++p != ep); if (!newl) - (void)putchar('\n'); + putchar('\n'); exit(0); } void usage(void) { - (void)fprintf(stderr, "usage: dmesg [-a] [-M core] [-N system]\n"); + fprintf(stderr, "usage: dmesg [-a] [-M core] [-N system]\n"); exit(1); } diff --git a/sbin/dump/dumprmt.c b/sbin/dump/dumprmt.c index ee2d713594..b7b2d47325 100644 --- a/sbin/dump/dumprmt.c +++ b/sbin/dump/dumprmt.c @@ -32,7 +32,7 @@ * * @(#)dumprmt.c 8.3 (Berkeley) 4/28/95 * $FreeBSD: src/sbin/dump/dumprmt.c,v 1.14.2.1 2000/07/01 06:31:52 ps Exp $ - * $DragonFly: src/sbin/dump/dumprmt.c,v 1.5 2003/11/01 17:15:58 drhodus Exp $ + * $DragonFly: src/sbin/dump/dumprmt.c,v 1.6 2004/12/18 21:43:38 swildner Exp $ */ #include @@ -181,7 +181,7 @@ rmtgetconn(void) msg("login to %s as %s failed.\n", rmtpeer, tuser); return; } - (void)fprintf(stderr, "Connection to %s established.\n", rmtpeer); + fprintf(stderr, "Connection to %s established.\n", rmtpeer); size = ntrec * TP_BSIZE; if (size > 60 * 1024) /* XXX */ size = 60 * 1024; @@ -190,7 +190,7 @@ rmtgetconn(void) while (size > TP_BSIZE && setsockopt(rmtape, SOL_SOCKET, SO_SNDBUF, &size, sizeof (size)) < 0) size -= TP_BSIZE; - (void)setsockopt(rmtape, SOL_SOCKET, SO_RCVBUF, &size, sizeof (size)); + setsockopt(rmtape, SOL_SOCKET, SO_RCVBUF, &size, sizeof (size)); throughput = IPTOS_THROUGHPUT; if (setsockopt(rmtape, IPPROTO_IP, IP_TOS, &throughput, sizeof(throughput)) < 0) @@ -221,7 +221,7 @@ rmtopen(char *tape, int mode) { char buf[256]; - (void)snprintf(buf, sizeof (buf), "O%.226s\n%d\n", tape, mode); + snprintf(buf, sizeof (buf), "O%.226s\n%d\n", tape, mode); rmtstate = TS_OPEN; return (rmtcall(tape, buf)); } @@ -242,7 +242,7 @@ rmtread(char *buf, int count) char line[30]; int n, i, cc; - (void)snprintf(line, sizeof (line), "R%d\n", count); + snprintf(line, sizeof (line), "R%d\n", count); n = rmtcall("read", line); if (n < 0) /* rmtcall() properly sets errno for us on errors. */ @@ -260,7 +260,7 @@ rmtwrite(char *buf, int count) { char line[30]; - (void)snprintf(line, sizeof (line), "W%d\n", count); + snprintf(line, sizeof (line), "W%d\n", count); write(rmtape, line, strlen(line)); write(rmtape, buf, count); return (rmtreply("write")); @@ -271,7 +271,7 @@ rmtwrite0(int count) { char line[30]; - (void)snprintf(line, sizeof (line), "W%d\n", count); + snprintf(line, sizeof (line), "W%d\n", count); write(rmtape, line, strlen(line)); } @@ -294,7 +294,7 @@ rmtseek(int offset, int pos) { char line[80]; - (void)snprintf(line, sizeof (line), "L%d\n%d\n", offset, pos); + snprintf(line, sizeof (line), "L%d\n%d\n", offset, pos); return (rmtcall("seek", line)); } @@ -321,7 +321,7 @@ rmtioctl(int cmd, int count) if (count < 0) return (-1); - (void)snprintf(buf, sizeof (buf), "I%d\n%d\n", cmd, count); + snprintf(buf, sizeof (buf), "I%d\n%d\n", cmd, count); return (rmtcall("ioctl", buf)); } diff --git a/sbin/dump/itime.c b/sbin/dump/itime.c index d592d6ed21..6b5c94f8bb 100644 --- a/sbin/dump/itime.c +++ b/sbin/dump/itime.c @@ -32,7 +32,7 @@ * * @(#)itime.c 8.1 (Berkeley) 6/5/93 * $FreeBSD: src/sbin/dump/itime.c,v 1.3.2.1 2001/08/01 06:29:35 obrien Exp $ - * $DragonFly: src/sbin/dump/itime.c,v 1.5 2003/11/01 17:15:58 drhodus Exp $ + * $DragonFly: src/sbin/dump/itime.c,v 1.6 2004/12/18 21:43:38 swildner Exp $ */ #include @@ -94,16 +94,16 @@ initdumptimes(void) strerror(errno)); return; } - (void) fclose(df); + fclose(df); if ((df = fopen(dumpdates, "r")) == NULL) { quit("cannot read %s even after creating it: %s\n", dumpdates, strerror(errno)); /* NOTREACHED */ } } - (void) flock(fileno(df), LOCK_SH); + flock(fileno(df), LOCK_SH); readdumptimes(df); - (void) fclose(df); + fclose(df); } static void @@ -178,7 +178,7 @@ putdumptime(void) if ((df = fopen(dumpdates, "r+")) == NULL) quit("cannot rewrite %s: %s\n", dumpdates, strerror(errno)); fd = fileno(df); - (void) flock(fd, LOCK_EX); + flock(fd, LOCK_EX); fname = disk; free((char *)ddatev); ddatev = 0; @@ -204,7 +204,7 @@ putdumptime(void) (struct dumpdates *)calloc(1, sizeof (struct dumpdates)); nddates += 1; found: - (void) strncpy(dtwalk->dd_name, fname, sizeof (dtwalk->dd_name)); + strncpy(dtwalk->dd_name, fname, sizeof (dtwalk->dd_name)); dtwalk->dd_level = level; dtwalk->dd_ddate = spcl.c_date; @@ -215,7 +215,7 @@ putdumptime(void) quit("%s: %s\n", dumpdates, strerror(errno)); if (ftruncate(fd, ftell(df))) quit("ftruncate (%s): %s\n", dumpdates, strerror(errno)); - (void) fclose(df); + fclose(df); msg("level %c dump on %s", level, spcl.c_date == 0 ? "the epoch\n" : ctime(&spcl.c_date)); } @@ -258,7 +258,7 @@ makedumpdate(struct dumpdates *ddp, char *tbuf) { char un_buf[128]; - (void) sscanf(tbuf, DUMPINFMT, ddp->dd_name, &ddp->dd_level, un_buf); + sscanf(tbuf, DUMPINFMT, ddp->dd_name, &ddp->dd_level, un_buf); ddp->dd_ddate = unctime(un_buf); if (ddp->dd_ddate < 0) return(-1); diff --git a/sbin/dump/main.c b/sbin/dump/main.c index 7d9fbfa7af..6ac97619df 100644 --- a/sbin/dump/main.c +++ b/sbin/dump/main.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1980, 1991, 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)main.c 8.6 (Berkeley) 5/1/95 * $FreeBSD: src/sbin/dump/main.c,v 1.20.2.9 2003/01/25 18:54:59 dillon Exp $ - * $DragonFly: src/sbin/dump/main.c,v 1.7 2004/08/30 19:27:21 eirikn Exp $ + * $DragonFly: src/sbin/dump/main.c,v 1.8 2004/12/18 21:43:38 swildner Exp $ */ #include @@ -99,7 +99,7 @@ main(int argc, char **argv) ino_t maxino; spcl.c_date = 0; - (void)time((time_t *)&spcl.c_date); + time((time_t *)&spcl.c_date); tsize = 0; /* Default later, based on 'c' option for cart tapes */ if ((tape = getenv("TAPE")) == NULL) @@ -189,8 +189,7 @@ main(int argc, char **argv) case 'T': /* time of last dump */ spcl.c_ddate = unctime(optarg); if (spcl.c_ddate < 0) { - (void)fprintf(stderr, "bad time \"%s\"\n", - optarg); + fprintf(stderr, "bad time \"%s\"\n", optarg); exit(X_STARTUP); } Tflag = 1; @@ -213,21 +212,20 @@ main(int argc, char **argv) argv += optind; if (argc < 1) { - (void)fprintf(stderr, "Must specify disk or filesystem\n"); + fprintf(stderr, "Must specify disk or filesystem\n"); exit(X_STARTUP); } disk = *argv++; argc--; if (argc >= 1) { - (void)fprintf(stderr, "Unknown arguments to dump:"); + fprintf(stderr, "Unknown arguments to dump:"); while (argc--) - (void)fprintf(stderr, " %s", *argv++); - (void)fprintf(stderr, "\n"); + fprintf(stderr, " %s", *argv++); + fprintf(stderr, "\n"); exit(X_STARTUP); } if (Tflag && uflag) { - (void)fprintf(stderr, - "You cannot use the T and u flags together.\n"); + fprintf(stderr, "You cannot use the T and u flags together.\n"); exit(X_STARTUP); } if (strcmp(tape, "-") == 0) { @@ -260,17 +258,17 @@ main(int argc, char **argv) *tape++ = '\0'; #ifdef RDUMP if (strchr(tape, '\n')) { - (void)fprintf(stderr, "invalid characters in tape\n"); + fprintf(stderr, "invalid characters in tape\n"); exit(X_STARTUP); } if (rmthost(host) == 0) exit(X_STARTUP); #else - (void)fprintf(stderr, "remote dump not enabled\n"); + fprintf(stderr, "remote dump not enabled\n"); exit(X_STARTUP); #endif } - (void)setuid(getuid()); /* rmthost() is the only reason to be setuid */ + setuid(getuid()); /* rmthost() is the only reason to be setuid */ if (signal(SIGHUP, SIG_IGN) != SIG_IGN) signal(SIGHUP, sig); @@ -297,17 +295,16 @@ main(int argc, char **argv) dt = fstabsearch(disk); if (dt != NULL) { disk = rawname(dt->fs_spec); - (void)strncpy(spcl.c_dev, dt->fs_spec, NAMELEN); - (void)strncpy(spcl.c_filesys, dt->fs_file, NAMELEN); + strncpy(spcl.c_dev, dt->fs_spec, NAMELEN); + strncpy(spcl.c_filesys, dt->fs_file, NAMELEN); } else { - (void)strncpy(spcl.c_dev, disk, NAMELEN); - (void)strncpy(spcl.c_filesys, "an unlisted file system", - NAMELEN); + strncpy(spcl.c_dev, disk, NAMELEN); + strncpy(spcl.c_filesys, "an unlisted file system", NAMELEN); } spcl.c_dev[NAMELEN-1]='\0'; spcl.c_filesys[NAMELEN-1]='\0'; - (void)strcpy(spcl.c_label, "none"); - (void)gethostname(spcl.c_host, NAMELEN); + strcpy(spcl.c_label, "none"); + gethostname(spcl.c_host, NAMELEN); spcl.c_level = level - '0'; spcl.c_type = TS_TAPE; if (!Tflag) @@ -429,7 +426,7 @@ main(int argc, char **argv) "can't allocate tape buffers - try a smaller blocking factor.\n"); startnewtape(1); - (void)time((time_t *)&(tstart_writing)); + time((time_t *)&(tstart_writing)); dumpmap(usedinomap, TS_CLRI, maxino - 1); passno = 3; @@ -449,7 +446,7 @@ main(int argc, char **argv) dp = getino(ino); if ((dp->di_mode & IFMT) != IFDIR) continue; - (void)dumpino(dp, ino); + dumpino(dp, ino); } passno = 4; @@ -471,7 +468,7 @@ main(int argc, char **argv) mode = dp->di_mode & IFMT; if (mode == IFDIR) continue; - (void)dumpino(dp, ino); + dumpino(dp, ino); } time(&tend_writing); @@ -547,15 +544,15 @@ sig(int signo) if (pipeout) quit("Signal on pipe: cannot recover\n"); msg("Rewriting attempted as response to unknown signal.\n"); - (void)fflush(stderr); - (void)fflush(stdout); + fflush(stderr); + fflush(stdout); close_rewind(); exit(X_REWRITE); /* NOTREACHED */ case SIGSEGV: msg("SIGSEGV: ABORTING!\n"); - (void)signal(SIGSEGV, SIG_DFL); - (void)kill(0, SIGSEGV); + signal(SIGSEGV, SIG_DFL); + kill(0, SIGSEGV); /* NOTREACHED */ } } @@ -581,11 +578,11 @@ rawname(char *cp) if (dp == NULL) return (NULL); *dp = '\0'; - (void)strncpy(rawbuf, cp, MAXPATHLEN - 1); + strncpy(rawbuf, cp, MAXPATHLEN - 1); rawbuf[MAXPATHLEN-1] = '\0'; *dp = '/'; - (void)strncat(rawbuf, "/r", MAXPATHLEN - 1 - strlen(rawbuf)); - (void)strncat(rawbuf, dp + 1, MAXPATHLEN - 1 - strlen(rawbuf)); + strncat(rawbuf, "/r", MAXPATHLEN - 1 - strlen(rawbuf)); + strncat(rawbuf, dp + 1, MAXPATHLEN - 1 - strlen(rawbuf)); return (rawbuf); } @@ -636,7 +633,7 @@ obsolete(int *argcp, char ***argvp) err(1, NULL); nargv[0][0] = '-'; nargv[0][1] = *ap; - (void)strcpy(&nargv[0][2], *argv); + strcpy(&nargv[0][2], *argv); ++argv; ++nargv; break; diff --git a/sbin/dump/optr.c b/sbin/dump/optr.c index 5337f78cc8..f67ca4d472 100644 --- a/sbin/dump/optr.c +++ b/sbin/dump/optr.c @@ -32,7 +32,7 @@ * * @(#)optr.c 8.2 (Berkeley) 1/6/94 * $FreeBSD: src/sbin/dump/optr.c,v 1.9.2.5 2002/02/23 22:32:51 iedowse Exp $ - * $DragonFly: src/sbin/dump/optr.c,v 1.4 2003/11/01 17:15:58 drhodus Exp $ + * $DragonFly: src/sbin/dump/optr.c,v 1.5 2004/12/18 21:43:38 swildner Exp $ */ #include @@ -95,20 +95,19 @@ query(char *question) } else if (replybuffer[0] == 'n' || replybuffer[0] == 'N') { back = 0; } else { - (void) fprintf(stderr, - " DUMP: \"Yes\" or \"No\"?\n"); - (void) fprintf(stderr, - " DUMP: %s: (\"yes\" or \"no\") ", question); + fprintf(stderr, " DUMP: \"Yes\" or \"No\"?\n"); + fprintf(stderr, " DUMP: %s: (\"yes\" or \"no\") ", + question); } } while (back < 0); /* * Turn off the alarm, and reset the signal to trap out.. */ - (void) alarm(0); + alarm(0); if (signal(SIGALRM, sig) == SIG_IGN) signal(SIGALRM, SIG_IGN); - (void) fclose(mytty); + fclose(mytty); return(back); } @@ -123,8 +122,7 @@ alarmcatch() { if (notify == 0) { if (timeout == 0) - (void) fprintf(stderr, - " DUMP: %s: (\"yes\" or \"no\") ", + fprintf(stderr, " DUMP: %s: (\"yes\" or \"no\") ", attnmessage); else msgtail("\a\a"); @@ -133,11 +131,10 @@ alarmcatch() msgtail("\n"); broadcast(""); /* just print last msg */ } - (void) fprintf(stderr," DUMP: %s: (\"yes\" or \"no\") ", - attnmessage); + fprintf(stderr," DUMP: %s: (\"yes\" or \"no\") ", attnmessage); } signal(SIGALRM, alarmcatch); - (void) alarm(120); + alarm(120); timeout = 1; } @@ -168,13 +165,13 @@ broadcast(char *message) if ((fp = popen(buf, "w")) == NULL) return; - (void) fputs("\a\a\aMessage from the dump program to all operators\n\nDUMP: NEEDS ATTENTION: ", fp); + fputs("\a\a\aMessage from the dump program to all operators\n\nDUMP: NEEDS ATTENTION: ", fp); if (lastmsg[0]) - (void) fputs(lastmsg, fp); + fputs(lastmsg, fp); if (message[0]) - (void) fputs(message, fp); + fputs(message, fp); - (void) pclose(fp); + pclose(fp); } /* @@ -190,7 +187,7 @@ timeest(void) time_t tnow; int deltat, hours, mins; - (void) time(&tnow); + time(&tnow); deltat = (blockswritten == 0) ? 0 : tstart_writing - tnow + (double)(tnow - tstart_writing) / blockswritten * tapesize; percent = (blockswritten * 100.0) / tapesize; @@ -222,15 +219,15 @@ msg(const char *fmt, ...) { va_list ap; - (void) fprintf(stderr," DUMP: "); + fprintf(stderr," DUMP: "); #ifdef TDEBUG - (void) fprintf(stderr, "pid=%d ", getpid()); + fprintf(stderr, "pid=%d ", getpid()); #endif va_start(ap, fmt); - (void) vfprintf(stderr, fmt, ap); - (void) fflush(stdout); - (void) fflush(stderr); - (void) vsnprintf(lastmsg, sizeof(lastmsg), fmt, ap); + vfprintf(stderr, fmt, ap); + fflush(stdout); + fflush(stderr); + vsnprintf(lastmsg, sizeof(lastmsg), fmt, ap); va_end(ap); } @@ -240,7 +237,7 @@ msgtail(const char *fmt, ...) va_list ap; va_start(ap, fmt); - (void) vfprintf(stderr, fmt, ap); + vfprintf(stderr, fmt, ap); va_end(ap); } @@ -249,15 +246,15 @@ quit(const char *fmt, ...) { va_list ap; - (void) fprintf(stderr," DUMP: "); + fprintf(stderr," DUMP: "); #ifdef TDEBUG - (void) fprintf(stderr, "pid=%d ", getpid()); + fprintf(stderr, "pid=%d ", getpid()); #endif va_start(ap, fmt); - (void) vfprintf(stderr, fmt, ap); + vfprintf(stderr, fmt, ap); va_end(ap); - (void) fflush(stdout); - (void) fflush(stderr); + fflush(stdout); + fflush(stderr); dumpabort(0); } @@ -311,7 +308,7 @@ getfstab(void) pf->pf_fstab = fs; SLIST_INSERT_HEAD(&table, pf, pf_list); } - (void) endfsent(); + endfsent(); } /* @@ -363,15 +360,15 @@ lastdump(int arg) time_t tnow; struct tm *tlast; - (void) time(&tnow); + time(&tnow); getfstab(); /* /etc/fstab input */ initdumptimes(); /* /etc/dumpdates input */ qsort((char *) ddatev, nddates, sizeof(struct dumpdates *), datesort); if (arg == 'w') - (void) printf("Dump these file systems:\n"); + printf("Dump these file systems:\n"); else - (void) printf("Last dump(s) done (Dump '>' file systems):\n"); + printf("Last dump(s) done (Dump '>' file systems):\n"); lastname = "??"; ITITERATE(i, dtwalk) { if (strncmp(lastname, dtwalk->dd_name, @@ -389,7 +386,7 @@ lastdump(int arg) + (dt->fs_freq * 86400)); }; if (arg != 'w' || dumpme) - (void) printf( + printf( "%c %8s\t(%6s) Last dump: Level %c, Date %s\n", dumpme && (arg != 'w') ? '>' : ' ', dtwalk->dd_name, diff --git a/sbin/dump/tape.c b/sbin/dump/tape.c index 31fba3e349..1848a506b1 100644 --- a/sbin/dump/tape.c +++ b/sbin/dump/tape.c @@ -32,7 +32,7 @@ * * @(#)tape.c 8.4 (Berkeley) 5/1/95 * $FreeBSD: src/sbin/dump/tape.c,v 1.12.2.3 2002/02/23 22:32:51 iedowse Exp $ - * $DragonFly: src/sbin/dump/tape.c,v 1.6 2004/02/04 17:39:59 joerg Exp $ + * $DragonFly: src/sbin/dump/tape.c,v 1.7 2004/12/18 21:43:38 swildner Exp $ */ #include @@ -337,7 +337,7 @@ trewind(void) quit("or use no size estimate at all.\n"); } } - (void) close(slaves[f].fd); + close(slaves[f].fd); } while (wait((int *)NULL) >= 0) /* wait for any signals from slaves */ /* void */; @@ -357,13 +357,13 @@ trewind(void) } #endif if (fstat(tapefd, &sb) == 0 && S_ISFIFO(sb.st_mode)) { - (void)close(tapefd); + close(tapefd); return; } - (void) close(tapefd); + close(tapefd); while ((f = open(tape, 0)) < 0) sleep (10); - (void) close(f); + close(f); } void @@ -374,7 +374,7 @@ close_rewind(void) trewind(); if (nexttape) return; - (void)time((time_t *)&(tstart_changevol)); + time((time_t *)&(tstart_changevol)); if (!nogripe) { msg("Change Volumes: Mount volume #%d\n", tapeno+1); broadcast("CHANGE DUMP VOLUMES!\a\a\n"); @@ -384,7 +384,7 @@ close_rewind(void) dumpabort(0); /*NOTREACHED*/ } - (void)time((time_t *)&(tend_changevol)); + time((time_t *)&(tend_changevol)); if ((tstart_changevol != (time_t)-1) && (tend_changevol != (time_t)-1)) tstart_writing += (tend_changevol - tstart_changevol); } @@ -522,7 +522,7 @@ startnewtape(int top) parentpid = getpid(); restore_check_point: - (void)signal(SIGINT, interrupt_save); + signal(SIGINT, interrupt_save); /* * All signals are inherited... */ @@ -646,7 +646,7 @@ dumpabort(int signo) if (master != 0 && master != getpid()) /* Signals master to call dumpabort */ - (void) kill(master, SIGTERM); + kill(master, SIGTERM); else { killall(); msg("The ENTIRE dump is aborted.\n"); @@ -708,7 +708,7 @@ enslave(void) slaves[i].sent = 0; if (slaves[i].pid == 0) { /* Slave starts up here */ for (j = 0; j <= i; j++) - (void) close(slaves[j].fd); + close(slaves[j].fd); signal(SIGINT, SIG_IGN); /* Master handles this */ doslave(cmd[0], i); Exit(X_FINOK); @@ -716,9 +716,9 @@ enslave(void) } for (i = 0; i < SLAVES; i++) - (void) atomic(write, slaves[i].fd, - (char *) &slaves[(i + 1) % SLAVES].pid, - sizeof slaves[0].pid); + atomic(write, slaves[i].fd, + (char *) &slaves[(i + 1) % SLAVES].pid, + sizeof slaves[0].pid); master = 0; } @@ -730,7 +730,7 @@ killall(void) for (i = 0; i < SLAVES; i++) if (slaves[i].pid > 0) { - (void) kill(slaves[i].pid, SIGKILL); + kill(slaves[i].pid, SIGKILL); slaves[i].sent = 0; } } @@ -751,7 +751,7 @@ doslave(register int cmd, int slave_number) /* * Need our own seek pointer. */ - (void) close(diskfd); + close(diskfd); if ((diskfd = open(disk, O_RDONLY)) < 0) quit("slave couldn't reopen disk: %s\n", strerror(errno)); @@ -784,7 +784,7 @@ doslave(register int cmd, int slave_number) if (setjmp(jmpbuf) == 0) { ready = 1; if (!caught) - (void) pause(); + pause(); } ready = 0; caught = 0; @@ -830,22 +830,22 @@ doslave(register int cmd, int slave_number) size = 0; if (wrote < 0) { - (void) kill(master, SIGUSR1); + kill(master, SIGUSR1); for (;;) - (void) sigpause(0); + sigpause(0); } else { /* * pass size of write back to master * (for EOT handling) */ - (void) atomic(write, cmd, (char *)&size, sizeof size); + atomic(write, cmd, (char *)&size, sizeof size); } /* * If partial write, don't want next slave to go. * Also jolts him awake. */ - (void) kill(nextslave, SIGUSR2); + kill(nextslave, SIGUSR2); } if (nread != 0) quit("error reading command pipe: %s\n", strerror(errno)); diff --git a/sbin/dumpfs/dumpfs.c b/sbin/dumpfs/dumpfs.c index 1687051a40..387963241e 100644 --- a/sbin/dumpfs/dumpfs.c +++ b/sbin/dumpfs/dumpfs.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1983, 1992, 1993 The Regents of the University of California. All rights reserved. * @(#)dumpfs.c 8.5 (Berkeley) 4/29/95 * $FreeBSD: src/sbin/dumpfs/dumpfs.c,v 1.13.2.1 2001/01/22 18:10:11 iedowse Exp $ - * $DragonFly: src/sbin/dumpfs/dumpfs.c,v 1.5 2003/11/01 17:15:58 drhodus Exp $ + * $DragonFly: src/sbin/dumpfs/dumpfs.c,v 1.6 2004/12/18 21:43:38 swildner Exp $ */ #include @@ -109,12 +109,12 @@ dumpfs(char *name) if (n != SBSIZE) { warnx("%s: non-existent or truncated superblock, skipped", name); - (void)close(fd); + close(fd); return (1); } if (afs.fs_magic != FS_MAGIC) { warnx("%s: superblock has bad magic number, skipped", name); - (void)close(fd); + close(fd); return (1); } @@ -222,11 +222,11 @@ dumpfs(char *name) for (i = 0; i < afs.fs_ncg; i++) if (dumpcg(name, fd, i)) goto err; - (void)close(fd); + close(fd); return (0); err: if (fd != -1) - (void)close(fd); + close(fd); warn("%s", name); return (1); }; @@ -321,6 +321,6 @@ pbits(register void *vp, int max) void usage(void) { - (void)fprintf(stderr, "usage: dumpfs filesys | device\n"); + fprintf(stderr, "usage: dumpfs filesys | device\n"); exit(1); } diff --git a/sbin/fsck/dir.c b/sbin/fsck/dir.c index 0fa1dbdaec..674d633851 100644 --- a/sbin/fsck/dir.c +++ b/sbin/fsck/dir.c @@ -32,7 +32,7 @@ * * @(#)dir.c 8.8 (Berkeley) 4/28/95 * $FreeBSD: src/sbin/fsck/dir.c,v 1.15 1999/08/28 00:12:45 peter Exp $ - * $DragonFly: src/sbin/fsck/dir.c,v 1.6 2004/02/04 17:39:59 joerg Exp $ + * $DragonFly: src/sbin/fsck/dir.c,v 1.7 2004/12/18 21:43:38 swildner Exp $ */ #include @@ -486,7 +486,7 @@ linkup(ino_t orphan, ino_t parentdir, char *name) pfatal("SORRY. NO lost+found DIRECTORY\n\n"); return (0); } - (void)lftempname(tempname, orphan); + lftempname(tempname, orphan); if (makeentry(lfdir, orphan, (name ? name : tempname)) == 0) { pfatal("SORRY. NO SPACE IN lost+found DIRECTORY"); printf("\n\n"); @@ -496,7 +496,7 @@ linkup(ino_t orphan, ino_t parentdir, char *name) if (lostdir) { if ((changeino(orphan, "..", lfdir) & ALTERED) == 0 && parentdir != (ino_t)-1) - (void)makeentry(orphan, lfdir, ".."); + makeentry(orphan, lfdir, ".."); dp = ginode(lfdir); dp->di_nlink++; inodirty(); diff --git a/sbin/fsck/fsutil.c b/sbin/fsck/fsutil.c index 44914f0394..1a84478c0f 100644 --- a/sbin/fsck/fsutil.c +++ b/sbin/fsck/fsutil.c @@ -33,7 +33,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sbin/fsck/fsutil.c,v 1.2.2.1 2001/08/01 05:47:55 obrien Exp $ - * $DragonFly: src/sbin/fsck/fsutil.c,v 1.4 2003/11/01 17:15:58 drhodus Exp $ + * $DragonFly: src/sbin/fsck/fsutil.c,v 1.5 2004/12/18 21:43:38 swildner Exp $ * * $NetBSD: fsutil.c,v 1.7 1998/07/30 17:41:03 thorpej Exp $ */ @@ -93,7 +93,7 @@ errexit(const char *fmt, ...) va_list ap; va_start(ap, fmt); - (void) vfprintf(stderr, fmt, ap); + vfprintf(stderr, fmt, ap); va_end(ap); exit(8); } @@ -102,15 +102,15 @@ static void vmsg(int fatal, const char *fmt, va_list ap) { if (!fatal && preen) - (void) printf("%s: ", dev); + printf("%s: ", dev); - (void) vprintf(fmt, ap); + vprintf(fmt, ap); if (fatal && preen) - (void) printf("\n"); + printf("\n"); if (fatal && preen) { - (void) printf( + printf( "%s: UNEXPECTED INCONSISTENCY; RUN %s MANUALLY.\n", dev, __progname); exit(8); @@ -170,7 +170,7 @@ unrawname(const char *name) return (name); if (dp[1] != 'r') return (name); - (void)snprintf(unrawbuf, 32, "%.*s/%s", (int)(dp - name), name, dp + 2); + snprintf(unrawbuf, 32, "%.*s/%s", (int)(dp - name), name, dp + 2); return (unrawbuf); } @@ -182,7 +182,7 @@ rawname(const char *name) if ((dp = strrchr(name, '/')) == 0) return (0); - (void)snprintf(rawbuf, 32, "%.*s/r%s", (int)(dp - name), name, dp + 1); + snprintf(rawbuf, 32, "%.*s/r%s", (int)(dp - name), name, dp + 1); return (rawbuf); } diff --git a/sbin/fsck/inode.c b/sbin/fsck/inode.c index 79504356e6..5e17c8076d 100644 --- a/sbin/fsck/inode.c +++ b/sbin/fsck/inode.c @@ -32,7 +32,7 @@ * * @(#)inode.c 8.8 (Berkeley) 4/28/95 * $FreeBSD: src/sbin/fsck/inode.c,v 1.20 2000/02/28 20:02:41 mckusick Exp $ - * $DragonFly: src/sbin/fsck/inode.c,v 1.6 2004/02/04 17:39:59 joerg Exp $ + * $DragonFly: src/sbin/fsck/inode.c,v 1.7 2004/12/18 21:43:38 swildner Exp $ */ #include @@ -173,7 +173,7 @@ iblock(struct inodesc *idesc, long ilevel, quad_t isize) for (ap = &bp->b_un.b_indir[nif]; ap < aplim; ap++) { if (*ap == 0) continue; - (void)sprintf(buf, "PARTIALLY TRUNCATED INODE I=%lu", + sprintf(buf, "PARTIALLY TRUNCATED INODE I=%lu", (u_long)idesc->id_number); if (dofix(idesc, buf)) { *ap = 0; @@ -317,7 +317,7 @@ getnextinode(ino_t inumber) * If bread returns an error, it will already have zeroed * out the buffer, so we do not need to do so here. */ - (void)bread(fsreadfd, (char *)inodebuf, dblk, size); + bread(fsreadfd, (char *)inodebuf, dblk, size); dp = inodebuf; } return (dp++); @@ -455,7 +455,7 @@ clri(register struct inodesc *idesc, char *type, int flag) if (preen) printf(" (CLEARED)\n"); n_files--; - (void)ckinode(dp, idesc); + ckinode(dp, idesc); clearinode(dp); inoinfo(idesc->id_number)->ino_state = USTATE; inodirty(); @@ -628,7 +628,7 @@ freeino(ino_t ino) idesc.id_func = pass4check; idesc.id_number = ino; dp = ginode(ino); - (void)ckinode(dp, &idesc); + ckinode(dp, &idesc); clearinode(dp); inodirty(); inoinfo(ino)->ino_state = USTATE; diff --git a/sbin/fsck/main.c b/sbin/fsck/main.c index 9b2f4b8988..b2e3ba942b 100644 --- a/sbin/fsck/main.c +++ b/sbin/fsck/main.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1980, 1986, 1993 The Regents of the University of California. All rights reserved. * @(#)main.c 8.6 (Berkeley) 5/14/95 * $FreeBSD: src/sbin/fsck/main.c,v 1.21.2.1 2001/01/23 23:11:07 iedowse Exp $ - * $DragonFly: src/sbin/fsck/main.c,v 1.7 2004/02/04 17:39:59 joerg Exp $ + * $DragonFly: src/sbin/fsck/main.c,v 1.8 2004/12/18 21:43:38 swildner Exp $ */ #include @@ -122,9 +122,9 @@ main(int argc, char **argv) argc -= optind; argv += optind; if (signal(SIGINT, SIG_IGN) != SIG_IGN) - (void)signal(SIGINT, catch); + signal(SIGINT, catch); if (preen) - (void)signal(SIGQUIT, catchquit); + signal(SIGQUIT, catchquit); signal(SIGINFO, infohandler); /* * Push up our allowed memory limit so we can cope @@ -132,7 +132,7 @@ main(int argc, char **argv) */ if (getrlimit(RLIMIT_DATA, &rlimit) == 0) { rlimit.rlim_cur = rlimit.rlim_max; - (void)setrlimit(RLIMIT_DATA, &rlimit); + setrlimit(RLIMIT_DATA, &rlimit); } if (argc) { while (argc-- > 0) { @@ -141,7 +141,7 @@ main(int argc, char **argv) if (path == NULL) pfatal("Can't check %s\n", *argv); else - (void)checkfilesys(path, 0, 0L, 0); + checkfilesys(path, 0, 0L, 0); ++argv; } exit(0); @@ -193,7 +193,7 @@ checkfilesys(char *filesys, char *mntpt, long auxdata, int child) int cylno; if (preen && child) - (void)signal(SIGQUIT, voidquit); + signal(SIGQUIT, voidquit); cdevname = filesys; if (debug && preen) pwarn("starting\n"); diff --git a/sbin/fsck/pass1.c b/sbin/fsck/pass1.c index 8efcb03a90..42dd1512e4 100644 --- a/sbin/fsck/pass1.c +++ b/sbin/fsck/pass1.c @@ -32,7 +32,7 @@ * * @(#)pass1.c 8.6 (Berkeley) 4/28/95 * $FreeBSD: src/sbin/fsck/pass1.c,v 1.16.2.5 2002/06/23 22:34:58 iedowse Exp $ - * $DragonFly: src/sbin/fsck/pass1.c,v 1.5 2003/11/01 17:15:58 drhodus Exp $ + * $DragonFly: src/sbin/fsck/pass1.c,v 1.6 2004/12/18 21:43:38 swildner Exp $ */ #include @@ -137,7 +137,7 @@ pass1(void) */ for (i = 0; i < inosused; i++, inumber++) { if (inumber < ROOTINO) { - (void)getnextinode(inumber); + getnextinode(inumber); continue; } checkinode(inumber, &idesc); @@ -322,7 +322,7 @@ checkinode(inumber, idesc) } badblk = dupblk = 0; idesc->id_number = inumber; - (void)ckinode(dp, idesc); + ckinode(dp, idesc); idesc->id_entryno *= btodb(sblock.fs_fsize); if (dp->di_blocks != idesc->id_entryno) { pwarn("INCORRECT BLOCK COUNT I=%lu (%ld should be %ld)", diff --git a/sbin/fsck/pass2.c b/sbin/fsck/pass2.c index bedc980b7f..9b020fafef 100644 --- a/sbin/fsck/pass2.c +++ b/sbin/fsck/pass2.c @@ -32,7 +32,7 @@ * * @(#)pass2.c 8.9 (Berkeley) 4/28/95 * $FreeBSD: src/sbin/fsck/pass2.c,v 1.10.2.2 2001/11/24 15:14:59 iedowse Exp $ - * $DragonFly: src/sbin/fsck/pass2.c,v 1.6 2004/02/04 17:39:59 joerg Exp $ + * $DragonFly: src/sbin/fsck/pass2.c,v 1.7 2004/12/18 21:43:38 swildner Exp $ */ #include @@ -174,7 +174,7 @@ pass2(void) memmove(&dp->di_db[0], &inp->i_blks[0], (size_t)inp->i_numblks); curino.id_number = inp->i_number; curino.id_parent = inp->i_parent; - (void)ckinode(dp, &curino); + ckinode(dp, &curino); } /* * Now that the parents of all directories have been found, @@ -195,7 +195,7 @@ pass2(void) fileerror(inp->i_parent, inp->i_number, "MISSING '..'"); if (reply("FIX") == 0) continue; - (void)makeentry(inp->i_number, inp->i_parent, ".."); + makeentry(inp->i_number, inp->i_parent, ".."); inoinfo(inp->i_parent)->ino_linkcnt--; continue; } @@ -206,7 +206,7 @@ pass2(void) inoinfo(inp->i_dotdot)->ino_linkcnt++; inoinfo(inp->i_parent)->ino_linkcnt--; inp->i_dotdot = inp->i_parent; - (void)changeino(inp->i_number, "..", inp->i_parent); + changeino(inp->i_number, "..", inp->i_parent); } /* * Mark all the directories that can be found from the root. @@ -260,7 +260,7 @@ pass2check(struct inodesc *idesc) else proto.d_type = 0; proto.d_namlen = 1; - (void)strcpy(proto.d_name, "."); + strcpy(proto.d_name, "."); # if BYTE_ORDER == LITTLE_ENDIAN if (!newinofmt) { u_char tmp; @@ -303,7 +303,7 @@ chk1: else proto.d_type = 0; proto.d_namlen = 2; - (void)strcpy(proto.d_name, ".."); + strcpy(proto.d_name, ".."); # if BYTE_ORDER == LITTLE_ENDIAN if (!newinofmt) { u_char tmp; diff --git a/sbin/fsck/preen.c b/sbin/fsck/preen.c index 4231d57399..8e2831eb29 100644 --- a/sbin/fsck/preen.c +++ b/sbin/fsck/preen.c @@ -32,7 +32,7 @@ * * @(#)preen.c 8.5 (Berkeley) 4/28/95 * $FreeBSD: src/sbin/fsck/preen.c,v 1.16 1999/12/30 16:32:40 peter Exp $ - * $DragonFly: src/sbin/fsck/preen.c,v 1.7 2004/02/04 17:39:59 joerg Exp $ + * $DragonFly: src/sbin/fsck/preen.c,v 1.8 2004/12/18 21:43:38 swildner Exp $ */ #include @@ -189,7 +189,7 @@ checkfstab(int preen, int maxrun, int (*docheck)(struct fstab *), pt->next ? ", " : "\n"); return (sumstatus); } - (void)endfsent(); + endfsent(); return (0); } @@ -221,7 +221,7 @@ finddisk(char *name) fprintf(stderr, "out of memory"); exit (8); } - (void)strncpy(dk->name, name, len); + strncpy(dk->name, name, len); dk->name[len] = '\0'; dk->part = NULL; dk->next = NULL; @@ -250,12 +250,12 @@ addpart(char *name, char *fsname, long auxdata) fprintf(stderr, "out of memory"); exit (8); } - (void)strcpy(pt->name, name); + strcpy(pt->name, name); if ((pt->fsname = malloc(strlen(fsname) + 1)) == NULL) { fprintf(stderr, "out of memory"); exit (8); } - (void)strcpy(pt->fsname, fsname); + strcpy(pt->fsname, fsname); pt->next = NULL; pt->auxdata = auxdata; } diff --git a/sbin/fsck/utilities.c b/sbin/fsck/utilities.c index 03d5fdd292..46aa663bdb 100644 --- a/sbin/fsck/utilities.c +++ b/sbin/fsck/utilities.c @@ -32,7 +32,7 @@ * * @(#)utilities.c 8.6 (Berkeley) 5/19/95 * $FreeBSD: src/sbin/fsck/utilities.c,v 1.11.2.3 2001/01/23 23:11:07 iedowse Exp $ - * $DragonFly: src/sbin/fsck/utilities.c,v 1.6 2004/02/04 17:39:59 joerg Exp $ + * $DragonFly: src/sbin/fsck/utilities.c,v 1.7 2004/12/18 21:43:38 swildner Exp $ */ #include @@ -92,7 +92,7 @@ reply(char *question) } do { printf("%s? [yn] ", question); - (void) fflush(stdout); + fflush(stdout); c = getc(stdin); while (c != '\n' && getc(stdin) != '\n') { if (feof(stdin)) { @@ -252,7 +252,7 @@ ckfini(int markclean) int ofsmodified, cnt = 0; if (fswritefd < 0) { - (void)close(fsreadfd); + close(fsreadfd); return; } flush(fswritefd, &sblk); @@ -293,8 +293,8 @@ ckfini(int markclean) if (debug) printf("cache missed %ld of %ld (%d%%)\n", diskreads, totalreads, (int)(diskreads * 100 / totalreads)); - (void)close(fsreadfd); - (void)close(fswritefd); + close(fsreadfd); + close(fswritefd); } int @@ -318,7 +318,7 @@ bread(int fd, char *buf, ufs_daddr_t blk, long size) printf("THE FOLLOWING DISK SECTORS COULD NOT BE READ:"); for (cp = buf, i = 0; i < size; i += secsize, cp += secsize) { if (read(fd, cp, (int)secsize) != secsize) { - (void)lseek(fd, offset + i + secsize, 0); + lseek(fd, offset + i + secsize, 0); if (secsize != dev_bsize && dev_bsize != 1) printf(" %ld (%ld),", (blk * dev_bsize + i) / secsize, @@ -358,7 +358,7 @@ bwrite(int fd, char *buf, ufs_daddr_t blk, long size) printf("THE FOLLOWING SECTORS COULD NOT BE WRITTEN:"); for (cp = buf, i = 0; i < size; i += dev_bsize, cp += dev_bsize) if (write(fd, cp, (int)dev_bsize) != dev_bsize) { - (void)lseek(fd, offset + i + dev_bsize, 0); + lseek(fd, offset + i + dev_bsize, 0); printf(" %ld,", blk + i / dev_bsize); } printf("\n"); @@ -418,7 +418,7 @@ freeblk(ufs_daddr_t blkno, long frags) idesc.id_blkno = blkno; idesc.id_numfrags = frags; - (void)pass4check(&idesc); + pass4check(&idesc); } /* @@ -433,13 +433,13 @@ getpathname(char *namebuf, ino_t curdir, ino_t ino) static int busy = 0; if (curdir == ino && ino == ROOTINO) { - (void)strcpy(namebuf, "/"); + strcpy(namebuf, "/"); return; } if (busy || (inoinfo(curdir)->ino_state != DSTATE && inoinfo(curdir)->ino_state != DFOUND)) { - (void)strcpy(namebuf, "?"); + strcpy(namebuf, "?"); return; } busy = 1; @@ -499,7 +499,7 @@ catchquit(int sig) { printf("returning to single-user after filesystem check\n"); returntosingle = 1; - (void)signal(SIGQUIT, SIG_DFL); + signal(SIGQUIT, SIG_DFL); } /* @@ -512,8 +512,8 @@ voidquit(int sig) { sleep(1); - (void)signal(SIGQUIT, SIG_IGN); - (void)signal(SIGQUIT, SIG_DFL); + signal(SIGQUIT, SIG_IGN); + signal(SIGQUIT, SIG_DFL); } /* ARGSUSED */ @@ -576,18 +576,18 @@ pfatal(const char *fmt, ...) va_list ap; va_start(ap, fmt); if (!preen) { - (void)vfprintf(stderr, fmt, ap); + vfprintf(stderr, fmt, ap); va_end(ap); if (usedsoftdep) - (void)fprintf(stderr, + fprintf(stderr, "\nUNEXPECTED SOFT UPDATE INCONSISTENCY\n"); return; } if (cdevname == NULL) cdevname = "fsck"; - (void)fprintf(stderr, "%s: ", cdevname); - (void)vfprintf(stderr, fmt, ap); - (void)fprintf(stderr, + fprintf(stderr, "%s: ", cdevname); + vfprintf(stderr, fmt, ap); + fprintf(stderr, "\n%s: UNEXPECTED%sINCONSISTENCY; RUN fsck MANUALLY.\n", cdevname, usedsoftdep ? " SOFT UPDATE " : " "); ckfini(0); @@ -604,8 +604,8 @@ pwarn(const char *fmt, ...) va_list ap; va_start(ap, fmt); if (preen) - (void)fprintf(stderr, "%s: ", cdevname); - (void)vfprintf(stderr, fmt, ap); + fprintf(stderr, "%s: ", cdevname); + vfprintf(stderr, fmt, ap); va_end(ap); } @@ -619,7 +619,7 @@ panic(const char *fmt, ...) va_start(ap, fmt); pfatal("INTERNAL INCONSISTENCY:"); - (void)vfprintf(stderr, fmt, ap); + vfprintf(stderr, fmt, ap); va_end(ap); exit(EEXIT); } diff --git a/sbin/fsck_msdosfs/dir.c b/sbin/fsck_msdosfs/dir.c index 1d465b26e7..7aa8b6647c 100644 --- a/sbin/fsck_msdosfs/dir.c +++ b/sbin/fsck_msdosfs/dir.c @@ -33,7 +33,7 @@ * * $NetBSD: dir.c,v 1.14 1998/08/25 19:18:15 ross Exp $ * $FreeBSD: src/sbin/fsck_msdosfs/dir.c,v 1.1.2.1 2001/08/01 05:47:55 obrien Exp $ - * $DragonFly: src/sbin/fsck_msdosfs/dir.c,v 1.5 2003/11/03 19:51:05 eirikn Exp $ + * $DragonFly: src/sbin/fsck_msdosfs/dir.c,v 1.6 2004/12/18 21:43:38 swildner Exp $ */ @@ -946,7 +946,7 @@ reconnect(int dosfs, struct bootblock *boot, struct fatEntry *fat, cl_t head) boot->NumFiles++; /* Ensure uniqueness of entry here! XXX */ memset(&d, 0, sizeof d); - (void)snprintf(d.name, sizeof(d.name), "%u", head); + snprintf(d.name, sizeof(d.name), "%u", head); d.flags = 0; d.head = head; d.size = fat[head].length * boot->ClusterSize; diff --git a/sbin/fsirand/fsirand.c b/sbin/fsirand/fsirand.c index ceca44bcf0..c9d4e89b04 100644 --- a/sbin/fsirand/fsirand.c +++ b/sbin/fsirand/fsirand.c @@ -30,7 +30,7 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sbin/fsirand/fsirand.c,v 1.7.2.1 2000/07/01 06:23:36 ps Exp $ - * $DragonFly: src/sbin/fsirand/fsirand.c,v 1.5 2003/11/01 17:15:59 drhodus Exp $ + * $DragonFly: src/sbin/fsirand/fsirand.c,v 1.6 2004/12/18 21:43:38 swildner Exp $ */ #include @@ -90,7 +90,7 @@ main(int argc, char **argv) for (n = optind; n < argc; n++) { if (argc - optind != 1) - (void)puts(argv[n]); + puts(argv[n]); ex += fsirand(argv[n]); if (n < argc - 1) putchar('\n'); @@ -128,7 +128,7 @@ fsirand(char *device) } /* Read in master superblock */ - (void)memset(&sbuf, 0, sizeof(sbuf)); + memset(&sbuf, 0, sizeof(sbuf)); sblock = (struct fs *)&sbuf; if (lseek(devfd, SBOFF, SEEK_SET) == -1) { warn("can't seek to superblock (%qd) on %s", SBOFF, device); @@ -195,10 +195,10 @@ fsirand(char *device) if (printonly && (sblock->fs_id[0] || sblock->fs_id[1])) { if (sblock->fs_inodefmt >= FS_44INODEFMT && sblock->fs_id[0]) - (void)printf("%s was randomized on %s", device, + printf("%s was randomized on %s", device, ctime((const time_t *)&(sblock->fs_id[0]))); - (void)printf("fsid: %x %x\n", sblock->fs_id[0], - sblock->fs_id[1]); + printf("fsid: %x %x\n", sblock->fs_id[0], + sblock->fs_id[1]); } /* Randomize fs_id unless old 4.2BSD filesystem */ @@ -249,8 +249,8 @@ fsirand(char *device) for (n = 0; n < sblock->fs_ipg; n++, inumber++) { if (inumber >= ROOTINO) { if (printonly) - (void)printf("ino %d gen %x\n", inumber, - inodebuf[n].di_gen); + printf("ino %d gen %x\n", inumber, + inodebuf[n].di_gen); else inodebuf[n].di_gen = random(); } @@ -271,7 +271,7 @@ fsirand(char *device) } } } - (void)close(devfd); + close(devfd); return(0); } @@ -279,7 +279,7 @@ fsirand(char *device) static void usage(void) { - (void)fprintf(stderr, - "usage: fsirand [-b] [-f] [-p] special [special ...]\n"); + fprintf(stderr, + "usage: fsirand [-b] [-f] [-p] special [special ...]\n"); exit(1); } diff --git a/sbin/i386/fdisk/fdisk.c b/sbin/i386/fdisk/fdisk.c index a3673a1d2a..13c48f6751 100644 --- a/sbin/i386/fdisk/fdisk.c +++ b/sbin/i386/fdisk/fdisk.c @@ -24,7 +24,7 @@ * the rights to redistribute these changes. * * $FreeBSD: /repoman/r/ncvs/src/sbin/i386/fdisk/fdisk.c,v 1.36.2.14 2004/01/30 14:40:47 harti Exp $ - * $DragonFly: src/sbin/i386/fdisk/fdisk.c,v 1.9 2004/07/08 17:50:46 cpressey Exp $ + * $DragonFly: src/sbin/i386/fdisk/fdisk.c,v 1.10 2004/12/18 21:43:38 swildner Exp $ */ #include @@ -872,12 +872,12 @@ write_s0(void) return -1; #ifdef NOT_NOW flag = 0; - (void) ioctl(fd, DIOCWLABEL, &flag); + ioctl(fd, DIOCWLABEL, &flag); #endif } #ifdef NOT_NOW flag = 0; - (void) ioctl(fd, DIOCWLABEL, &flag); + ioctl(fd, DIOCWLABEL, &flag); #endif return(0); } diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index 1132acb34e..179aaf4012 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1983, 1993 The Regents of the University of California. All rights reserved. * @(#)ifconfig.c 8.2 (Berkeley) 2/16/94 * $FreeBSD: src/sbin/ifconfig/ifconfig.c,v 1.96 2004/02/27 06:43:14 kan Exp $ - * $DragonFly: src/sbin/ifconfig/ifconfig.c,v 1.11 2004/07/07 10:01:15 joerg Exp $ + * $DragonFly: src/sbin/ifconfig/ifconfig.c,v 1.12 2004/12/18 21:43:38 swildner Exp $ */ #include @@ -1977,7 +1977,7 @@ clone_create(void) err(1, "socket"); memset(&ifr, 0, sizeof(ifr)); - (void) strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); if (ioctl(s, SIOCIFCREATE, &ifr) < 0) err(1, "SIOCIFCREATE"); @@ -1998,7 +1998,7 @@ void clone_destroy(const char *val, int d, int s, const struct afswtch *rafp) { - (void) strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); if (ioctl(s, SIOCIFDESTROY, &ifr) < 0) err(1, "SIOCIFDESTROY"); /* diff --git a/sbin/ifconfig/ifieee80211.c b/sbin/ifconfig/ifieee80211.c index a62cf0ae2d..521b4d633f 100644 --- a/sbin/ifconfig/ifieee80211.c +++ b/sbin/ifconfig/ifieee80211.c @@ -23,7 +23,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sbin/ifconfig/ifieee80211.c,v 1.1.2.3 2002/02/07 15:12:37 ambrisko Exp $ - * $DragonFly: src/sbin/ifconfig/ifieee80211.c,v 1.5 2004/07/27 13:56:50 joerg Exp $ + * $DragonFly: src/sbin/ifconfig/ifieee80211.c,v 1.6 2004/12/18 21:43:38 swildner Exp $ */ /*- @@ -289,8 +289,8 @@ ieee80211_status (int s, struct rt_addrinfo *info __unused) u_int8_t data[32]; char spacer; - (void) memset(&ireq, 0, sizeof(ireq)); - (void) strncpy(ireq.i_name, name, sizeof(ireq.i_name)); + memset(&ireq, 0, sizeof(ireq)); + strncpy(ireq.i_name, name, sizeof(ireq.i_name)); ireq.i_data = &data; ireq.i_type = IEEE80211_IOC_SSID; @@ -443,8 +443,8 @@ set80211(int s, int type, int val, int len, u_int8_t *data) { struct ieee80211req ireq; - (void) memset(&ireq, 0, sizeof(ireq)); - (void) strncpy(ireq.i_name, name, sizeof(ireq.i_name)); + memset(&ireq, 0, sizeof(ireq)); + strncpy(ireq.i_name, name, sizeof(ireq.i_name)); ireq.i_type = type; ireq.i_val = val; ireq.i_len = len; diff --git a/sbin/ifconfig/ifmedia.c b/sbin/ifconfig/ifmedia.c index 46dfae034d..a321137d18 100644 --- a/sbin/ifconfig/ifmedia.c +++ b/sbin/ifconfig/ifmedia.c @@ -1,6 +1,6 @@ /* $NetBSD: ifconfig.c,v 1.34 1997/04/21 01:17:58 lukem Exp $ */ /* $FreeBSD: src/sbin/ifconfig/ifmedia.c,v 1.6.2.3 2001/11/14 04:35:07 yar Exp $ */ -/* $DragonFly: src/sbin/ifconfig/ifmedia.c,v 1.5 2003/11/03 19:51:05 eirikn Exp $ */ +/* $DragonFly: src/sbin/ifconfig/ifmedia.c,v 1.6 2004/12/18 21:43:38 swildner Exp $ */ /* * Copyright (c) 1997 Jason R. Thorpe. @@ -108,8 +108,8 @@ media_status(int s, struct rt_addrinfo *info __unused) struct ifmediareq ifmr; int *media_list, i; - (void) memset(&ifmr, 0, sizeof(ifmr)); - (void) strncpy(ifmr.ifm_name, name, sizeof(ifmr.ifm_name)); + memset(&ifmr, 0, sizeof(ifmr)); + strncpy(ifmr.ifm_name, name, sizeof(ifmr.ifm_name)); if (ioctl(s, SIOCGIFMEDIA, (caddr_t)&ifmr) < 0) { /* @@ -188,8 +188,8 @@ setmedia(const char *val, int d, int s, const struct afswtch *afp) struct ifmediareq ifmr; int first_type, subtype; - (void) memset(&ifmr, 0, sizeof(ifmr)); - (void) strncpy(ifmr.ifm_name, name, sizeof(ifmr.ifm_name)); + memset(&ifmr, 0, sizeof(ifmr)); + strncpy(ifmr.ifm_name, name, sizeof(ifmr.ifm_name)); ifmr.ifm_count = 1; ifmr.ifm_ulist = &first_type; @@ -244,8 +244,8 @@ domediaopt(const char *val, int clear, int s) struct ifmediareq ifmr; int *mwords, options; - (void) memset(&ifmr, 0, sizeof(ifmr)); - (void) strncpy(ifmr.ifm_name, name, sizeof(ifmr.ifm_name)); + memset(&ifmr, 0, sizeof(ifmr)); + strncpy(ifmr.ifm_name, name, sizeof(ifmr.ifm_name)); /* * We must go through the motions of reading all diff --git a/sbin/init/init.c b/sbin/init/init.c index 1de464ff12..220c68ff32 100644 --- a/sbin/init/init.c +++ b/sbin/init/init.c @@ -36,7 +36,7 @@ * @(#) Copyright (c) 1991, 1993 The Regents of the University of California. All rights reserved. * @(#)init.c 8.1 (Berkeley) 7/15/93 * $FreeBSD: src/sbin/init/init.c,v 1.38.2.8 2001/10/22 11:27:32 des Exp $ - * $DragonFly: src/sbin/init/init.c,v 1.6 2004/11/20 04:09:34 dillon Exp $ + * $DragonFly: src/sbin/init/init.c,v 1.7 2004/12/18 21:43:38 swildner Exp $ */ #include @@ -308,8 +308,8 @@ invalid: sigemptyset(&sa.sa_mask); sa.sa_flags = 0; sa.sa_handler = SIG_IGN; - (void) sigaction(SIGTTIN, &sa, (struct sigaction *)0); - (void) sigaction(SIGTTOU, &sa, (struct sigaction *)0); + sigaction(SIGTTIN, &sa, (struct sigaction *)0); + sigaction(SIGTTOU, &sa, (struct sigaction *)0); /* * Paranoia. @@ -592,7 +592,7 @@ setctty(char *name) { int fd; - (void) revoke(name); + revoke(name); if ((fd = open(name, O_RDWR)) == -1) { stall("can't open %s: %m", name); _exit(1); @@ -673,8 +673,7 @@ single_user(void) #define SHREQUEST \ "Enter full pathname of shell or RETURN for " _PATH_BSHELL ": " - (void)write(STDERR_FILENO, - SHREQUEST, sizeof(SHREQUEST) - 1); + write(STDERR_FILENO, SHREQUEST, sizeof(SHREQUEST) - 1); while ((num = read(STDIN_FILENO, cp, 1)) != -1 && num != 0 && *cp != '\n' && cp < &altshell[127]) cp++; @@ -769,8 +768,8 @@ runcom(void) sigemptyset(&sa.sa_mask); sa.sa_flags = 0; sa.sa_handler = SIG_IGN; - (void) sigaction(SIGTSTP, &sa, (struct sigaction *)0); - (void) sigaction(SIGHUP, &sa, (struct sigaction *)0); + sigaction(SIGTSTP, &sa, (struct sigaction *)0); + sigaction(SIGHUP, &sa, (struct sigaction *)0); setctty(_PATH_CONSOLE); @@ -979,7 +978,7 @@ new_session(session_t *sprev, int session_index, register struct ttyent *typ) sp->se_flags |= SE_PRESENT; sp->se_device = malloc(sizeof(_PATH_DEV) + strlen(typ->ty_name)); - (void) sprintf(sp->se_device, "%s%s", _PATH_DEV, typ->ty_name); + sprintf(sp->se_device, "%s%s", _PATH_DEV, typ->ty_name); /* * Attempt to open the device, if we get "device not configured" @@ -1023,7 +1022,7 @@ setupargv(session_t *sp, struct ttyent *typ) free(sp->se_getty_argv); } sp->se_getty = malloc(strlen(typ->ty_getty) + strlen(typ->ty_name) + 2); - (void) sprintf(sp->se_getty, "%s %s", typ->ty_getty, typ->ty_name); + sprintf(sp->se_getty, "%s %s", typ->ty_getty, typ->ty_name); sp->se_getty_argv_space = strdup(sp->se_getty); sp->se_getty_argv = construct_argv(sp->se_getty_argv_space); if (sp->se_getty_argv == 0) { @@ -1432,7 +1431,7 @@ catatonia(void) void alrm_handler(int sig) { - (void)sig; + sig; clang = 1; } @@ -1456,7 +1455,7 @@ death(void) } /* Try to run the rc.shutdown script within a period of time */ - (void) runshutdown(); + runshutdown(); for (i = 0; i < 2; ++i) { if (kill(-1, death_sigs[i]) == -1 && errno == ESRCH) @@ -1515,15 +1514,15 @@ runshutdown(void) sigemptyset(&sa.sa_mask); sa.sa_flags = 0; sa.sa_handler = SIG_IGN; - (void) sigaction(SIGTSTP, &sa, (struct sigaction *)0); - (void) sigaction(SIGHUP, &sa, (struct sigaction *)0); + sigaction(SIGTSTP, &sa, (struct sigaction *)0); + sigaction(SIGHUP, &sa, (struct sigaction *)0); if ((fd = open(_PATH_CONSOLE, O_RDWR)) == -1) warning("can't open %s: %m", _PATH_CONSOLE); else { - (void) dup2(fd, 0); - (void) dup2(fd, 1); - (void) dup2(fd, 2); + dup2(fd, 0); + dup2(fd, 1); + dup2(fd, 2); if (fd > 2) close(fd); } diff --git a/sbin/ip6fw/ip6fw.c b/sbin/ip6fw/ip6fw.c index 7cef50b04d..ca5f25fc44 100644 --- a/sbin/ip6fw/ip6fw.c +++ b/sbin/ip6fw/ip6fw.c @@ -49,7 +49,7 @@ * * $Id: ip6fw.c,v 1.1.2.2.2.2 1999/05/14 05:13:50 shin Exp $ * $FreeBSD: src/sbin/ip6fw/ip6fw.c,v 1.1.2.9 2003/04/05 10:54:51 ume Exp $ - * $DragonFly: src/sbin/ip6fw/ip6fw.c,v 1.7 2004/02/04 17:39:59 joerg Exp $ + * $DragonFly: src/sbin/ip6fw/ip6fw.c,v 1.8 2004/12/18 21:43:38 swildner Exp $ */ #include @@ -1350,7 +1350,7 @@ main(int ac, char **av) if ((f = fdopen(pipedes[0], "r")) == NULL) { int savederrno = errno; - (void)kill(preproc, SIGTERM); + kill(preproc, SIGTERM); errno = savederrno; err(EX_OSERR, "fdopen()"); } diff --git a/sbin/ipfw/ipfw.c b/sbin/ipfw/ipfw.c index 947da247df..1d59d928db 100644 --- a/sbin/ipfw/ipfw.c +++ b/sbin/ipfw/ipfw.c @@ -17,7 +17,7 @@ * NEW command line interface for IP firewall facility * * $FreeBSD: src/sbin/ipfw/ipfw.c,v 1.80.2.26 2003/01/14 19:15:58 dillon Exp $ - * $DragonFly: src/sbin/ipfw/Attic/ipfw.c,v 1.6 2004/02/04 17:39:59 joerg Exp $ + * $DragonFly: src/sbin/ipfw/Attic/ipfw.c,v 1.7 2004/12/18 21:43:38 swildner Exp $ */ #include @@ -2460,7 +2460,7 @@ main(int ac, char *av[]) if ((f = fdopen(pipedes[0], "r")) == NULL) { int savederrno = errno; - (void)kill(preproc, SIGTERM); + kill(preproc, SIGTERM); errno = savederrno; err(EX_OSERR, "fdopen()"); } diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c index 7287d39dcb..83b3df5aec 100644 --- a/sbin/ipfw/ipfw2.c +++ b/sbin/ipfw/ipfw2.c @@ -18,7 +18,7 @@ * NEW command line interface for IP firewall facility * * $FreeBSD: src/sbin/ipfw/ipfw2.c,v 1.4.2.13 2003/05/27 22:21:11 gshapiro Exp $ - * $DragonFly: src/sbin/ipfw/ipfw2.c,v 1.5 2004/01/22 06:20:08 dillon Exp $ + * $DragonFly: src/sbin/ipfw/ipfw2.c,v 1.6 2004/12/18 21:43:38 swildner Exp $ */ #include @@ -3587,7 +3587,7 @@ ipfw_readfile(int ac, char *av[]) if ((f = fdopen(pipedes[0], "r")) == NULL) { int savederrno = errno; - (void)kill(preproc, SIGTERM); + kill(preproc, SIGTERM); errno = savederrno; err(EX_OSERR, "fdopen()"); } diff --git a/sbin/mknod/mknod.c b/sbin/mknod/mknod.c index f2d12f6581..d2429bab51 100644 --- a/sbin/mknod/mknod.c +++ b/sbin/mknod/mknod.c @@ -36,7 +36,7 @@ * @(#) Copyright (c) 1989, 1993 The Regents of the University of California. All rights reserved. * @(#)mknod.c 8.1 (Berkeley) 6/5/93 * $FreeBSD: src/sbin/mknod/mknod.c,v 1.13 2000/01/06 17:51:46 obrien Exp $ - * $DragonFly: src/sbin/mknod/mknod.c,v 1.3 2003/09/28 14:39:18 hmp Exp $ + * $DragonFly: src/sbin/mknod/mknod.c,v 1.4 2004/12/18 21:43:38 swildner Exp $ */ #include @@ -55,7 +55,7 @@ static void usage(void) { - (void)fprintf(stderr, + fprintf(stderr, "usage: mknod name [b | c] major minor [owner:group]\n"); exit(1); } diff --git a/sbin/mount/mount.c b/sbin/mount/mount.c index a385480673..336e46cb27 100644 --- a/sbin/mount/mount.c +++ b/sbin/mount/mount.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1980, 1989, 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)mount.c 8.25 (Berkeley) 5/8/95 * $FreeBSD: src/sbin/mount/mount.c,v 1.39.2.3 2001/08/01 08:26:23 obrien Exp $ - * $DragonFly: src/sbin/mount/mount.c,v 1.7 2004/08/09 20:15:23 dillon Exp $ + * $DragonFly: src/sbin/mount/mount.c,v 1.8 2004/12/18 21:43:39 swildner Exp $ */ #include @@ -295,7 +295,7 @@ main(int argc, char **argv) if (fscanf(mountdfp, "%d", &pid) == 1 && pid > 0 && kill(pid, SIGHUP) == -1 && errno != ESRCH) err(1, "signal mountd"); - (void)fclose(mountdfp); + fclose(mountdfp); } exit(rval); @@ -375,7 +375,7 @@ mountfs(const char *vfstype, const char *spec, const char *name, int flags, #endif /* resolve the mountpoint with realpath(3) */ - (void)checkpath(name, mntpath); + checkpath(name, mntpath); name = mntpath; if (mntopts == NULL) @@ -413,10 +413,10 @@ mountfs(const char *vfstype, const char *spec, const char *name, int flags, argv[argc] = NULL; if (debug) { - (void)printf("exec: mount_%s", vfstype); + printf("exec: mount_%s", vfstype); for (i = 1; i < argc; i++) - (void)printf(" %s", argv[i]); - (void)printf("\n"); + printf(" %s", argv[i]); + printf("\n"); return (0); } @@ -431,7 +431,7 @@ mountfs(const char *vfstype, const char *spec, const char *name, int flags, /* Go find an executable. */ for (edir = edirs; *edir; edir++) { - (void)snprintf(execname, + snprintf(execname, sizeof(execname), "%s/mount_%s", *edir, vfstype); execv(execname, (char * const *)argv); } @@ -491,31 +491,31 @@ prmount(struct statfs *sfp) struct opt *o; struct passwd *pw; - (void)printf("%s on %s (%s", sfp->f_mntfromname, sfp->f_mntonname, + printf("%s on %s (%s", sfp->f_mntfromname, sfp->f_mntonname, sfp->f_fstypename); flags = sfp->f_flags & MNT_VISFLAGMASK; for (o = optnames; flags && o->o_opt; o++) if (flags & o->o_opt) { - (void)printf(", %s", o->o_name); + printf(", %s", o->o_name); flags &= ~o->o_opt; } if (sfp->f_owner) { - (void)printf(", mounted by "); + printf(", mounted by "); if ((pw = getpwuid(sfp->f_owner)) != NULL) - (void)printf("%s", pw->pw_name); + printf("%s", pw->pw_name); else - (void)printf("%d", sfp->f_owner); + printf("%d", sfp->f_owner); } if (verbose) { if (sfp->f_syncwrites != 0 || sfp->f_asyncwrites != 0) - (void)printf(", writes: sync %ld async %ld", + printf(", writes: sync %ld async %ld", sfp->f_syncwrites, sfp->f_asyncwrites); if (sfp->f_syncreads != 0 || sfp->f_asyncreads != 0) - (void)printf(", reads: sync %ld async %ld", + printf(", reads: sync %ld async %ld", sfp->f_syncreads, sfp->f_asyncreads); } - (void)printf(")\n"); + printf(")\n"); } struct statfs * @@ -546,7 +546,7 @@ catopt(char *s0, const char *s1) i = strlen(s0) + strlen(s1) + 1 + 1; if ((cp = malloc(i)) == NULL) errx(1, "malloc failed"); - (void)snprintf(cp, i, "%s,%s", s0, s1); + snprintf(cp, i, "%s,%s", s0, s1); } else cp = strdup(s1); @@ -662,7 +662,7 @@ void usage(void) { - (void)fprintf(stderr, "%s\n%s\n%s\n", + fprintf(stderr, "%s\n%s\n%s\n", "usage: mount [-dfpruvw] [-o options] [-t ufs | external_type] special node", " mount [-adfpruvw] [-o options] [-t ufs | external_type]", " mount [-dfpruvw] special | node"); diff --git a/sbin/mount/mount_ufs.c b/sbin/mount/mount_ufs.c index 750aed8160..cda3608e85 100644 --- a/sbin/mount/mount_ufs.c +++ b/sbin/mount/mount_ufs.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)mount_ufs.c 8.4 (Berkeley) 4/26/95 * $FreeBSD: src/sbin/mount/mount_ufs.c,v 1.16.2.3 2001/08/01 08:27:29 obrien Exp $ - * $DragonFly: src/sbin/mount/mount_ufs.c,v 1.5 2003/11/01 17:16:00 drhodus Exp $ + * $DragonFly: src/sbin/mount/mount_ufs.c,v 1.6 2004/12/18 21:43:39 swildner Exp $ */ #include @@ -138,6 +138,6 @@ mount_ufs(int argc, char *const *argv) static void ufs_usage(void) { - (void)fprintf(stderr, "usage: mount_ufs [-o options] special node\n"); + fprintf(stderr, "usage: mount_ufs [-o options] special node\n"); exit(1); } diff --git a/sbin/mount_cd9660/mount_cd9660.c b/sbin/mount_cd9660/mount_cd9660.c index 8850481101..fb1229f507 100644 --- a/sbin/mount_cd9660/mount_cd9660.c +++ b/sbin/mount_cd9660/mount_cd9660.c @@ -40,7 +40,7 @@ * @(#) Copyright (c) 1992, 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)mount_cd9660.c 8.7 (Berkeley) 5/1/95 * $FreeBSD: src/sbin/mount_cd9660/mount_cd9660.c,v 1.15.2.3 2001/03/14 12:05:01 bp Exp $ - * $DragonFly: src/sbin/mount_cd9660/mount_cd9660.c,v 1.3 2003/08/08 04:18:39 dillon Exp $ + * $DragonFly: src/sbin/mount_cd9660/mount_cd9660.c,v 1.4 2004/12/18 21:43:39 swildner Exp $ */ #include @@ -128,8 +128,8 @@ main(int argc, char **argv) * Resolve the mountpoint with realpath(3) and remove unnecessary * slashes from the devicename if there are any. */ - (void)checkpath(dir, mntpath); - (void)rmslashes(dev, dev); + checkpath(dir, mntpath); + rmslashes(dev, dev); #define DEFAULT_ROOTUID -2 /* @@ -179,8 +179,8 @@ main(int argc, char **argv) void usage(void) { - (void)fprintf(stderr, - "usage: mount_cd9660 [-egrv] [-o options] [-s startsector] special node\n"); + fprintf(stderr, + "usage: mount_cd9660 [-egrv] [-o options] [-s startsector] special node\n"); exit(EX_USAGE); } diff --git a/sbin/mount_ext2fs/mount_ext2fs.c b/sbin/mount_ext2fs/mount_ext2fs.c index e52d382096..92afc62a0a 100644 --- a/sbin/mount_ext2fs/mount_ext2fs.c +++ b/sbin/mount_ext2fs/mount_ext2fs.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)mount_lfs.c 8.3 (Berkeley) 3/27/94 * $FreeBSD: src/sbin/mount_ext2fs/mount_ext2fs.c,v 1.11 1999/10/09 11:54:09 phk Exp $ - * $DragonFly: src/sbin/mount_ext2fs/mount_ext2fs.c,v 1.5 2003/11/01 17:16:00 drhodus Exp $ + * $DragonFly: src/sbin/mount_ext2fs/mount_ext2fs.c,v 1.6 2004/12/18 21:43:39 swildner Exp $ */ #include @@ -93,8 +93,8 @@ main(int argc, char **argv) * Resolve the mountpoint with realpath(3) and remove unnecessary * slashes from the devicename if there are any. */ - (void)checkpath(fs_name, mntpath); - (void)rmslashes(args.fspec, args.fspec); + checkpath(fs_name, mntpath); + rmslashes(args.fspec, args.fspec); #define DEFAULT_ROOTUID -2 args.export.ex_root = DEFAULT_ROOTUID; @@ -122,7 +122,7 @@ main(int argc, char **argv) void usage(void) { - (void)fprintf(stderr, - "usage: mount_ext2fs [-o options] special node\n"); + fprintf(stderr, + "usage: mount_ext2fs [-o options] special node\n"); exit(EX_USAGE); } diff --git a/sbin/mount_hpfs/mount_hpfs.c b/sbin/mount_hpfs/mount_hpfs.c index 4cc4f9bfc3..bd42e46571 100644 --- a/sbin/mount_hpfs/mount_hpfs.c +++ b/sbin/mount_hpfs/mount_hpfs.c @@ -29,7 +29,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sbin/mount_hpfs/mount_hpfs.c,v 1.1 1999/12/09 19:09:15 semenu Exp $ - * $DragonFly: src/sbin/mount_hpfs/mount_hpfs.c,v 1.5 2003/11/01 17:16:00 drhodus Exp $ + * $DragonFly: src/sbin/mount_hpfs/mount_hpfs.c,v 1.6 2004/12/18 21:43:39 swildner Exp $ */ #include @@ -75,7 +75,7 @@ main(int argc, char **argv) #endif mntflags = set_gid = set_uid = set_mask = 0; - (void)memset(&args, '\0', sizeof(args)); + memset(&args, '\0', sizeof(args)); while ((c = getopt(argc, argv, "u:g:m:o:c:W:F")) != -1) { switch (c) { diff --git a/sbin/mount_msdos/mount_msdos.c b/sbin/mount_msdos/mount_msdos.c index 49f24bfa63..2e2f6728fb 100644 --- a/sbin/mount_msdos/mount_msdos.c +++ b/sbin/mount_msdos/mount_msdos.c @@ -30,7 +30,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sbin/mount_msdos/mount_msdos.c,v 1.19.2.1 2000/07/20 10:35:13 kris Exp $ - * $DragonFly: src/sbin/mount_msdos/mount_msdos.c,v 1.5 2003/11/01 17:16:00 drhodus Exp $ + * $DragonFly: src/sbin/mount_msdos/mount_msdos.c,v 1.6 2004/12/18 21:43:39 swildner Exp $ */ #include @@ -89,7 +89,7 @@ main(int argc, char **argv) struct vfsconf vfc; mntflags = set_gid = set_uid = set_mask = 0; - (void)memset(&args, '\0', sizeof(args)); + memset(&args, '\0', sizeof(args)); args.magic = MSDOSFS_ARGSMAGIC; while ((c = getopt(argc, argv, "sl9u:g:m:o:L:W:")) != -1) { @@ -148,8 +148,8 @@ main(int argc, char **argv) * Resolve the mountpoint with realpath(3) and remove unnecessary * slashes from the devicename if there are any. */ - (void)checkpath(dir, mntpath); - (void)rmslashes(dev, dev); + checkpath(dir, mntpath); + rmslashes(dev, dev); args.fspec = dev; args.export.ex_root = -2; /* unchecked anyway on DOS fs */ diff --git a/sbin/mount_nfs/mount_nfs.c b/sbin/mount_nfs/mount_nfs.c index 4d29922289..0b16a72888 100644 --- a/sbin/mount_nfs/mount_nfs.c +++ b/sbin/mount_nfs/mount_nfs.c @@ -36,7 +36,7 @@ * @(#) Copyright (c) 1992, 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)mount_nfs.c 8.11 (Berkeley) 5/4/95 * $FreeBSD: src/sbin/mount_nfs/mount_nfs.c,v 1.36.2.6 2003/05/13 14:45:40 trhodes Exp $ - * $DragonFly: src/sbin/mount_nfs/mount_nfs.c,v 1.8 2004/02/04 17:40:00 joerg Exp $ + * $DragonFly: src/sbin/mount_nfs/mount_nfs.c,v 1.9 2004/12/18 21:43:39 swildner Exp $ */ #include @@ -256,7 +256,7 @@ main(int argc, char **argv) uid_t last_ruid; last_ruid = -1; - (void)strcpy(realm, KRB_REALM); + strcpy(realm, KRB_REALM); if (sizeof (struct nfsrpc_nickverf) != RPCX_NICKVERF || sizeof (struct nfsrpc_fullblock) != RPCX_FULLBLOCK || ((char *)&ktick.kt) - ((char *)&ktick) != NFSX_UNSIGNED || @@ -335,7 +335,7 @@ main(int argc, char **argv) break; #ifdef NFSKERB case 'm': - (void)strncpy(realm, optarg, REALM_SZ - 1); + strncpy(realm, optarg, REALM_SZ - 1); realm[REALM_SZ - 1] = '\0'; break; #endif @@ -456,7 +456,7 @@ main(int argc, char **argv) exit(1); /* resolve the mountpoint with realpath(3) */ - (void)checkpath(name, mntpath); + checkpath(name, mntpath); error = getvfsbyname("nfs", &vfc); if (error && vfsisloadable("nfs")) { @@ -500,8 +500,7 @@ main(int argc, char **argv) */ if (ncd.ncd_authuid != last_ruid) { char buf[512]; - (void)sprintf(buf, "%s%d", - TKT_ROOT, ncd.ncd_authuid); + sprintf(buf, "%s%d", TKT_ROOT, ncd.ncd_authuid); krb_set_tkt_string(buf); last_ruid = ncd.ncd_authuid; } @@ -988,7 +987,7 @@ xdr_fh(XDR *xdrsp, register struct nfhret *np) void usage(void) { - (void)fprintf(stderr, "%s\n%s\n%s\n%s\n", + fprintf(stderr, "%s\n%s\n%s\n%s\n", "usage: mount_nfs [-23KNPTUbcdilqs] [-D deadthresh] [-I readdirsize]", " [-L leaseterm] [-R retrycnt] [-a maxreadahead]", " [-g maxgroups] [-m realm] [-o options] [-r readsize]", diff --git a/sbin/mount_ntfs/mount_ntfs.c b/sbin/mount_ntfs/mount_ntfs.c index 6a8678d74d..24ff1ada15 100644 --- a/sbin/mount_ntfs/mount_ntfs.c +++ b/sbin/mount_ntfs/mount_ntfs.c @@ -29,7 +29,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sbin/mount_ntfs/mount_ntfs.c,v 1.3.2.2 2001/10/12 22:08:43 semenu Exp $ - * $DragonFly: src/sbin/mount_ntfs/mount_ntfs.c,v 1.6 2004/08/09 14:40:08 eirikn Exp $ + * $DragonFly: src/sbin/mount_ntfs/mount_ntfs.c,v 1.7 2004/12/18 21:43:39 swildner Exp $ * */ @@ -78,7 +78,7 @@ main(int argc, char **argv) #endif mntflags = set_gid = set_uid = set_mask = 0; - (void)memset(&args, '\0', sizeof(args)); + memset(&args, '\0', sizeof(args)); while ((c = getopt(argc, argv, "aiu:g:m:o:W:")) != -1) { switch (c) { @@ -124,8 +124,8 @@ main(int argc, char **argv) * Resolve the mountpoint with realpath(3) and remove unnecessary * slashes from the devicename if there are any. */ - (void)checkpath(dir, mntpath); - (void)rmslashes(dev, dev); + checkpath(dir, mntpath); + rmslashes(dev, dev); args.fspec = dev; args.export.ex_root = 65534; /* unchecked anyway on DOS fs */ diff --git a/sbin/mount_null/mount_null.c b/sbin/mount_null/mount_null.c index b8850956b6..898cc4f3e3 100644 --- a/sbin/mount_null/mount_null.c +++ b/sbin/mount_null/mount_null.c @@ -36,7 +36,7 @@ * @(#) Copyright (c) 1992, 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)mount_null.c 8.6 (Berkeley) 4/26/95 * $FreeBSD: src/sbin/mount_null/mount_null.c,v 1.13 1999/10/09 11:54:11 phk Exp $ - * $DragonFly: src/sbin/mount_null/mount_null.c,v 1.5 2003/11/01 17:16:00 drhodus Exp $ + * $DragonFly: src/sbin/mount_null/mount_null.c,v 1.6 2004/12/18 21:43:39 swildner Exp $ */ #include @@ -87,8 +87,8 @@ main(int argc, char **argv) usage(); /* resolve target and source with realpath(3) */ - (void)checkpath(argv[0], target); - (void)checkpath(argv[1], source); + checkpath(argv[0], target); + checkpath(argv[1], source); if (subdir(target, source) || subdir(source, target)) errx(EX_USAGE, "%s (%s) and %s are not distinct paths", @@ -129,7 +129,7 @@ subdir(const char *p, const char *dir) static void usage(void) { - (void)fprintf(stderr, - "usage: mount_null [-o options] target_fs mount_point\n"); + fprintf(stderr, + "usage: mount_null [-o options] target_fs mount_point\n"); exit(1); } diff --git a/sbin/mount_portal/activate.c b/sbin/mount_portal/activate.c index b0024b6d0f..ffb0dc2913 100644 --- a/sbin/mount_portal/activate.c +++ b/sbin/mount_portal/activate.c @@ -37,7 +37,7 @@ * @(#)activate.c 8.3 (Berkeley) 4/28/95 * * $FreeBSD: src/sbin/mount_portal/activate.c,v 1.7 1999/08/28 00:13:35 peter Exp $ - * $DragonFly: src/sbin/mount_portal/activate.c,v 1.3 2003/09/28 14:39:19 hmp Exp $ + * $DragonFly: src/sbin/mount_portal/activate.c,v 1.4 2004/12/18 21:43:39 swildner Exp $ */ #include @@ -148,7 +148,7 @@ static void send_reply(int so, int fd, int error) /* * Throw away the open file descriptor */ - (void) close(fd); + close(fd); } void activate(qelem *q, int so) diff --git a/sbin/mount_portal/conf.c b/sbin/mount_portal/conf.c index e80d08ba0a..f643089331 100644 --- a/sbin/mount_portal/conf.c +++ b/sbin/mount_portal/conf.c @@ -37,7 +37,7 @@ * @(#)conf.c 8.2 (Berkeley) 3/27/94 * * $FreeBSD: src/sbin/mount_portal/conf.c,v 1.8 1999/08/28 00:13:35 peter Exp $ - * $DragonFly: src/sbin/mount_portal/conf.c,v 1.3 2003/09/28 14:39:19 hmp Exp $ + * $DragonFly: src/sbin/mount_portal/conf.c,v 1.4 2004/12/18 21:43:39 swildner Exp $ */ #include @@ -295,7 +295,7 @@ void conf_read(qelem *q, char *conf) conf_file = conf; /* XXX */ readfp(q, fp); conf_file = 0; /* XXX */ - (void) fclose(fp); + fclose(fp); } else { syslog(LOG_ERR, "open config file \"%s\": %s", conf, strerror(errno)); } diff --git a/sbin/mount_portal/mount_portal.c b/sbin/mount_portal/mount_portal.c index f234ba6240..5c22a17503 100644 --- a/sbin/mount_portal/mount_portal.c +++ b/sbin/mount_portal/mount_portal.c @@ -36,7 +36,7 @@ * @(#) Copyright (c) 1992, 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)mount_portal.c 8.6 (Berkeley) 4/26/95 * $FreeBSD: src/sbin/mount_portal/mount_portal.c,v 1.16 1999/10/09 11:54:11 phk Exp $ - * $DragonFly: src/sbin/mount_portal/mount_portal.c,v 1.4 2003/11/01 17:16:00 drhodus Exp $ + * $DragonFly: src/sbin/mount_portal/mount_portal.c,v 1.5 2004/12/18 21:43:39 swildner Exp $ */ #include @@ -131,7 +131,7 @@ main(int argc, char **argv) conf = argv[optind]; /* resolve the mountpoint with realpath(3) */ - (void)checkpath(argv[optind+1], mountpt); + checkpath(argv[optind+1], mountpt); /* * Construct the listening socket @@ -149,14 +149,14 @@ main(int argc, char **argv) err(EX_OSERR, "socket"); } um = umask(077); - (void) unlink(un.sun_path); + unlink(un.sun_path); if (bind(so, (struct sockaddr *) &un, sizeof(un)) < 0) err(1, NULL); - (void) unlink(un.sun_path); - (void) umask(um); + unlink(un.sun_path); + umask(um); - (void) listen(so, 5); + listen(so, 5); args.pa_socket = so; sprintf(tag, "portal:%d", getpid()); @@ -261,11 +261,11 @@ main(int argc, char **argv) syslog(LOG_ERR, "fork: %s", strerror(errno)); break; case 0: - (void) close(so); + close(so); activate(&q, so2); exit(0); default: - (void) close(so2); + close(so2); break; } } @@ -276,7 +276,7 @@ main(int argc, char **argv) static void usage(void) { - (void)fprintf(stderr, - "usage: mount_portal [-o options] config mount-point\n"); + fprintf(stderr, + "usage: mount_portal [-o options] config mount-point\n"); exit(EX_USAGE); } diff --git a/sbin/mount_portal/pt_file.c b/sbin/mount_portal/pt_file.c index d3d5fa361e..8ad0f75997 100644 --- a/sbin/mount_portal/pt_file.c +++ b/sbin/mount_portal/pt_file.c @@ -37,7 +37,7 @@ * @(#)pt_file.c 8.3 (Berkeley) 7/3/94 * * $FreeBSD: src/sbin/mount_portal/pt_file.c,v 1.8 1999/08/28 00:13:38 peter Exp $ - * $DragonFly: src/sbin/mount_portal/pt_file.c,v 1.3 2003/09/28 14:39:19 hmp Exp $ + * $DragonFly: src/sbin/mount_portal/pt_file.c,v 1.4 2004/12/18 21:43:39 swildner Exp $ */ #include @@ -86,7 +86,7 @@ int portal_file(struct portal_cred *pcr, char *key, char **v, int so, int *fdp) error = errno; syslog(LOG_ERR, "setcred: %s", strerror(error)); if (fd >= 0) { - (void) close(fd); + close(fd); fd = -1; } } diff --git a/sbin/mount_portal/pt_tcp.c b/sbin/mount_portal/pt_tcp.c index f198364693..97de472bd8 100644 --- a/sbin/mount_portal/pt_tcp.c +++ b/sbin/mount_portal/pt_tcp.c @@ -37,7 +37,7 @@ * @(#)pt_tcp.c 8.5 (Berkeley) 4/28/95 * * $FreeBSD: src/sbin/mount_portal/pt_tcp.c,v 1.9 1999/08/28 00:13:38 peter Exp $ - * $DragonFly: src/sbin/mount_portal/pt_tcp.c,v 1.3 2003/09/28 14:39:19 hmp Exp $ + * $DragonFly: src/sbin/mount_portal/pt_tcp.c,v 1.4 2004/12/18 21:43:39 swildner Exp $ */ #include @@ -151,7 +151,7 @@ int portal_tcp(struct portal_cred *pcr, char *key, char **v, int kso, int *fdp) *fdp = so; return (0); } - (void) close(so); + close(so); ipp++; } diff --git a/sbin/mount_portal/pt_tcplisten.c b/sbin/mount_portal/pt_tcplisten.c index 6495b356cb..d64015ce5c 100644 --- a/sbin/mount_portal/pt_tcplisten.c +++ b/sbin/mount_portal/pt_tcplisten.c @@ -38,7 +38,7 @@ * * @(#)pt_tcp.c 8.3 (Berkeley) 3/27/94 * - * $DragonFly: src/sbin/mount_portal/pt_tcplisten.c,v 1.3 2004/02/04 17:40:00 joerg Exp $ + * $DragonFly: src/sbin/mount_portal/pt_tcplisten.c,v 1.4 2004/12/18 21:43:39 swildner Exp $ * pt_tcp.c,v 1.1.1.1 1994/05/26 06:34:34 rgrimes Exp */ @@ -158,15 +158,15 @@ int portal_tcplisten(struct portal_cred *pcr, char *key, char **v, int kso, listen(so, 1); if ((sock = accept(so, (struct sockaddr *)0, (int *)0)) == -1) { syslog(LOG_ERR, "accept: %m"); - (void) close(so); + close(so); return (errno); } *fdp = sock; - (void) close(so); + close(so); return (0); } syslog(LOG_ERR, "bind: %m"); - (void) close(so); + close(so); return (errno); } @@ -185,14 +185,14 @@ int portal_tcplisten(struct portal_cred *pcr, char *key, char **v, int kso, listen(so, 1); if ((sock = accept(so, (struct sockaddr *)0, (int *)0)) == -1) { syslog(LOG_ERR, "accept: %m"); - (void) close(so); + close(so); return (errno); } *fdp = sock; - (void) close(so); + close(so); return (0); } - (void) close(so); + close(so); ipp++; } diff --git a/sbin/mount_std/mount_std.c b/sbin/mount_std/mount_std.c index fd84e89263..935ef5e538 100644 --- a/sbin/mount_std/mount_std.c +++ b/sbin/mount_std/mount_std.c @@ -36,7 +36,7 @@ * * @(#) Copyright (c) 1992, 1993, 1994 The Regents of the University of California. All rights reserved. * $FreeBSD: src/sbin/mount_std/mount_std.c,v 1.10.2.1 2001/07/30 10:30:07 dd Exp $ - * $DragonFly: src/sbin/mount_std/mount_std.c,v 1.4 2003/11/01 17:16:00 drhodus Exp $ + * $DragonFly: src/sbin/mount_std/mount_std.c,v 1.5 2004/12/18 21:43:39 swildner Exp $ */ #include @@ -110,7 +110,7 @@ main(int argc, char **argv) errx(EX_OSERR, "%s filesystem not available", fsname); /* resolve the mountpoint with realpath(3) */ - (void)checkpath(argv[1], mntpath); + checkpath(argv[1], mntpath); if (mount(vfc.vfc_name, mntpath, mntflags, NULL)) err(EX_OSERR, NULL); @@ -120,8 +120,7 @@ main(int argc, char **argv) void usage(void) { - (void)fprintf(stderr, - "usage: mount_%s [-o options] what_to_mount mount_point\n", - fsname); + fprintf(stderr, + "usage: mount_%s [-o options] what_to_mount mount_point\n", fsname); exit(EX_USAGE); } diff --git a/sbin/mount_udf/mount_udf.c b/sbin/mount_udf/mount_udf.c index 58002c16cf..99bdac1783 100644 --- a/sbin/mount_udf/mount_udf.c +++ b/sbin/mount_udf/mount_udf.c @@ -40,7 +40,7 @@ * @(#) Copyright (c) 1992, 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)mount_cd9660.c 8.7 (Berkeley) 5/1/95 * $FreeBSD: src/sbin/mount_cd9660/mount_cd9660.c,v 1.15.2.3 2001/03/14 12:05:01 bp Exp $ - * $DragonFly: src/sbin/mount_udf/mount_udf.c,v 1.2 2004/03/24 17:39:51 drhodus Exp $ + * $DragonFly: src/sbin/mount_udf/mount_udf.c,v 1.3 2004/12/18 21:43:39 swildner Exp $ */ #include @@ -103,8 +103,8 @@ main(int argc, char **argv) * Resolve the mountpoint with realpath(3) and remove unnecessary * slashes from the devicename if there are any. */ - (void)checkpath(dir, mntpath); - (void)rmslashes(dev, dev); + checkpath(dir, mntpath); + rmslashes(dev, dev); #define DEFAULT_ROOTUID -2 /* @@ -134,7 +134,6 @@ main(int argc, char **argv) void usage(void) { - (void)fprintf(stderr, - "usage: mount_udf [-o options] special node\n"); + fprintf(stderr, "usage: mount_udf [-o options] special node\n"); exit(EX_USAGE); } diff --git a/sbin/mount_umap/mount_umap.c b/sbin/mount_umap/mount_umap.c index 75f14b9969..a21123a8f7 100644 --- a/sbin/mount_umap/mount_umap.c +++ b/sbin/mount_umap/mount_umap.c @@ -36,7 +36,7 @@ * @(#) Copyright (c) 1992, 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)mount_umap.c 8.5 (Berkeley) 4/26/95 * $FreeBSD: src/sbin/mount_umap/mount_umap.c,v 1.15 1999/10/09 11:54:13 phk Exp $ - * $DragonFly: src/sbin/mount_umap/Attic/mount_umap.c,v 1.6 2004/02/04 17:40:00 joerg Exp $ + * $DragonFly: src/sbin/mount_umap/Attic/mount_umap.c,v 1.7 2004/12/18 21:43:39 swildner Exp $ */ #include @@ -117,8 +117,8 @@ main(int argc, char **argv) usage(); /* resolve both target and source with realpath(3) */ - (void)checkpath(argv[0], source); - (void)checkpath(argv[1], target); + checkpath(argv[0], source); + checkpath(argv[1], target); /* Read in uid mapping data. */ if ((fp = fopen(mapfile, "r")) == NULL) @@ -146,7 +146,7 @@ main(int argc, char **argv) errx(EX_DATAERR, "maximum number of entries is %d%s", MAPFILEENTRIES, not); #if 0 - (void)printf("reading %d entries\n", nentries); + printf("reading %d entries\n", nentries); #endif for (count = 0; count < nentries; ++count) { if ((fscanf(fp, "%lu %lu\n", @@ -193,7 +193,7 @@ main(int argc, char **argv) errx(EX_DATAERR, "maximum number of entries is %d%s", GMAPFILEENTRIES, not); #if 0 - (void)printf("reading %d group entries\n", gnentries); + printf("reading %d group entries\n", gnentries); #endif for (count = 0; count < gnentries; ++count) @@ -234,7 +234,7 @@ main(int argc, char **argv) void usage(void) { - (void)fprintf(stderr, + fprintf(stderr, "usage: mount_umap [-o options] -u usermap -g groupmap target_fs mount_point\n"); exit(EX_USAGE); } diff --git a/sbin/mount_union/mount_union.c b/sbin/mount_union/mount_union.c index 4793352fc3..5e7f417e1b 100644 --- a/sbin/mount_union/mount_union.c +++ b/sbin/mount_union/mount_union.c @@ -36,7 +36,7 @@ * @(#) Copyright (c) 1992, 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)mount_union.c 8.5 (Berkeley) 3/27/94 * $FreeBSD: src/sbin/mount_union/mount_union.c,v 1.12 1999/10/09 11:54:14 phk Exp $ - * $DragonFly: src/sbin/mount_union/mount_union.c,v 1.5 2003/11/01 17:16:01 drhodus Exp $ + * $DragonFly: src/sbin/mount_union/mount_union.c,v 1.6 2004/12/18 21:43:39 swildner Exp $ */ #include @@ -98,8 +98,8 @@ main(int argc, char **argv) usage(); /* resolve both target and source with realpath(3) */ - (void)checkpath(argv[0], target); - (void)checkpath(argv[1], source); + checkpath(argv[0], target); + checkpath(argv[1], source); if (subdir(target, source) || subdir(source, target)) errx(EX_USAGE, "%s (%s) and %s (%s) are not distinct paths", @@ -140,7 +140,7 @@ subdir(const char *p, const char *dir) void usage(void) { - (void)fprintf(stderr, - "usage: mount_union [-br] [-o options] target_fs mount_point\n"); + fprintf(stderr, + "usage: mount_union [-br] [-o options] target_fs mount_point\n"); exit(EX_USAGE); } diff --git a/sbin/natd/natd.c b/sbin/natd/natd.c index 4d4bf0e79b..0889a18894 100644 --- a/sbin/natd/natd.c +++ b/sbin/natd/natd.c @@ -10,7 +10,7 @@ * Ari Suutari * * $FreeBSD: src/sbin/natd/natd.c,v 1.25.2.5 2002/02/01 09:18:32 ru Exp $ - * $DragonFly: src/sbin/natd/natd.c,v 1.5 2004/08/19 23:48:16 joerg Exp $ + * $DragonFly: src/sbin/natd/natd.c,v 1.6 2004/12/18 21:43:39 swildner Exp $ */ #define SYSLOG_NAMES @@ -1522,8 +1522,7 @@ SetupProtoRedirect(const char* parms) /* * Create aliasing link. */ - (void)PacketAliasRedirectProto(localAddr, remoteAddr, publicAddr, - proto); + PacketAliasRedirectProto(localAddr, remoteAddr, publicAddr, proto); } void SetupAddressRedirect (const char* parms) @@ -1685,5 +1684,5 @@ SetupPunchFW(const char *strValue) errx(1, "punch_fw: basenumber:count parameter required"); PacketAliasSetFWBase(base, num); - (void)PacketAliasSetMode(PKT_ALIAS_PUNCH_FW, PKT_ALIAS_PUNCH_FW); + PacketAliasSetMode(PKT_ALIAS_PUNCH_FW, PKT_ALIAS_PUNCH_FW); } diff --git a/sbin/newfs/mkfs.c b/sbin/newfs/mkfs.c index 866d2c2024..7a59f2c610 100644 --- a/sbin/newfs/mkfs.c +++ b/sbin/newfs/mkfs.c @@ -32,7 +32,7 @@ * * @(#)mkfs.c 8.11 (Berkeley) 5/3/95 * $FreeBSD: src/sbin/newfs/mkfs.c,v 1.29.2.6 2001/09/21 19:15:21 dillon Exp $ - * $DragonFly: src/sbin/newfs/mkfs.c,v 1.8 2004/06/26 22:44:05 dillon Exp $ + * $DragonFly: src/sbin/newfs/mkfs.c,v 1.9 2004/12/18 21:43:39 swildner Exp $ */ #include "defs.h" @@ -185,13 +185,13 @@ mkfs(struct partition *pp, char *fsys, int fi, int fo, const char *mfscopy) int omask; mfs_ppid = getpid(); - (void) signal(SIGUSR1, parentready); + signal(SIGUSR1, parentready); if ((i = fork())) { if (i == -1) err(10, "mfs"); if (mfscopy) copyroot = FSCopy(©hlinks, mfscopy); - (void) signal(SIGUSR1, started); + signal(SIGUSR1, started); kill(i, SIGUSR1); if (waitpid(i, &status, 0) != -1 && WIFEXITED(status)) exit(WEXITSTATUS(status)); @@ -203,7 +203,7 @@ mkfs(struct partition *pp, char *fsys, int fi, int fo, const char *mfscopy) sigpause(1 << SIGUSR1); sigblock(omask); #ifdef STANDALONE - (void)malloc(0); + malloc(0); #else raise_data_limit(); #endif @@ -752,11 +752,11 @@ next: */ if (mfs) { kill(mfs_ppid, SIGUSR1); - (void) setsid(); - (void) close(0); - (void) close(1); - (void) close(2); - (void) chdir("/"); + setsid(); + close(0); + close(1); + close(2); + chdir("/"); } } @@ -979,12 +979,12 @@ fsinit(time_t utime) * create the lost+found directory */ if (Oflag) { - (void)makedir((struct direct *)olost_found_dir, 2); + makedir((struct direct *)olost_found_dir, 2); for (i = DIRBLKSIZ; i < sblock.fs_bsize; i += DIRBLKSIZ) memmove(&buf[i], &olost_found_dir[2], DIRSIZ(0, &olost_found_dir[2])); } else { - (void)makedir(lost_found_dir, 2); + makedir(lost_found_dir, 2); for (i = DIRBLKSIZ; i < sblock.fs_bsize; i += DIRBLKSIZ) memmove(&buf[i], &lost_found_dir[2], DIRSIZ(0, &lost_found_dir[2])); diff --git a/sbin/newfs/newfs.c b/sbin/newfs/newfs.c index 6b2d08aafb..b3bb8c6866 100644 --- a/sbin/newfs/newfs.c +++ b/sbin/newfs/newfs.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1983, 1989, 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)newfs.c 8.13 (Berkeley) 5/1/95 * $FreeBSD: src/sbin/newfs/newfs.c,v 1.30.2.9 2003/05/13 12:03:55 joerg Exp $ - * $DragonFly: src/sbin/newfs/newfs.c,v 1.10 2004/06/26 22:54:01 dillon Exp $ + * $DragonFly: src/sbin/newfs/newfs.c,v 1.11 2004/12/18 21:43:39 swildner Exp $ */ /* @@ -412,7 +412,7 @@ main(int argc, char **argv) /* * No path prefix; try /dev/%s. */ - (void)snprintf(device, sizeof(device), "%s%s", _PATH_DEV, special); + snprintf(device, sizeof(device), "%s%s", _PATH_DEV, special); special = device; } if (Nflag) { diff --git a/sbin/nfsd/nfsd.c b/sbin/nfsd/nfsd.c index ddf57606ed..1dedb88ec5 100644 --- a/sbin/nfsd/nfsd.c +++ b/sbin/nfsd/nfsd.c @@ -36,7 +36,7 @@ * @(#) Copyright (c) 1989, 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)nfsd.c 8.9 (Berkeley) 3/29/95 * $FreeBSD: src/sbin/nfsd/nfsd.c,v 1.15.2.1 2000/09/16 22:52:23 brian Exp $ - * $DragonFly: src/sbin/nfsd/nfsd.c,v 1.6 2004/02/04 17:40:00 joerg Exp $ + * $DragonFly: src/sbin/nfsd/nfsd.c,v 1.7 2004/12/18 21:43:39 swildner Exp $ */ #include @@ -260,13 +260,13 @@ main(int argc, char **argv, char **envp) if (debug == 0) { daemon(0, 0); - (void)signal(SIGHUP, SIG_IGN); - (void)signal(SIGINT, SIG_IGN); - (void)signal(SIGQUIT, SIG_IGN); - (void)signal(SIGSYS, nonfs); - (void)signal(SIGTERM, SIG_IGN); + signal(SIGHUP, SIG_IGN); + signal(SIGINT, SIG_IGN); + signal(SIGQUIT, SIG_IGN); + signal(SIGSYS, nonfs); + signal(SIGTERM, SIG_IGN); } - (void)signal(SIGCHLD, reapchild); + signal(SIGCHLD, reapchild); if (reregister) { if (udpflag && @@ -326,7 +326,7 @@ main(int argc, char **argv, char **envp) (RPCAUTH_MAXSIZ - 3 * NFSX_UNSIGNED)) { kin.w1 = NFS_KERBW1(kt); kt.mbz = 0; - (void)strcpy(inst, "*"); + strcpy(inst, "*"); if (krb_rd_req(&kt, NFS_KERBSRV, inst, nsd.nsd_haddr, &kauth, "") == RD_AP_OK && krb_kntoln(&kauth, lnam) == KSUCCESS && @@ -407,7 +407,7 @@ main(int argc, char **argv, char **envp) syslog(LOG_ERR, "can't Add UDP socket"); exit(1); } - (void)close(sock); + close(sock); } #ifdef ISO @@ -591,7 +591,7 @@ main(int argc, char **argv, char **envp) nfsdargs.name = (caddr_t)&inetpeer; nfsdargs.namelen = sizeof(inetpeer); nfssvc(NFSSVC_ADDSOCK, &nfsdargs); - (void)close(msgsock); + close(msgsock); } #ifdef notyet if (tp4flag && FD_ISSET(tp4sock, &ready)) { @@ -609,7 +609,7 @@ main(int argc, char **argv, char **envp) nfsdargs.name = (caddr_t)&isopeer; nfsdargs.namelen = len; nfssvc(NFSSVC_ADDSOCK, &nfsdargs); - (void)close(msgsock); + close(msgsock); } if (tpipflag && FD_ISSET(tpipsock, &ready)) { len = sizeof(inetpeer); @@ -625,7 +625,7 @@ main(int argc, char **argv, char **envp) nfsdargs.name = (caddr_t)&inetpeer; nfsdargs.namelen = len; nfssvc(NFSSVC_ADDSOCK, &nfsdargs); - (void)close(msgsock); + close(msgsock); } #endif /* notyet */ } @@ -656,7 +656,7 @@ setbindhost(struct sockaddr_in *ia, const char *bindhost) void usage(void) { - (void)fprintf(stderr, "usage: nfsd %s\n", USAGE); + fprintf(stderr, "usage: nfsd %s\n", USAGE); exit(1); } @@ -682,8 +682,8 @@ setproctitle(char *a) char buf[80]; cp = Argv[0]; - (void)snprintf(buf, sizeof(buf), "nfsd-%s", a); - (void)strncpy(cp, buf, LastArg - cp); + snprintf(buf, sizeof(buf), "nfsd-%s", a); + strncpy(cp, buf, LastArg - cp); cp += strlen(cp); while (cp < LastArg) *cp++ = '\0'; diff --git a/sbin/nos-tun/nos-tun.c b/sbin/nos-tun/nos-tun.c index 1e6f508994..f2d25c9f58 100644 --- a/sbin/nos-tun/nos-tun.c +++ b/sbin/nos-tun/nos-tun.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sbin/nos-tun/nos-tun.c,v 1.6.2.2 2001/08/01 23:14:00 obrien Exp $ - * $DragonFly: src/sbin/nos-tun/nos-tun.c,v 1.4 2003/11/01 17:16:01 drhodus Exp $ + * $DragonFly: src/sbin/nos-tun/nos-tun.c,v 1.5 2004/12/18 21:43:39 swildner Exp $ */ /* @@ -313,9 +313,9 @@ int main (int argc, char **argv) daemon(0,0); /* Install signal handlers */ - (void)signal(SIGHUP,Finish); - (void)signal(SIGINT,Finish); - (void)signal(SIGTERM,Finish); + signal(SIGHUP,Finish); + signal(SIGINT,Finish); + signal(SIGTERM,Finish); for (;;) { /* Set file descriptors for select() */ diff --git a/sbin/pc98/fdisk/fdisk.c b/sbin/pc98/fdisk/fdisk.c index 318ec11873..63c82d494f 100644 --- a/sbin/pc98/fdisk/fdisk.c +++ b/sbin/pc98/fdisk/fdisk.c @@ -24,7 +24,7 @@ * the rights to redistribute these changes. * * $FreeBSD: src/sbin/pc98/fdisk/fdisk.c,v 1.1.2.3 2000/12/11 01:03:25 obrien Exp $ - * $DragonFly: src/sbin/pc98/fdisk/Attic/fdisk.c,v 1.3 2003/09/28 14:39:20 hmp Exp $ + * $DragonFly: src/sbin/pc98/fdisk/Attic/fdisk.c,v 1.4 2004/12/18 21:43:39 swildner Exp $ */ #include @@ -953,7 +953,7 @@ write_s0(void) return -1; #ifdef NOT_NOW flag = 0; - (void) ioctl(fd, DIOCWLABEL, &flag); + ioctl(fd, DIOCWLABEL, &flag); #endif } return(0); diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c index a03c57b14c..29ab83d732 100644 --- a/sbin/ping/ping.c +++ b/sbin/ping/ping.c @@ -36,7 +36,7 @@ * @(#) Copyright (c) 1989, 1993 The Regents of the University of California. All rights reserved. * @(#)ping.c 8.1 (Berkeley) 6/5/93 * $FreeBSD: src/sbin/ping/ping.c,v 1.52.2.13 2002/10/29 10:23:21 maxim Exp $ - * $DragonFly: src/sbin/ping/ping.c,v 1.3 2003/09/28 14:39:20 hmp Exp $ + * $DragonFly: src/sbin/ping/ping.c,v 1.4 2004/12/18 21:43:39 swildner Exp $ */ /* @@ -403,7 +403,7 @@ main(int argc, char **argv) errx(1, "gethostbyname2: illegal address"); memcpy(&sin.sin_addr, hp->h_addr_list[0], sizeof(sin.sin_addr)); - (void)strncpy(snamebuf, hp->h_name, + strncpy(snamebuf, hp->h_name, sizeof(snamebuf) - 1); snamebuf[sizeof(snamebuf) - 1] = '\0'; shostname = snamebuf; @@ -427,7 +427,7 @@ main(int argc, char **argv) if (hp->h_length > sizeof(to->sin_addr)) errx(1, "gethostbyname2 returned an illegal address"); memcpy(&to->sin_addr, hp->h_addr_list[0], sizeof to->sin_addr); - (void)strncpy(hnamebuf, hp->h_name, sizeof(hnamebuf) - 1); + strncpy(hnamebuf, hp->h_name, sizeof(hnamebuf) - 1); hnamebuf[sizeof(hnamebuf) - 1] = '\0'; hostname = hnamebuf; } @@ -460,10 +460,10 @@ main(int argc, char **argv) } hold = 1; if (options & F_SO_DEBUG) - (void)setsockopt(s, SOL_SOCKET, SO_DEBUG, (char *)&hold, + setsockopt(s, SOL_SOCKET, SO_DEBUG, (char *)&hold, sizeof(hold)); if (options & F_SO_DONTROUTE) - (void)setsockopt(s, SOL_SOCKET, SO_DONTROUTE, (char *)&hold, + setsockopt(s, SOL_SOCKET, SO_DONTROUTE, (char *)&hold, sizeof(hold)); #ifdef IPSEC #ifdef IPSEC_POLICY_IPSEC @@ -555,22 +555,20 @@ main(int argc, char **argv) * as well. */ hold = IP_MAXPACKET + 128; - (void)setsockopt(s, SOL_SOCKET, SO_RCVBUF, (char *)&hold, - sizeof(hold)); + setsockopt(s, SOL_SOCKET, SO_RCVBUF, (char *)&hold, sizeof(hold)); if (!uid) { - (void)setsockopt(s, SOL_SOCKET, SO_SNDBUF, (char *)&hold, + setsockopt(s, SOL_SOCKET, SO_SNDBUF, (char *)&hold, sizeof(hold)); } if (to->sin_family == AF_INET) { - (void)printf("PING %s (%s)", hostname, - inet_ntoa(to->sin_addr)); + printf("PING %s (%s)", hostname, inet_ntoa(to->sin_addr)); if (source) - (void)printf(" from %s", shostname); - (void)printf(": %d data bytes\n", datalen); + printf(" from %s", shostname); + printf(": %d data bytes\n", datalen); } else - (void)printf("PING %s: %d data bytes\n", hostname, datalen); + printf("PING %s: %d data bytes\n", hostname, datalen); /* * Use sigaction() instead of signal() to get unambiguous semantics, @@ -620,7 +618,7 @@ main(int argc, char **argv) while (preload--) /* fire off them quickies */ pinger(); } - (void)gettimeofday(&last, NULL); + gettimeofday(&last, NULL); if (options & F_FLOOD) { intvl.tv_sec = 0; @@ -641,7 +639,7 @@ main(int argc, char **argv) errx(EX_OSERR, "descriptor too large"); FD_ZERO(&rfds); FD_SET(s, &rfds); - (void)gettimeofday(&now, NULL); + gettimeofday(&now, NULL); timeout.tv_sec = last.tv_sec + intvl.tv_sec - now.tv_sec; timeout.tv_usec = last.tv_usec + intvl.tv_usec - now.tv_usec; while (timeout.tv_usec < 0) { @@ -681,7 +679,7 @@ main(int argc, char **argv) } #endif if (t == 0) { - (void)gettimeofday(&now, NULL); + gettimeofday(&now, NULL); t = &now; } pr_pack((char *)packet, cc, &from, t); @@ -703,12 +701,12 @@ main(int argc, char **argv) } else intvl.tv_sec = MAXWAIT; } - (void)gettimeofday(&last, NULL); + gettimeofday(&last, NULL); if (ntransmitted - nreceived - 1 > nmissedmax) { nmissedmax = ntransmitted - nreceived - 1; if (options & F_MISSED) - (void)write(STDOUT_FILENO, &BBELL, 1); + write(STDOUT_FILENO, &BBELL, 1); } } } @@ -754,7 +752,7 @@ pinger(void) CLR(icp->icmp_seq % mx_dup_ck); if (timing) - (void)gettimeofday((struct timeval *)&outpack[MINICMPLEN], + gettimeofday((struct timeval *)&outpack[MINICMPLEN], (struct timezone *)NULL); cc = MINICMPLEN + datalen; @@ -779,7 +777,7 @@ pinger(void) } ntransmitted++; if (!(options & F_QUIET) && options & F_FLOOD) - (void)write(STDOUT_FILENO, &DOT, 1); + write(STDOUT_FILENO, &DOT, 1); } /* @@ -853,38 +851,38 @@ pr_pack(char *buf, int cc, struct sockaddr_in *from, struct timeval *tv) return; if (options & F_FLOOD) - (void)write(STDOUT_FILENO, &BSPACE, 1); + write(STDOUT_FILENO, &BSPACE, 1); else { - (void)printf("%d bytes from %s: icmp_seq=%u", cc, + printf("%d bytes from %s: icmp_seq=%u", cc, inet_ntoa(*(struct in_addr *)&from->sin_addr.s_addr), icp->icmp_seq); - (void)printf(" ttl=%d", ip->ip_ttl); + printf(" ttl=%d", ip->ip_ttl); if (timing) - (void)printf(" time=%.3f ms", triptime); + printf(" time=%.3f ms", triptime); if (dupflag) - (void)printf(" (DUP!)"); + printf(" (DUP!)"); if (options & F_AUDIBLE) - (void)write(STDOUT_FILENO, &BBELL, 1); + write(STDOUT_FILENO, &BBELL, 1); /* check the data */ cp = (u_char*)&icp->icmp_data[PHDR_LEN]; dp = &outpack[MINICMPLEN + PHDR_LEN]; for (i = PHDR_LEN; i < datalen; ++i, ++cp, ++dp) { if (*cp != *dp) { - (void)printf("\nwrong data byte #%d should be 0x%x but was 0x%x", + printf("\nwrong data byte #%d should be 0x%x but was 0x%x", i, *dp, *cp); - (void)printf("\ncp:"); + printf("\ncp:"); cp = (u_char*)&icp->icmp_data[0]; for (i = 0; i < datalen; ++i, ++cp) { if ((i % 32) == 8) - (void)printf("\n\t"); - (void)printf("%x ", *cp); + printf("\n\t"); + printf("%x ", *cp); } - (void)printf("\ndp:"); + printf("\ndp:"); cp = &outpack[MINICMPLEN]; for (i = 0; i < datalen; ++i, ++cp) { if ((i % 32) == 8) - (void)printf("\n\t"); - (void)printf("%x ", *cp); + printf("\n\t"); + printf("%x ", *cp); } break; } @@ -914,7 +912,7 @@ pr_pack(char *buf, int cc, struct sockaddr_in *from, struct timeval *tv) (oip->ip_p == IPPROTO_ICMP) && (oicmp->icmp_type == ICMP_ECHO) && (oicmp->icmp_id == ident))) { - (void)printf("%d bytes from %s: ", cc, + printf("%d bytes from %s: ", cc, pr_addr(from->sin_addr)); pr_icmph(icp); } else @@ -930,7 +928,7 @@ pr_pack(char *buf, int cc, struct sockaddr_in *from, struct timeval *tv) hlen = 0; break; case IPOPT_LSRR: - (void)printf("\nLSRR: "); + printf("\nLSRR: "); j = cp[IPOPT_OLEN] - IPOPT_MINOFF + 1; hlen -= 2; cp += 2; @@ -939,19 +937,18 @@ pr_pack(char *buf, int cc, struct sockaddr_in *from, struct timeval *tv) for (;;) { bcopy(++cp, &ina.s_addr, INADDR_LEN); if (ina.s_addr == 0) - (void)printf("\t0.0.0.0"); + printf("\t0.0.0.0"); else - (void)printf("\t%s", - pr_addr(ina)); + printf("\t%s", pr_addr(ina)); hlen -= INADDR_LEN; cp += INADDR_LEN - 1; j -= INADDR_LEN; if (j < INADDR_LEN) break; - (void)putchar('\n'); + putchar('\n'); } } else - (void)printf("\t(truncated route)\n"); + printf("\t(truncated route)\n"); break; case IPOPT_RR: j = cp[IPOPT_OLEN]; /* get length */ @@ -968,7 +965,7 @@ pr_pack(char *buf, int cc, struct sockaddr_in *from, struct timeval *tv) if (i == old_rrlen && !bcmp((char *)cp, old_rr, i) && !(options & F_FLOOD)) { - (void)printf("\t(same route)"); + printf("\t(same route)"); hlen -= i; cp += i; break; @@ -976,37 +973,36 @@ pr_pack(char *buf, int cc, struct sockaddr_in *from, struct timeval *tv) old_rrlen = i; bcopy((char *)cp, old_rr, i); - (void)printf("\nRR: "); + printf("\nRR: "); if (i >= INADDR_LEN && i <= hlen - (int)sizeof(struct ip)) { for (;;) { bcopy(++cp, &ina.s_addr, INADDR_LEN); if (ina.s_addr == 0) - (void)printf("\t0.0.0.0"); + printf("\t0.0.0.0"); else - (void)printf("\t%s", - pr_addr(ina)); + printf("\t%s", pr_addr(ina)); hlen -= INADDR_LEN; cp += INADDR_LEN - 1; i -= INADDR_LEN; if (i < INADDR_LEN) break; - (void)putchar('\n'); + putchar('\n'); } } else - (void)printf("\t(truncated route)"); + printf("\t(truncated route)"); break; case IPOPT_NOP: - (void)printf("\nNOP"); + printf("\nNOP"); break; default: - (void)printf("\nunknown option %x", *cp); + printf("\nunknown option %x", *cp); break; } if (!(options & F_FLOOD)) { - (void)putchar('\n'); - (void)fflush(stdout); + putchar('\n'); + fflush(stdout); } } @@ -1087,7 +1083,7 @@ check_status(void) if (siginfo_p) { siginfo_p = 0; - (void)fprintf(stderr, + fprintf(stderr, "\r%ld/%ld packets received (%.0f%%) %.3f min / %.3f avg / %.3f max\n", nreceived, ntransmitted, ntransmitted ? nreceived * 100.0 / ntransmitted : 0.0, @@ -1107,29 +1103,29 @@ finish(void) struct termios ts; - (void)signal(SIGINT, SIG_IGN); - (void)signal(SIGALRM, SIG_IGN); - (void)putchar('\n'); - (void)fflush(stdout); - (void)printf("--- %s ping statistics ---\n", hostname); - (void)printf("%ld packets transmitted, ", ntransmitted); - (void)printf("%ld packets received, ", nreceived); + signal(SIGINT, SIG_IGN); + signal(SIGALRM, SIG_IGN); + putchar('\n'); + fflush(stdout); + printf("--- %s ping statistics ---\n", hostname); + printf("%ld packets transmitted, ", ntransmitted); + printf("%ld packets received, ", nreceived); if (nrepeats) - (void)printf("+%ld duplicates, ", nrepeats); + printf("+%ld duplicates, ", nrepeats); if (ntransmitted) { if (nreceived > ntransmitted) - (void)printf("-- somebody's printing up packets!"); + printf("-- somebody's printing up packets!"); else - (void)printf("%d%% packet loss", + printf("%d%% packet loss", (int)(((ntransmitted - nreceived) * 100) / ntransmitted)); } - (void)putchar('\n'); + putchar('\n'); if (nreceived && timing) { double n = nreceived + nrepeats; double avg = tsum / n; double vari = tsumsq / n - avg * avg; - (void)printf( + printf( "round-trip min/avg/max/stddev = %.3f/%.3f/%.3f/%.3f ms\n", tmin, avg, tmax, sqrt(vari)); } @@ -1170,35 +1166,35 @@ pr_icmph(struct icmp *icp) switch(icp->icmp_type) { case ICMP_ECHOREPLY: - (void)printf("Echo Reply\n"); + printf("Echo Reply\n"); /* XXX ID + Seq + Data */ break; case ICMP_UNREACH: switch(icp->icmp_code) { case ICMP_UNREACH_NET: - (void)printf("Destination Net Unreachable\n"); + printf("Destination Net Unreachable\n"); break; case ICMP_UNREACH_HOST: - (void)printf("Destination Host Unreachable\n"); + printf("Destination Host Unreachable\n"); break; case ICMP_UNREACH_PROTOCOL: - (void)printf("Destination Protocol Unreachable\n"); + printf("Destination Protocol Unreachable\n"); break; case ICMP_UNREACH_PORT: - (void)printf("Destination Port Unreachable\n"); + printf("Destination Port Unreachable\n"); break; case ICMP_UNREACH_NEEDFRAG: - (void)printf("frag needed and DF set (MTU %d)\n", + printf("frag needed and DF set (MTU %d)\n", ntohs(icp->icmp_nextmtu)); break; case ICMP_UNREACH_SRCFAIL: - (void)printf("Source Route Failed\n"); + printf("Source Route Failed\n"); break; case ICMP_UNREACH_FILTER_PROHIB: - (void)printf("Communication prohibited by filter\n"); + printf("Communication prohibited by filter\n"); break; default: - (void)printf("Dest Unreachable, Bad Code: %d\n", + printf("Dest Unreachable, Bad Code: %d\n", icp->icmp_code); break; } @@ -1210,7 +1206,7 @@ pr_icmph(struct icmp *icp) #endif break; case ICMP_SOURCEQUENCH: - (void)printf("Source Quench\n"); + printf("Source Quench\n"); #ifndef icmp_data pr_retip(&icp->icmp_ip); #else @@ -1220,22 +1216,22 @@ pr_icmph(struct icmp *icp) case ICMP_REDIRECT: switch(icp->icmp_code) { case ICMP_REDIRECT_NET: - (void)printf("Redirect Network"); + printf("Redirect Network"); break; case ICMP_REDIRECT_HOST: - (void)printf("Redirect Host"); + printf("Redirect Host"); break; case ICMP_REDIRECT_TOSNET: - (void)printf("Redirect Type of Service and Network"); + printf("Redirect Type of Service and Network"); break; case ICMP_REDIRECT_TOSHOST: - (void)printf("Redirect Type of Service and Host"); + printf("Redirect Type of Service and Host"); break; default: - (void)printf("Redirect, Bad Code: %d", icp->icmp_code); + printf("Redirect, Bad Code: %d", icp->icmp_code); break; } - (void)printf("(New addr: %s)\n", inet_ntoa(icp->icmp_gwaddr)); + printf("(New addr: %s)\n", inet_ntoa(icp->icmp_gwaddr)); #ifndef icmp_data pr_retip(&icp->icmp_ip); #else @@ -1243,19 +1239,19 @@ pr_icmph(struct icmp *icp) #endif break; case ICMP_ECHO: - (void)printf("Echo Request\n"); + printf("Echo Request\n"); /* XXX ID + Seq + Data */ break; case ICMP_TIMXCEED: switch(icp->icmp_code) { case ICMP_TIMXCEED_INTRANS: - (void)printf("Time to live exceeded\n"); + printf("Time to live exceeded\n"); break; case ICMP_TIMXCEED_REASS: - (void)printf("Frag reassembly time exceeded\n"); + printf("Frag reassembly time exceeded\n"); break; default: - (void)printf("Time exceeded, Bad Code: %d\n", + printf("Time exceeded, Bad Code: %d\n", icp->icmp_code); break; } @@ -1266,7 +1262,7 @@ pr_icmph(struct icmp *icp) #endif break; case ICMP_PARAMPROB: - (void)printf("Parameter problem: pointer = 0x%02x\n", + printf("Parameter problem: pointer = 0x%02x\n", icp->icmp_hun.ih_pptr); #ifndef icmp_data pr_retip(&icp->icmp_ip); @@ -1275,35 +1271,35 @@ pr_icmph(struct icmp *icp) #endif break; case ICMP_TSTAMP: - (void)printf("Timestamp\n"); + printf("Timestamp\n"); /* XXX ID + Seq + 3 timestamps */ break; case ICMP_TSTAMPREPLY: - (void)printf("Timestamp Reply\n"); + printf("Timestamp Reply\n"); /* XXX ID + Seq + 3 timestamps */ break; case ICMP_IREQ: - (void)printf("Information Request\n"); + printf("Information Request\n"); /* XXX ID + Seq */ break; case ICMP_IREQREPLY: - (void)printf("Information Reply\n"); + printf("Information Reply\n"); /* XXX ID + Seq */ break; case ICMP_MASKREQ: - (void)printf("Address Mask Request\n"); + printf("Address Mask Request\n"); break; case ICMP_MASKREPLY: - (void)printf("Address Mask Reply\n"); + printf("Address Mask Reply\n"); break; case ICMP_ROUTERADVERT: - (void)printf("Router Advertisement\n"); + printf("Router Advertisement\n"); break; case ICMP_ROUTERSOLICIT: - (void)printf("Router Solicitation\n"); + printf("Router Solicitation\n"); break; default: - (void)printf("Bad ICMP type: %d\n", icp->icmp_type); + printf("Bad ICMP type: %d\n", icp->icmp_type); } } @@ -1320,22 +1316,21 @@ pr_iph(struct ip *ip) hlen = ip->ip_hl << 2; cp = (u_char *)ip + 20; /* point to options */ - (void)printf("Vr HL TOS Len ID Flg off TTL Pro cks Src Dst\n"); - (void)printf(" %1x %1x %02x %04x %04x", + printf("Vr HL TOS Len ID Flg off TTL Pro cks Src Dst\n"); + printf(" %1x %1x %02x %04x %04x", ip->ip_v, ip->ip_hl, ip->ip_tos, ntohs(ip->ip_len), ntohs(ip->ip_id)); - (void)printf(" %1lx %04lx", + printf(" %1lx %04lx", (u_long) (ntohl(ip->ip_off) & 0xe000) >> 13, (u_long) ntohl(ip->ip_off) & 0x1fff); - (void)printf(" %02x %02x %04x", ip->ip_ttl, ip->ip_p, - ntohs(ip->ip_sum)); - (void)printf(" %s ", inet_ntoa(*(struct in_addr *)&ip->ip_src.s_addr)); - (void)printf(" %s ", inet_ntoa(*(struct in_addr *)&ip->ip_dst.s_addr)); + printf(" %02x %02x %04x", ip->ip_ttl, ip->ip_p, ntohs(ip->ip_sum)); + printf(" %s ", inet_ntoa(*(struct in_addr *)&ip->ip_src.s_addr)); + printf(" %s ", inet_ntoa(*(struct in_addr *)&ip->ip_dst.s_addr)); /* dump any option bytes */ while (hlen-- > 20) { - (void)printf("%02x", *cp++); + printf("%02x", *cp++); } - (void)putchar('\n'); + putchar('\n'); } /* @@ -1353,7 +1348,7 @@ pr_addr(struct in_addr ina) !(hp = gethostbyaddr((char *)&ina, 4, AF_INET))) return inet_ntoa(ina); else - (void)snprintf(buf, sizeof(buf), "%s (%s)", hp->h_name, + snprintf(buf, sizeof(buf), "%s (%s)", hp->h_name, inet_ntoa(ina)); return(buf); } @@ -1373,10 +1368,10 @@ pr_retip(struct ip *ip) cp = (u_char *)ip + hlen; if (ip->ip_p == 6) - (void)printf("TCP: from port %u, to port %u (decimal)\n", + printf("TCP: from port %u, to port %u (decimal)\n", (*cp * 256 + *(cp + 1)), (*(cp + 2) * 256 + *(cp + 3))); else if (ip->ip_p == 17) - (void)printf("UDP: from port %u, to port %u (decimal)\n", + printf("UDP: from port %u, to port %u (decimal)\n", (*cp * 256 + *(cp + 1)), (*(cp + 2) * 256 + *(cp + 3))); } @@ -1404,17 +1399,17 @@ fill(char *bp, char *patp) for (jj = 0; jj < ii; ++jj) bp[jj + kk] = pat[jj]; if (!(options & F_QUIET)) { - (void)printf("PATTERN: 0x"); + printf("PATTERN: 0x"); for (jj = 0; jj < ii; ++jj) - (void)printf("%02x", bp[jj] & 0xFF); - (void)printf("\n"); + printf("%02x", bp[jj] & 0xFF); + printf("\n"); } } static void usage(void) { - (void)fprintf(stderr, "%s\n%s\n%s\n", + fprintf(stderr, "%s\n%s\n%s\n", "usage: ping [-AQRadfnqrv] [-c count] [-i wait] [-l preload] [-m ttl]", " [-p pattern] " #ifdef IPSEC diff --git a/sbin/ping6/ping6.c b/sbin/ping6/ping6.c index f2a5551430..6cc5698448 100644 --- a/sbin/ping6/ping6.c +++ b/sbin/ping6/ping6.c @@ -31,7 +31,7 @@ * @(#) Copyright (c) 1989, 1993 The Regents of the University of California. All rights reserved. * @(#)ping.c 8.1 (Berkeley) 6/5/93 * $FreeBSD: src/sbin/ping6/ping6.c,v 1.4.2.10 2002/12/09 03:04:44 suz Exp $ - * $DragonFly: src/sbin/ping6/ping6.c,v 1.6 2004/02/04 17:40:01 joerg Exp $ + * $DragonFly: src/sbin/ping6/ping6.c,v 1.7 2004/12/18 21:43:39 swildner Exp $ */ /* BSDI ping.c,v 2.3 1996/01/21 17:56:50 jch Exp */ @@ -573,7 +573,7 @@ main(int argc, char **argv) if (!res->ai_addr) errx(1, "getaddrinfo failed"); - (void)memcpy(&dst, res->ai_addr, res->ai_addrlen); + memcpy(&dst, res->ai_addr, res->ai_addrlen); if ((s = socket(res->ai_family, res->ai_socktype, res->ai_protocol)) < 0) @@ -658,7 +658,7 @@ main(int argc, char **argv) hold = 1; if (options & F_SO_DEBUG) - (void)setsockopt(s, SOL_SOCKET, SO_DEBUG, (char *)&hold, + setsockopt(s, SOL_SOCKET, SO_DEBUG, (char *)&hold, sizeof(hold)); optval = IPV6_DEFHLIM; if (IN6_IS_ADDR_MULTICAST(&dst.sin6_addr)) @@ -968,18 +968,18 @@ main(int argc, char **argv) printf("%s\n", pr_addr((struct sockaddr *)&dst, sizeof(dst))); while (preload--) /* Fire off them quickies. */ - (void)pinger(); + pinger(); - (void)signal(SIGINT, onsignal); + signal(SIGINT, onsignal); #ifdef SIGINFO - (void)signal(SIGINFO, onsignal); + signal(SIGINFO, onsignal); #endif if ((options & F_FLOOD) == 0) { - (void)signal(SIGALRM, onsignal); + signal(SIGALRM, onsignal); itimer.it_interval = interval; itimer.it_value = interval; - (void)setitimer(ITIMER_REAL, &itimer, NULL); + setitimer(ITIMER_REAL, &itimer, NULL); if (ntransmitted == 0) retransmit(); } @@ -1019,7 +1019,7 @@ main(int argc, char **argv) #endif if (options & F_FLOOD) { - (void)pinger(); + pinger(); timeout.tv_sec = 0; timeout.tv_usec = 10000; tv = &timeout; @@ -1132,8 +1132,8 @@ retransmit(void) itimer.it_interval.tv_usec = 0; itimer.it_value.tv_usec = 0; - (void)signal(SIGALRM, onint); - (void)setitimer(ITIMER_REAL, &itimer, NULL); + signal(SIGALRM, onint); + setitimer(ITIMER_REAL, &itimer, NULL); } /* @@ -1241,7 +1241,7 @@ pinger(void) icp->icmp6_id = htons(ident); icp->icmp6_seq = ntohs(seq); if (timing) - (void)gettimeofday((struct timeval *) + gettimeofday((struct timeval *) &outpack[ICMP6ECHOLEN], NULL); cc = ICMP6ECHOLEN + datalen; } @@ -1264,11 +1264,10 @@ pinger(void) if (i < 0 || i != cc) { if (i < 0) warn("sendmsg"); - (void)printf("ping6: wrote %s %d chars, ret=%d\n", - hostname, cc, i); + printf("ping6: wrote %s %d chars, ret=%d\n", hostname, cc, i); } if (!(options & F_QUIET) && options & F_FLOOD) - (void)write(STDOUT_FILENO, &DOT, 1); + write(STDOUT_FILENO, &DOT, 1); return(0); } @@ -1379,7 +1378,7 @@ pr_pack(u_char *buf, int cc, struct msghdr *mhdr) u_int16_t seq; char dnsname[MAXDNAME + 1]; - (void)gettimeofday(&tv, NULL); + gettimeofday(&tv, NULL); if (!mhdr || !mhdr->msg_name || mhdr->msg_namelen != sizeof(struct sockaddr_in6) || @@ -1440,11 +1439,11 @@ pr_pack(u_char *buf, int cc, struct msghdr *mhdr) return; if (options & F_FLOOD) - (void)write(STDOUT_FILENO, &BSPACE, 1); + write(STDOUT_FILENO, &BSPACE, 1); else { - (void)printf("%d bytes from %s, icmp_seq=%u", cc, + printf("%d bytes from %s, icmp_seq=%u", cc, pr_addr(from, fromlen), seq); - (void)printf(" hlim=%d", hoplim); + printf(" hlim=%d", hoplim); if ((options & F_VERBOSE) != 0) { struct sockaddr_in6 dstsa; @@ -1455,20 +1454,20 @@ pr_pack(u_char *buf, int cc, struct msghdr *mhdr) #endif dstsa.sin6_scope_id = pktinfo->ipi6_ifindex; dstsa.sin6_addr = pktinfo->ipi6_addr; - (void)printf(" dst=%s", + printf(" dst=%s", pr_addr((struct sockaddr *)&dstsa, sizeof(dstsa))); } if (timing) - (void)printf(" time=%g ms", triptime); + printf(" time=%g ms", triptime); if (dupflag) - (void)printf("(DUP!)"); + printf("(DUP!)"); /* check the data */ cp = buf + off + ICMP6ECHOLEN + ICMP6ECHOTMLEN; dp = outpack + ICMP6ECHOLEN + ICMP6ECHOTMLEN; for (i = 8; cp < end; ++i, ++cp, ++dp) { if (*cp != *dp) { - (void)printf("\nwrong data byte #%d should be 0x%x but was 0x%x", i, *dp, *cp); + printf("\nwrong data byte #%d should be 0x%x but was 0x%x", i, *dp, *cp); break; } } @@ -1488,7 +1487,7 @@ pr_pack(u_char *buf, int cc, struct msghdr *mhdr) if (options & F_QUIET) return; - (void)printf("%d bytes from %s: ", cc, pr_addr(from, fromlen)); + printf("%d bytes from %s: ", cc, pr_addr(from, fromlen)); switch (ntohs(ni->ni_code)) { case ICMP6_NI_SUCCESS: @@ -1555,15 +1554,15 @@ pr_pack(u_char *buf, int cc, struct msghdr *mhdr) int32_t ttl; int comma = 0; - (void)printf(" ("); /*)*/ + printf(" ("); /*)*/ switch (ni->ni_code) { case ICMP6_NI_REFUSED: - (void)printf("refused"); + printf("refused"); comma++; break; case ICMP6_NI_UNKNOWN: - (void)printf("unknwon qtype"); + printf("unknwon qtype"); comma++; break; } @@ -1578,14 +1577,12 @@ pr_pack(u_char *buf, int cc, struct msghdr *mhdr) if (comma) printf(","); if (!(ni->ni_flags & NI_FQDN_FLAG_VALIDTTL)) { - (void)printf("TTL=%d:meaningless", - (int)ttl); + printf("TTL=%d:meaningless", (int)ttl); } else { if (ttl < 0) { - (void)printf("TTL=%d:invalid", - ttl); + printf("TTL=%d:invalid", ttl); } else - (void)printf("TTL=%d", ttl); + printf("TTL=%d", ttl); } comma++; @@ -1608,7 +1605,7 @@ pr_pack(u_char *buf, int cc, struct msghdr *mhdr) cc - off - ICMP6_NIRLEN - 1 && oldfqdn) { if (comma) printf(","); - (void)printf("invalid namelen:%d/%lu", + printf("invalid namelen:%d/%lu", buf[off + ICMP6_NIRLEN], (u_long)cc - off - ICMP6_NIRLEN - 1); comma++; @@ -1623,15 +1620,15 @@ pr_pack(u_char *buf, int cc, struct msghdr *mhdr) /* We've got something other than an ECHOREPLY */ if (!(options & F_VERBOSE)) return; - (void)printf("%d bytes from %s: ", cc, pr_addr(from, fromlen)); + printf("%d bytes from %s: ", cc, pr_addr(from, fromlen)); pr_icmph(icp, end); } if (!(options & F_FLOOD)) { - (void)putchar('\n'); + putchar('\n'); if (options & F_VERBOSE) pr_exthdrs(mhdr); - (void)fflush(stdout); + fflush(stdout); } #undef safeputc } @@ -1896,14 +1893,14 @@ pr_nodeaddr(struct icmp6_nodeinfo *ni, int nilen) if (options & F_VERBOSE) { switch (ni->ni_code) { case ICMP6_NI_REFUSED: - (void)printf("refused"); + printf("refused"); break; case ICMP6_NI_UNKNOWN: - (void)printf("unknown qtype"); + printf("unknown qtype"); break; } if (ni->ni_flags & NI_NODEADDR_FLAG_TRUNCATE) - (void)printf(" truncated"); + printf(" truncated"); } putchar('\n'); if (nilen <= 0) @@ -2118,8 +2115,8 @@ tvsub(register struct timeval *out, register struct timeval *in) void onint(int notused) { - (void)signal(SIGINT, SIG_IGN); - (void)signal(SIGALRM, SIG_IGN); + signal(SIGINT, SIG_IGN); + signal(SIGALRM, SIG_IGN); summary(); @@ -2134,37 +2131,37 @@ void summary(void) { - (void)printf("\n--- %s ping6 statistics ---\n", hostname); - (void)printf("%ld packets transmitted, ", ntransmitted); - (void)printf("%ld packets received, ", nreceived); + printf("\n--- %s ping6 statistics ---\n", hostname); + printf("%ld packets transmitted, ", ntransmitted); + printf("%ld packets received, ", nreceived); if (nrepeats) - (void)printf("+%ld duplicates, ", nrepeats); + printf("+%ld duplicates, ", nrepeats); if (ntransmitted) { if (nreceived > ntransmitted) - (void)printf("-- somebody's printing up packets!"); + printf("-- somebody's printing up packets!"); else - (void)printf("%d%% packet loss", + printf("%d%% packet loss", (int) (((ntransmitted - nreceived) * 100) / ntransmitted)); } - (void)putchar('\n'); + putchar('\n'); if (nreceived && timing) { /* Only display average to microseconds */ double num = nreceived + nrepeats; double avg = tsum / num; #if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) double dev = sqrt(tsumsq / num - avg * avg); - (void)printf( + printf( "round-trip min/avg/max/std-dev = %.3f/%.3f/%.3f/%.3f ms\n", tmin, avg, tmax, dev); #else - (void)printf( + printf( "round-trip min/avg/max = %.3f/%.3f/%.3f ms\n", tmin, avg, tmax); #endif - (void)fflush(stdout); + fflush(stdout); } - (void)fflush(stdout); + fflush(stdout); } /*subject type*/ @@ -2198,23 +2195,22 @@ pr_icmph(struct icmp6_hdr *icp, u_char *end) case ICMP6_DST_UNREACH: switch (icp->icmp6_code) { case ICMP6_DST_UNREACH_NOROUTE: - (void)printf("No Route to Destination\n"); + printf("No Route to Destination\n"); break; case ICMP6_DST_UNREACH_ADMIN: - (void)printf("Destination Administratively " - "Unreachable\n"); + printf("Destination Administratively Unreachable\n"); break; case ICMP6_DST_UNREACH_BEYONDSCOPE: - (void)printf("Destination Unreachable Beyond Scope\n"); + printf("Destination Unreachable Beyond Scope\n"); break; case ICMP6_DST_UNREACH_ADDR: - (void)printf("Destination Host Unreachable\n"); + printf("Destination Host Unreachable\n"); break; case ICMP6_DST_UNREACH_NOPORT: - (void)printf("Destination Port Unreachable\n"); + printf("Destination Port Unreachable\n"); break; default: - (void)printf("Destination Unreachable, Bad Code: %d\n", + printf("Destination Unreachable, Bad Code: %d\n", icp->icmp6_code); break; } @@ -2222,110 +2218,109 @@ pr_icmph(struct icmp6_hdr *icp, u_char *end) pr_retip((struct ip6_hdr *)(icp + 1), end); break; case ICMP6_PACKET_TOO_BIG: - (void)printf("Packet too big mtu = %d\n", + printf("Packet too big mtu = %d\n", (int)ntohl(icp->icmp6_mtu)); pr_retip((struct ip6_hdr *)(icp + 1), end); break; case ICMP6_TIME_EXCEEDED: switch (icp->icmp6_code) { case ICMP6_TIME_EXCEED_TRANSIT: - (void)printf("Time to live exceeded\n"); + printf("Time to live exceeded\n"); break; case ICMP6_TIME_EXCEED_REASSEMBLY: - (void)printf("Frag reassembly time exceeded\n"); + printf("Frag reassembly time exceeded\n"); break; default: - (void)printf("Time exceeded, Bad Code: %d\n", + printf("Time exceeded, Bad Code: %d\n", icp->icmp6_code); break; } pr_retip((struct ip6_hdr *)(icp + 1), end); break; case ICMP6_PARAM_PROB: - (void)printf("Parameter problem: "); + printf("Parameter problem: "); switch (icp->icmp6_code) { case ICMP6_PARAMPROB_HEADER: - (void)printf("Erroneous Header "); + printf("Erroneous Header "); break; case ICMP6_PARAMPROB_NEXTHEADER: - (void)printf("Unknown Nextheader "); + printf("Unknown Nextheader "); break; case ICMP6_PARAMPROB_OPTION: - (void)printf("Unrecognized Option "); + printf("Unrecognized Option "); break; default: - (void)printf("Bad code(%d) ", icp->icmp6_code); + printf("Bad code(%d) ", icp->icmp6_code); break; } - (void)printf("pointer = 0x%02x\n", - (u_int32_t)ntohl(icp->icmp6_pptr)); + printf("pointer = 0x%02x\n", (u_int32_t)ntohl(icp->icmp6_pptr)); pr_retip((struct ip6_hdr *)(icp + 1), end); break; case ICMP6_ECHO_REQUEST: - (void)printf("Echo Request"); + printf("Echo Request"); /* XXX ID + Seq + Data */ break; case ICMP6_ECHO_REPLY: - (void)printf("Echo Reply"); + printf("Echo Reply"); /* XXX ID + Seq + Data */ break; case ICMP6_MEMBERSHIP_QUERY: - (void)printf("Listener Query"); + printf("Listener Query"); break; case ICMP6_MEMBERSHIP_REPORT: - (void)printf("Listener Report"); + printf("Listener Report"); break; case ICMP6_MEMBERSHIP_REDUCTION: - (void)printf("Listener Done"); + printf("Listener Done"); break; case ND_ROUTER_SOLICIT: - (void)printf("Router Solicitation"); + printf("Router Solicitation"); break; case ND_ROUTER_ADVERT: - (void)printf("Router Advertisement"); + printf("Router Advertisement"); break; case ND_NEIGHBOR_SOLICIT: - (void)printf("Neighbor Solicitation"); + printf("Neighbor Solicitation"); break; case ND_NEIGHBOR_ADVERT: - (void)printf("Neighbor Advertisement"); + printf("Neighbor Advertisement"); break; case ND_REDIRECT: red = (struct nd_redirect *)icp; - (void)printf("Redirect\n"); + printf("Redirect\n"); if (!inet_ntop(AF_INET6, &red->nd_rd_dst, ntop_buf, sizeof(ntop_buf))) strncpy(ntop_buf, "?", sizeof(ntop_buf)); - (void)printf("Destination: %s", ntop_buf); + printf("Destination: %s", ntop_buf); if (!inet_ntop(AF_INET6, &red->nd_rd_target, ntop_buf, sizeof(ntop_buf))) strncpy(ntop_buf, "?", sizeof(ntop_buf)); - (void)printf(" New Target: %s", ntop_buf); + printf(" New Target: %s", ntop_buf); break; case ICMP6_NI_QUERY: - (void)printf("Node Information Query"); + printf("Node Information Query"); /* XXX ID + Seq + Data */ ni = (struct icmp6_nodeinfo *)icp; l = end - (u_char *)(ni + 1); printf(", "); switch (ntohs(ni->ni_qtype)) { case NI_QTYPE_NOOP: - (void)printf("NOOP"); + printf("NOOP"); break; case NI_QTYPE_SUPTYPES: - (void)printf("Supported qtypes"); + printf("Supported qtypes"); break; case NI_QTYPE_FQDN: - (void)printf("DNS name"); + printf("DNS name"); break; case NI_QTYPE_NODEADDR: - (void)printf("nodeaddr"); + printf("nodeaddr"); break; case NI_QTYPE_IPV4ADDR: - (void)printf("IPv4 nodeaddr"); + printf("IPv4 nodeaddr"); break; default: - (void)printf("unknown qtype"); + printf("unknown qtype"); break; } if (options & F_VERBOSE) { @@ -2334,20 +2329,20 @@ pr_icmph(struct icmp6_hdr *icp, u_char *end) if (l == sizeof(struct in6_addr) && inet_ntop(AF_INET6, ni + 1, ntop_buf, sizeof(ntop_buf)) != NULL) { - (void)printf(", subject=%s(%s)", + printf(", subject=%s(%s)", niqcode[ni->ni_code], ntop_buf); } else { #if 1 /* backward compat to -W */ - (void)printf(", oldfqdn"); + printf(", oldfqdn"); #else - (void)printf(", invalid"); + printf(", invalid"); #endif } break; case ICMP6_NI_SUBJ_FQDN: if (end == (u_char *)(ni + 1)) { - (void)printf(", no subject"); + printf(", no subject"); break; } printf(", subject=%s", niqcode[ni->ni_code]); @@ -2362,40 +2357,40 @@ pr_icmph(struct icmp6_hdr *icp, u_char *end) if (l == sizeof(struct in_addr) && inet_ntop(AF_INET, ni + 1, ntop_buf, sizeof(ntop_buf)) != NULL) { - (void)printf(", subject=%s(%s)", + printf(", subject=%s(%s)", niqcode[ni->ni_code], ntop_buf); } else - (void)printf(", invalid"); + printf(", invalid"); break; default: - (void)printf(", invalid"); + printf(", invalid"); break; } } break; case ICMP6_NI_REPLY: - (void)printf("Node Information Reply"); + printf("Node Information Reply"); /* XXX ID + Seq + Data */ ni = (struct icmp6_nodeinfo *)icp; printf(", "); switch (ntohs(ni->ni_qtype)) { case NI_QTYPE_NOOP: - (void)printf("NOOP"); + printf("NOOP"); break; case NI_QTYPE_SUPTYPES: - (void)printf("Supported qtypes"); + printf("Supported qtypes"); break; case NI_QTYPE_FQDN: - (void)printf("DNS name"); + printf("DNS name"); break; case NI_QTYPE_NODEADDR: - (void)printf("nodeaddr"); + printf("nodeaddr"); break; case NI_QTYPE_IPV4ADDR: - (void)printf("IPv4 nodeaddr"); + printf("IPv4 nodeaddr"); break; default: - (void)printf("unknown qtype"); + printf("unknown qtype"); break; } if (options & F_VERBOSE) { @@ -2406,7 +2401,7 @@ pr_icmph(struct icmp6_hdr *icp, u_char *end) } break; default: - (void)printf("Bad ICMP type: %d", icp->icmp6_type); + printf("Bad ICMP type: %d", icp->icmp6_type); } } @@ -2570,10 +2565,10 @@ fill(char *bp, char *patp) for (jj = 0; jj < ii; ++jj) bp[jj + kk] = pat[jj]; if (!(options & F_QUIET)) { - (void)printf("PATTERN: 0x"); + printf("PATTERN: 0x"); for (jj = 0; jj < ii; ++jj) - (void)printf("%02x", bp[jj] & 0xFF); - (void)printf("\n"); + printf("%02x", bp[jj] & 0xFF); + printf("\n"); } } @@ -2647,7 +2642,7 @@ nigroup(char *name) void usage(void) { - (void)fprintf(stderr, + fprintf(stderr, "usage: ping6 [-dfH" #ifdef IPV6_USE_MIN_MTU "m" diff --git a/sbin/quotacheck/quotacheck.c b/sbin/quotacheck/quotacheck.c index e594be3937..11c931e5a7 100644 --- a/sbin/quotacheck/quotacheck.c +++ b/sbin/quotacheck/quotacheck.c @@ -36,7 +36,7 @@ * @(#) Copyright (c) 1980, 1990, 1993 The Regents of the University of California. All rights reserved. * @(#)quotacheck.c 8.3 (Berkeley) 1/29/94 * $FreeBSD: src/sbin/quotacheck/quotacheck.c,v 1.11 1999/08/28 00:14:01 peter Exp $ - * $DragonFly: src/sbin/quotacheck/quotacheck.c,v 1.6 2004/08/30 19:27:21 eirikn Exp $ + * $DragonFly: src/sbin/quotacheck/quotacheck.c,v 1.7 2004/12/18 21:43:40 swildner Exp $ */ /* @@ -162,13 +162,13 @@ main(int argc, char **argv) if (gflag) { setgrent(); while ((gr = getgrent()) != NULL) - (void) addid((u_long)gr->gr_gid, GRPQUOTA, gr->gr_name); + addid((u_long)gr->gr_gid, GRPQUOTA, gr->gr_name); endgrent(); } if (uflag) { setpwent(); while ((pw = getpwent()) != NULL) - (void) addid((u_long)pw->pw_uid, USRQUOTA, pw->pw_name); + addid((u_long)pw->pw_uid, USRQUOTA, pw->pw_name); endpwent(); } if (aflag) @@ -195,7 +195,7 @@ main(int argc, char **argv) void usage(void) { - (void)fprintf(stderr, "%s\n%s\n", + fprintf(stderr, "%s\n%s\n", "usage: quotacheck -a [-guv]", " quotacheck [-guv] filesys ..."); exit(1); @@ -243,13 +243,13 @@ chkquota(char *fsname, char *mntpt, register struct quotaname *qnp) return (1); } if (vflag) { - (void)printf("*** Checking "); + printf("*** Checking "); if (qnp->flags & HASUSR) - (void)printf("%s%s", qfextension[USRQUOTA], + printf("%s%s", qfextension[USRQUOTA], (qnp->flags & HASGRP) ? " and " : ""); if (qnp->flags & HASGRP) - (void)printf("%s", qfextension[GRPQUOTA]); - (void)printf(" quotas for %s (%s)\n", fsname, mntpt); + printf("%s", qfextension[GRPQUOTA]); + printf(" quotas for %s (%s)\n", fsname, mntpt); } sync(); dev_bsize = 1; @@ -313,8 +313,8 @@ update(char *fsname, char *quotafile, register int type) if (qfo) { warnx("creating quota file %s", quotafile); #define MODE (S_IRUSR|S_IWUSR|S_IRGRP) - (void) fchown(fileno(qfo), getuid(), getquotagid()); - (void) fchmod(fileno(qfo), MODE); + fchown(fileno(qfo), getuid(), getquotagid()); + fchmod(fileno(qfo), MODE); } else { warn("%s", quotafile); return (1); @@ -322,13 +322,13 @@ update(char *fsname, char *quotafile, register int type) } if ((qfi = fopen(quotafile, "r")) == NULL) { warn("%s", quotafile); - (void) fclose(qfo); + fclose(qfo); return (1); } if (quotactl(fsname, QCMD(Q_SYNC, type), (u_long)0, (caddr_t)0) < 0 && errno == EOPNOTSUPP && !warned && vflag) { warned++; - (void)printf("*** Warning: %s\n", + printf("*** Warning: %s\n", "Quotas are not compiled into this kernel"); } for (lastid = highid[type], id = 0, offset = 0; id <= lastid; @@ -348,14 +348,14 @@ update(char *fsname, char *quotafile, register int type) printf("%s: ", fsname); printf("%-8s fixed:", fup->fu_name); if (dqbuf.dqb_curinodes != fup->fu_curinodes) - (void)printf("\tinodes %lu -> %lu", + printf("\tinodes %lu -> %lu", (u_long)dqbuf.dqb_curinodes, (u_long)fup->fu_curinodes); if (dqbuf.dqb_curblocks != fup->fu_curblocks) - (void)printf("\tblocks %lu -> %lu", + printf("\tblocks %lu -> %lu", (u_long)dqbuf.dqb_curblocks, (u_long)fup->fu_curblocks); - (void)printf("\n"); + printf("\n"); } /* * Reset time limit if have a soft limit and were @@ -376,7 +376,7 @@ update(char *fsname, char *quotafile, register int type) return(1); } fwrite((char *)&dqbuf, sizeof(struct dqblk), 1, qfo); - (void) quotactl(fsname, QCMD(Q_SETUSE, type), id, + quotactl(fsname, QCMD(Q_SETUSE, type), id, (caddr_t)&dqbuf); fup->fu_curinodes = 0; fup->fu_curblocks = 0; @@ -428,9 +428,9 @@ hasquota(register struct fstab *fs, int type, char **qfnamep) static char buf[BUFSIZ]; if (!initname) { - (void)snprintf(usrname, sizeof(usrname), + snprintf(usrname, sizeof(usrname), "%s%s", qfextension[USRQUOTA], qfname); - (void)snprintf(grpname, sizeof(grpname), + snprintf(grpname, sizeof(grpname), "%s%s", qfextension[GRPQUOTA], qfname); initname = 1; } @@ -448,7 +448,7 @@ hasquota(register struct fstab *fs, int type, char **qfnamep) if (cp) *qfnamep = cp; else { - (void)snprintf(buf, sizeof(buf), + snprintf(buf, sizeof(buf), "%s/%s.%s", fs->fs_file, qfname, qfextension[type]); *qfnamep = buf; } @@ -497,7 +497,7 @@ addid(u_long id, int type, char *name) if (name) bcopy(name, fup->fu_name, len + 1); else { - (void)sprintf(fup->fu_name, "%lu", id); + sprintf(fup->fu_name, "%lu", id); if (vflag) printf("unknown %cid: %lu\n", type == USRQUOTA ? 'u' : 'g', id); diff --git a/sbin/rcorder/hash.c b/sbin/rcorder/hash.c index 910e2fe208..c28a420f5b 100644 --- a/sbin/rcorder/hash.c +++ b/sbin/rcorder/hash.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * $NetBSD: hash.c,v 1.1.1.1 1999/11/19 04:30:56 mrg Exp $ - * $DragonFly: src/sbin/rcorder/hash.c,v 1.4 2004/12/01 19:44:53 liamfoy Exp $ + * $DragonFly: src/sbin/rcorder/hash.c,v 1.5 2004/12/18 21:43:40 swildner Exp $ */ #ifdef MAKE_BOOTSTRAP @@ -263,7 +263,7 @@ Hash_CreateEntry(Hash_Table *t, char *key, Boolean *newPtr) *hp = e; e->clientData = NULL; e->namehash = h; - (void) strcpy(e->name, p); + strcpy(e->name, p); t->numEntries++; if (newPtr != NULL) @@ -304,7 +304,7 @@ Hash_DeleteEntry(Hash_Table *t, Hash_Entry *e) return; } } - (void)write(2, "bad call to Hash_DeleteEntry\n", 29); + write(2, "bad call to Hash_DeleteEntry\n", 29); abort(); } diff --git a/sbin/reboot/reboot.c b/sbin/reboot/reboot.c index 71bf496796..d91e9872eb 100644 --- a/sbin/reboot/reboot.c +++ b/sbin/reboot/reboot.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1980, 1986, 1993 The Regents of the University of California. All rights reserved. * @(#)reboot.c 8.1 (Berkeley) 6/5/93 * $FreeBSD: src/sbin/reboot/reboot.c,v 1.9.2.4 2002/04/28 22:50:00 wes Exp $ - * $DragonFly: src/sbin/reboot/reboot.c,v 1.4 2004/08/30 19:27:21 eirikn Exp $ + * $DragonFly: src/sbin/reboot/reboot.c,v 1.5 2004/12/18 21:43:40 swildner Exp $ */ #include @@ -116,9 +116,9 @@ main(int argc, char *argv[]) if (kflag) { fd = open("/boot/nextboot.conf", O_WRONLY | O_CREAT, 0444); if (fd > -1) { - (void)write(fd, "kernel=\"", 8L); - (void)write(fd, kernel, strlen(kernel)); - (void)write(fd, "\"\n", 2); + write(fd, "kernel=\"", 8L); + write(fd, kernel, strlen(kernel)); + write(fd, "\"\n", 2); close(fd); } } @@ -151,7 +151,7 @@ main(int argc, char *argv[]) err(1, "SIGTSTP init"); /* Ignore the SIGHUP we get when our parent shell dies. */ - (void)signal(SIGHUP, SIG_IGN); + signal(SIGHUP, SIG_IGN); /* Send a SIGTERM first, a chance to save the buffers. */ if (kill(-1, SIGTERM) == -1) @@ -181,11 +181,11 @@ main(int argc, char *argv[]) goto restart; } if (i > 5) { - (void)fprintf(stderr, + fprintf(stderr, "WARNING: some process(es) wouldn't die\n"); break; } - (void)sleep(2 * i); + sleep(2 * i); } reboot(howto); @@ -201,7 +201,7 @@ restart: void usage(void) { - (void)fprintf(stderr, "usage: %s [-dnpq] [-k kernel]\n", + fprintf(stderr, "usage: %s [-dnpq] [-k kernel]\n", dohalt ? "halt" : "reboot"); exit(1); } diff --git a/sbin/restore/dirs.c b/sbin/restore/dirs.c index 438e52b65c..8eac115d56 100644 --- a/sbin/restore/dirs.c +++ b/sbin/restore/dirs.c @@ -37,7 +37,7 @@ * * @(#)dirs.c 8.7 (Berkeley) 5/1/95 * $FreeBSD: src/sbin/restore/dirs.c,v 1.14.2.5 2001/10/15 13:44:45 dd Exp $ - * $DragonFly: src/sbin/restore/dirs.c,v 1.6 2004/02/04 17:40:01 joerg Exp $ + * $DragonFly: src/sbin/restore/dirs.c,v 1.7 2004/12/18 21:43:40 swildner Exp $ */ #include @@ -175,20 +175,20 @@ extractdirs(int genmode) nulldir.d_ino = 0; nulldir.d_type = DT_DIR; nulldir.d_namlen = 1; - (void) strcpy(nulldir.d_name, "/"); + strcpy(nulldir.d_name, "/"); nulldir.d_reclen = DIRSIZ(0, &nulldir); for (;;) { curfile.name = ""; curfile.action = USING; ip = curfile.dip; if (ip == NULL || (ip->di_mode & IFMT) != IFDIR) { - (void) fclose(df); + fclose(df); dirp = opendirfile(dirfile); if (dirp == NULL) fprintf(stderr, "opendirfile: %s\n", strerror(errno)); if (mf != NULL) - (void) fclose(mf); + fclose(mf); i = dirlookup(dot); if (i == 0) panic("Root directory is not on tape\n"); @@ -232,7 +232,7 @@ treescan(char *pname, ino_t ino, long (*todo) (char *, ino_t, int)) /* * Pname is name of a simple file or an unchanged directory. */ - (void) (*todo)(pname, ino, LEAF); + (*todo)(pname, ino, LEAF); return; } /* @@ -244,9 +244,9 @@ treescan(char *pname, ino_t ino, long (*todo) (char *, ino_t, int)) * begin search through the directory * skipping over "." and ".." */ - (void) strncpy(locname, pname, sizeof(locname) - 1); + strncpy(locname, pname, sizeof(locname) - 1); locname[sizeof(locname) - 1] = '\0'; - (void) strncat(locname, "/", sizeof(locname) - strlen(locname)); + strncat(locname, "/", sizeof(locname) - strlen(locname)); namelen = strlen(locname); rst_seekdir(dirp, itp->t_seekpt, itp->t_seekpt); dp = rst_readdir(dirp); /* "." */ @@ -270,7 +270,7 @@ treescan(char *pname, ino_t ino, long (*todo) (char *, ino_t, int)) fprintf(stderr, "%s%s: name exceeds %d char\n", locname, dp->d_name, sizeof(locname) - 1); } else { - (void) strncat(locname, dp->d_name, (int)dp->d_namlen); + strncat(locname, dp->d_name, (int)dp->d_namlen); treescan(locname, dp->d_ino, todo); rst_seekdir(dirp, bpt, itp->t_seekpt); } @@ -407,7 +407,7 @@ putent(struct direct *dp) if (dirloc + dp->d_reclen > DIRBLKSIZ) { ((struct direct *)(dirbuf + prev))->d_reclen = DIRBLKSIZ - prev; - (void) fwrite(dirbuf, 1, DIRBLKSIZ, df); + fwrite(dirbuf, 1, DIRBLKSIZ, df); dirloc = 0; } memmove(dirbuf + dirloc, dp, (long)dp->d_reclen); @@ -422,7 +422,7 @@ static void flushent(void) { ((struct direct *)(dirbuf + prev))->d_reclen = DIRBLKSIZ - prev; - (void) fwrite(dirbuf, (int)dirloc, 1, df); + fwrite(dirbuf, (int)dirloc, 1, df); seekpt = ftell(df); dirloc = 0; } @@ -434,7 +434,7 @@ dcvt(register struct odirect *odp, register struct direct *ndp) memset(ndp, 0, (long)(sizeof *ndp)); ndp->d_ino = odp->d_ino; ndp->d_type = DT_UNKNOWN; - (void) strncpy(ndp->d_name, odp->d_name, ODIRSIZ); + strncpy(ndp->d_name, odp->d_name, ODIRSIZ); ndp->d_namlen = strlen(ndp->d_name); ndp->d_reclen = DIRSIZ(0, ndp); } @@ -455,7 +455,7 @@ rst_seekdir(register RST_DIR *dirp, long loc, long base) loc -= base; if (loc < 0) fprintf(stderr, "bad seek pointer to rst_seekdir %ld\n", loc); - (void) lseek(dirp->dd_fd, base + (loc & ~(DIRBLKSIZ - 1)), SEEK_SET); + lseek(dirp->dd_fd, base + (loc & ~(DIRBLKSIZ - 1)), SEEK_SET); dirp->dd_loc = loc & (DIRBLKSIZ - 1); if (dirp->dd_loc != 0) dirp->dd_size = read(dirp->dd_fd, dirp->dd_buf, DIRBLKSIZ); @@ -527,7 +527,7 @@ void rst_closedir(RST_DIR *dirp) { - (void)close(dirp->dd_fd); + close(dirp->dd_fd); free(dirp); return; } @@ -554,7 +554,7 @@ opendirfile(const char *name) if ((fd = open(name, O_RDONLY)) == -1) return (NULL); if ((dirp = malloc(sizeof(RST_DIR))) == NULL) { - (void)close(fd); + close(fd); return (NULL); } dirp->dd_fd = fd; @@ -593,7 +593,7 @@ setdirmodes(int flags) } clearerr(mf); for (;;) { - (void) fread((char *)&node, 1, sizeof(struct modeinfo), mf); + fread((char *)&node, 1, sizeof(struct modeinfo), mf); if (feof(mf)) break; ep = lookupino(node.ino); @@ -613,17 +613,17 @@ setdirmodes(int flags) } else { cp = myname(ep); if (!Nflag) { - (void) chown(cp, node.uid, node.gid); - (void) chmod(cp, node.mode); + chown(cp, node.uid, node.gid); + chmod(cp, node.mode); utimes(cp, node.timep); - (void) chflags(cp, node.flags); + chflags(cp, node.flags); } ep->e_flags &= ~NEW; } } if (ferror(mf)) panic("error setting directory modes\n"); - (void) fclose(mf); + fclose(mf); } /* @@ -641,7 +641,7 @@ genliteraldir(char *name, ino_t ino) panic("Cannot find directory inode %d named %s\n", ino, name); if ((ofile = open(name, O_WRONLY | O_CREAT | O_TRUNC, 0666)) < 0) { fprintf(stderr, "%s: ", name); - (void) fflush(stderr); + fflush(stderr); fprintf(stderr, "cannot create file: %s\n", strerror(errno)); return (FAIL); } @@ -664,8 +664,8 @@ genliteraldir(char *name, ino_t ino) done(1); } } - (void) close(dp); - (void) close(ofile); + close(dp); + close(ofile); return (GOOD); } @@ -711,7 +711,7 @@ allocinotab(ino_t ino, struct dinode *dip, long seekpt) node.flags = dip->di_flags; node.uid = dip->di_uid; node.gid = dip->di_gid; - (void) fwrite((char *)&node, 1, sizeof(struct modeinfo), mf); + fwrite((char *)&node, 1, sizeof(struct modeinfo), mf); return (itp); } @@ -738,8 +738,8 @@ done(int exitcode) closemt(); if (modefile[0] != '#') - (void) unlink(modefile); + unlink(modefile); if (dirfile[0] != '#') - (void) unlink(dirfile); + unlink(dirfile); exit(exitcode); } diff --git a/sbin/restore/interactive.c b/sbin/restore/interactive.c index 14d3d46cf4..f91be84c84 100644 --- a/sbin/restore/interactive.c +++ b/sbin/restore/interactive.c @@ -32,7 +32,7 @@ * * @(#)interactive.c 8.5 (Berkeley) 5/1/95 * $FreeBSD: src/sbin/restore/interactive.c,v 1.8.2.1 2001/01/03 14:36:08 iedowse Exp $ - * $DragonFly: src/sbin/restore/interactive.c,v 1.6 2004/02/04 17:40:01 joerg Exp $ + * $DragonFly: src/sbin/restore/interactive.c,v 1.7 2004/12/18 21:43:40 swildner Exp $ */ #include @@ -147,7 +147,7 @@ loop: fprintf(stderr, "%s: not a directory\n", name); break; } - (void) strcpy(curdir, name); + strcpy(curdir, name); break; /* * Delete elements from the extraction list. @@ -317,7 +317,7 @@ getcmd(char *curdir, char *cmd, char *name, int size, struct arglist *ap) */ do { fprintf(stderr, "restore > "); - (void) fflush(stderr); + fflush(stderr); if (fgets(input, BUFSIZ, terminal) == NULL) { strcpy(cmd, "quit"); return; @@ -335,7 +335,7 @@ getcmd(char *curdir, char *cmd, char *name, int size, struct arglist *ap) * If no argument, use curdir as the default. */ if (*cp == '\0') { - (void) strncpy(name, curdir, size); + strncpy(name, curdir, size); name[size - 1] = '\0'; return; } @@ -437,17 +437,17 @@ canon(char *rawname, char *canonname, int len) register char *cp, *np; if (strcmp(rawname, ".") == 0 || strncmp(rawname, "./", 2) == 0) - (void) strcpy(canonname, ""); + strcpy(canonname, ""); else if (rawname[0] == '/') - (void) strcpy(canonname, "."); + strcpy(canonname, "."); else - (void) strcpy(canonname, "./"); + strcpy(canonname, "./"); if (strlen(canonname) + strlen(rawname) >= len) { fprintf(stderr, "canonname: not enough buffer space\n"); done(1); } - (void) strcat(canonname, rawname); + strcat(canonname, rawname); /* * Eliminate multiple and trailing '/'s */ @@ -469,14 +469,14 @@ canon(char *rawname, char *canonname, int len) np++; if (np - cp == 1 && *cp == '.') { cp--; - (void) strcpy(cp, np); + strcpy(cp, np); np = cp; } if (np - cp == 2 && strncmp(cp, "..", 2) == 0) { cp--; while (cp > &canonname[1] && *--cp != '/') /* find beginning of name */; - (void) strcpy(cp, np); + strcpy(cp, np); np = cp; } } @@ -524,8 +524,8 @@ printlist(char *name, char *basename) fprintf(stderr, "%s:\n", name); entries = 0; listp = list; - (void) strncpy(locname, name, MAXPATHLEN); - (void) strncat(locname, "/", MAXPATHLEN); + strncpy(locname, name, MAXPATHLEN); + strncat(locname, "/", MAXPATHLEN); namelen = strlen(locname); while ((dp = rst_readdir(dirp))) { if (dp == NULL) @@ -541,8 +541,7 @@ printlist(char *name, char *basename) fprintf(stderr, "%s%s: name exceeds %d char\n", locname, dp->d_name, MAXPATHLEN); } else { - (void) strncat(locname, dp->d_name, - (int)dp->d_namlen); + strncat(locname, dp->d_name, (int)dp->d_namlen); mkentry(locname, dp, listp++); entries++; } diff --git a/sbin/restore/main.c b/sbin/restore/main.c index 9e9e9ad597..75cdfb84c5 100644 --- a/sbin/restore/main.c +++ b/sbin/restore/main.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1983, 1993 The Regents of the University of California. All rights reserved. * @(#)main.c 8.6 (Berkeley) 5/4/95 * $FreeBSD: src/sbin/restore/main.c,v 1.10.2.3 2001/10/02 08:30:17 cjc Exp $ - * $DragonFly: src/sbin/restore/main.c,v 1.5 2003/11/01 17:16:01 drhodus Exp $ + * $DragonFly: src/sbin/restore/main.c,v 1.6 2004/12/18 21:43:40 swildner Exp $ */ #include @@ -80,7 +80,7 @@ main(int argc, char **argv) char *p, name[MAXPATHLEN]; /* Temp files should *not* be readable. We set permissions later. */ - (void) umask(077); + umask(077); if (argc < 2) usage(); @@ -165,9 +165,9 @@ main(int argc, char **argv) errx(1, "none of i, R, r, t or x options specified"); if (signal(SIGINT, onintr) == SIG_IGN) - (void) signal(SIGINT, SIG_IGN); + signal(SIGINT, SIG_IGN); if (signal(SIGTERM, onintr) == SIG_IGN) - (void) signal(SIGTERM, SIG_IGN); + signal(SIGTERM, SIG_IGN); setlinebuf(stderr); setinput(inputdev); @@ -282,7 +282,7 @@ main(int argc, char **argv) static void usage(void) { - (void)fprintf(stderr, "usage:\t%s\n\t%s\n\t%s\n\t%s\n\t%s\n", + fprintf(stderr, "usage:\t%s\n\t%s\n\t%s\n\t%s\n\t%s\n", "restore -i [-cdhkmNuvy] [-b blocksize] [-f file] [-s fileno]", "restore -r [-cdkNuvy] [-b blocksize] [-f file] [-s fileno]", "restore -R [-cdkNuvy] [-b blocksize] [-f file] [-s fileno]", @@ -334,7 +334,7 @@ obsolete(argcp, argvp) err(1, NULL); nargv[0][0] = '-'; nargv[0][1] = *ap; - (void)strcpy(&nargv[0][2], *argv); + strcpy(&nargv[0][2], *argv); ++argv; ++nargv; break; diff --git a/sbin/restore/restore.c b/sbin/restore/restore.c index bdcd971aad..d1a566b237 100644 --- a/sbin/restore/restore.c +++ b/sbin/restore/restore.c @@ -32,7 +32,7 @@ * * @(#)restore.c 8.3 (Berkeley) 9/13/94 * $FreeBSD: src/sbin/restore/restore.c,v 1.7.2.1 2002/03/01 21:32:28 iedowse Exp $ - * $DragonFly: src/sbin/restore/restore.c,v 1.5 2003/11/01 17:16:01 drhodus Exp $ + * $DragonFly: src/sbin/restore/restore.c,v 1.6 2004/12/18 21:43:40 swildner Exp $ */ #include @@ -81,10 +81,10 @@ addfile(char *name, ino_t ino, int type) if (ino == WINO && command == 'i' && !vflag) return (descend); if (!mflag) { - (void) sprintf(buf, "./%u", ino); + sprintf(buf, "./%u", ino); name = buf; if (type == NODE) { - (void) genliteraldir(name, ino); + genliteraldir(name, ino); return (descend); } } @@ -490,16 +490,16 @@ keyval(int key) { static char keybuf[32]; - (void) strcpy(keybuf, "|NIL"); + strcpy(keybuf, "|NIL"); keybuf[0] = '\0'; if (key & ONTAPE) - (void) strcat(keybuf, "|ONTAPE"); + strcat(keybuf, "|ONTAPE"); if (key & INOFND) - (void) strcat(keybuf, "|INOFND"); + strcat(keybuf, "|INOFND"); if (key & NAMEFND) - (void) strcat(keybuf, "|NAMEFND"); + strcat(keybuf, "|NAMEFND"); if (key & MODECHG) - (void) strcat(keybuf, "|MODECHG"); + strcat(keybuf, "|MODECHG"); return (&keybuf[1]); } @@ -642,7 +642,7 @@ createleaves(char *symtabfile) removeleaf(ep); ep->e_flags &= ~REMOVED; } - (void) extractfile(myname(ep)); + extractfile(myname(ep)); ep->e_flags &= ~(NEW|EXTRACT); /* * We checkpoint the restore after every tape reel, so @@ -747,7 +747,7 @@ createfiles(void) ep = lookupino(next); if (ep == NULL) panic("corrupted symbol table\n"); - (void) extractfile(myname(ep)); + extractfile(myname(ep)); ep->e_flags &= ~NEW; if (volno != curvol) skipmaps(); @@ -770,7 +770,7 @@ createlinks(void) for ( ; ep != NULL; ep = ep->e_links) { if ((ep->e_flags & NEW) == 0) continue; - (void) addwhiteout(myname(ep)); + addwhiteout(myname(ep)); ep->e_flags &= ~NEW; } } @@ -782,11 +782,11 @@ createlinks(void) for (np = ep->e_links; np != NULL; np = np->e_links) { if ((np->e_flags & NEW) == 0) continue; - (void) strcpy(name, myname(ep)); + strcpy(name, myname(ep)); if (ep->e_type == NODE) { - (void) linkit(name, myname(np), SYMLINK); + linkit(name, myname(np), SYMLINK); } else { - (void) linkit(name, myname(np), HARDLINK); + linkit(name, myname(np), HARDLINK); } np->e_flags &= ~NEW; } diff --git a/sbin/restore/symtab.c b/sbin/restore/symtab.c index b5696f0b2c..c7cce1bd42 100644 --- a/sbin/restore/symtab.c +++ b/sbin/restore/symtab.c @@ -32,7 +32,7 @@ * * @(#)symtab.c 8.3 (Berkeley) 4/28/95 * $FreeBSD: src/sbin/restore/symtab.c,v 1.7.2.1 2001/12/19 14:54:14 tobez Exp $ - * $DragonFly: src/sbin/restore/symtab.c,v 1.5 2003/11/01 17:16:01 drhodus Exp $ + * $DragonFly: src/sbin/restore/symtab.c,v 1.6 2004/12/18 21:43:40 swildner Exp $ */ /* @@ -397,7 +397,7 @@ savename(char *name) if (cp == NULL) panic("no space for string table\n"); } - (void) strcpy(cp, name); + strcpy(cp, name); return (cp); } @@ -459,7 +459,7 @@ dumpsymtable(char *filename, long checkpt) for (i = WINO; i <= maxino; i++) { for (ep = lookupino(i); ep != NULL; ep = ep->e_links) { ep->e_index = mynum++; - (void) fwrite(ep->e_name, sizeof(char), + fwrite(ep->e_name, sizeof(char), (int)allocsize(ep->e_namlen), fd); } } @@ -486,7 +486,7 @@ dumpsymtable(char *filename, long checkpt) if (ep->e_next != NULL) tep->e_next = (struct entry *)ep->e_next->e_index; - (void) fwrite((char *)tep, sizeof(struct entry), 1, fd); + fwrite((char *)tep, sizeof(struct entry), 1, fd); } } /* @@ -497,7 +497,7 @@ dumpsymtable(char *filename, long checkpt) tentry = NULL; else tentry = (struct entry *)entry[i]->e_index; - (void) fwrite((char *)&tentry, sizeof(struct entry *), 1, fd); + fwrite((char *)&tentry, sizeof(struct entry *), 1, fd); } hdr.volno = checkpt; hdr.maxino = maxino; @@ -506,13 +506,13 @@ dumpsymtable(char *filename, long checkpt) hdr.dumptime = dumptime; hdr.dumpdate = dumpdate; hdr.ntrec = ntrec; - (void) fwrite((char *)&hdr, sizeof(struct symtableheader), 1, fd); + fwrite((char *)&hdr, sizeof(struct symtableheader), 1, fd); if (ferror(fd)) { fprintf(stderr, "fwrite: %s\n", strerror(errno)); panic("output error to file %s writing symbol table\n", filename); } - (void) fclose(fd); + fclose(fd); } /* diff --git a/sbin/restore/tape.c b/sbin/restore/tape.c index 78137f7bc6..bdbc3e5db2 100644 --- a/sbin/restore/tape.c +++ b/sbin/restore/tape.c @@ -37,7 +37,7 @@ * * @(#)tape.c 8.9 (Berkeley) 5/1/95 * $FreeBSD: src/sbin/restore/tape.c,v 1.16.2.8 2002/06/30 22:57:52 iedowse Exp $ - * $DragonFly: src/sbin/restore/tape.c,v 1.6 2004/02/04 17:40:01 joerg Exp $ + * $DragonFly: src/sbin/restore/tape.c,v 1.7 2004/12/18 21:43:40 swildner Exp $ */ #include @@ -136,11 +136,11 @@ setinput(char *source) */ terminal = fopen(_PATH_TTY, "r"); if (terminal == NULL) { - (void)fprintf(stderr, "cannot open %s: %s\n", + fprintf(stderr, "cannot open %s: %s\n", _PATH_TTY, strerror(errno)); terminal = fopen(_PATH_DEVNULL, "r"); if (terminal == NULL) { - (void)fprintf(stderr, "cannot open %s: %s\n", + fprintf(stderr, "cannot open %s: %s\n", _PATH_DEVNULL, strerror(errno)); done(1); } @@ -343,7 +343,7 @@ again: } do { fprintf(stderr, "Specify next volume #: "); - (void) fflush(stderr); + fflush(stderr); if (fgets(buf, BUFSIZ, terminal) == NULL) done(1); } while (buf[0] == '\n'); @@ -361,7 +361,7 @@ again: fprintf(stderr, "Mount tape volume %ld\n", newvol); fprintf(stderr, "Enter ``none'' if there are no more tapes\n"); fprintf(stderr, "otherwise enter tape name (default: %s) ", magtape); - (void) fflush(stderr); + fflush(stderr); if (fgets(buf, BUFSIZ, terminal) == NULL) done(1); if (!strcmp(buf, "none\n")) { @@ -369,7 +369,7 @@ again: return; } if (buf[0] != '\n') { - (void) strcpy(magtape, buf); + strcpy(magtape, buf); magtape[strlen(magtape) - 1] = '\0'; } #ifdef RRESTORE @@ -449,7 +449,7 @@ gethdr: panic("active file into volume 1\n"); return; } - (void) gethead(&spcl); + gethead(&spcl); findinode(&spcl); if (gettingfile) { gettingfile = 0; @@ -570,9 +570,9 @@ extractfile(char *name) return (GOOD); } if (linkit(lnkbuf, name, SYMLINK) == GOOD) { - (void) lchown(name, uid, gid); - (void) lchmod(name, mode); - (void) lutimes(name, timep); + lchown(name, uid, gid); + lchmod(name, mode); + lutimes(name, timep); return (GOOD); } return (FAIL); @@ -584,17 +584,17 @@ extractfile(char *name) return (GOOD); } if (uflag && !Nflag) - (void)unlink(name); + unlink(name); if (mkfifo(name, mode) < 0) { fprintf(stderr, "%s: cannot create fifo: %s\n", name, strerror(errno)); skipfile(); return (FAIL); } - (void) chown(name, uid, gid); - (void) chmod(name, mode); - (void) utimes(name, timep); - (void) chflags(name, flags); + chown(name, uid, gid); + chmod(name, mode); + utimes(name, timep); + chflags(name, flags); skipfile(); return (GOOD); @@ -606,17 +606,17 @@ extractfile(char *name) return (GOOD); } if (uflag) - (void)unlink(name); + unlink(name); if (mknod(name, mode, (int)curfile.dip->di_rdev) < 0) { fprintf(stderr, "%s: cannot create special file: %s\n", name, strerror(errno)); skipfile(); return (FAIL); } - (void) chown(name, uid, gid); - (void) chmod(name, mode); - (void) utimes(name, timep); - (void) chflags(name, flags); + chown(name, uid, gid); + chmod(name, mode); + utimes(name, timep); + chflags(name, flags); skipfile(); return (GOOD); @@ -627,7 +627,7 @@ extractfile(char *name) return (GOOD); } if (uflag) - (void)unlink(name); + unlink(name); if ((ofile = open(name, O_WRONLY | O_CREAT | O_TRUNC, 0666)) < 0) { fprintf(stderr, "%s: cannot create file: %s\n", @@ -635,12 +635,12 @@ extractfile(char *name) skipfile(); return (FAIL); } - (void) fchown(ofile, uid, gid); - (void) fchmod(ofile, mode); + fchown(ofile, uid, gid); + fchmod(ofile, mode); getfile(xtrfile, xtrskip); - (void) close(ofile); + close(ofile); utimes(name, timep); - (void) chflags(name, flags); + chflags(name, flags); return (GOOD); } /* NOTREACHED */ @@ -775,7 +775,7 @@ xtrlnkfile(char *buf, long size) curfile.name, lnkbuf, buf, pathlen); done(1); } - (void) strcat(lnkbuf, buf); + strcat(lnkbuf, buf); } /* @@ -987,7 +987,7 @@ closemt(void) rmtclose(); else #endif - (void) close(mt); + close(mt); } /* @@ -1308,7 +1308,7 @@ msg(const char *fmt, ...) { va_list ap; va_start(ap, fmt); - (void)vfprintf(stderr, fmt, ap); + vfprintf(stderr, fmt, ap); va_end(ap); } #endif /* RRESTORE */ diff --git a/sbin/restore/utilities.c b/sbin/restore/utilities.c index caf98c753d..9ad90e8e2c 100644 --- a/sbin/restore/utilities.c +++ b/sbin/restore/utilities.c @@ -32,7 +32,7 @@ * * @(#)utilities.c 8.5 (Berkeley) 4/28/95 * $FreeBSD: src/sbin/restore/utilities.c,v 1.8.2.2 2001/07/30 10:30:08 dd Exp $ - * $DragonFly: src/sbin/restore/utilities.c,v 1.4 2003/09/28 14:39:22 hmp Exp $ + * $DragonFly: src/sbin/restore/utilities.c,v 1.5 2004/12/18 21:43:40 swildner Exp $ */ #include @@ -89,7 +89,7 @@ mktempname(register struct entry *ep) if (ep->e_flags & TMPNAME) badentry(ep, "mktempname: called with TMPNAME"); ep->e_flags |= TMPNAME; - (void) strcpy(oldname, myname(ep)); + strcpy(oldname, myname(ep)); freename(ep->e_name); ep->e_name = savename(gentempname(ep)); ep->e_namlen = strlen(ep->e_name); @@ -111,7 +111,7 @@ gentempname(struct entry *ep) i++; if (np == NULL) badentry(ep, "not on ino list"); - (void) sprintf(name, "%s%ld%lu", TMPHDR, i, (u_long)ep->e_ino); + sprintf(name, "%s%ld%lu", TMPHDR, i, (u_long)ep->e_ino); return (name); } @@ -199,7 +199,7 @@ linkit(char *existing, char *new, int type) /* if we want to unlink first, do it now so *link() won't fail */ if (uflag && !Nflag) - (void)unlink(new); + unlink(new); if (type == SYMLINK) { if (!Nflag && symlink(existing, new) < 0) { @@ -345,20 +345,20 @@ flagvalues(register struct entry *ep) { static char flagbuf[BUFSIZ]; - (void) strcpy(flagbuf, "|NIL"); + strcpy(flagbuf, "|NIL"); flagbuf[0] = '\0'; if (ep->e_flags & REMOVED) - (void) strcat(flagbuf, "|REMOVED"); + strcat(flagbuf, "|REMOVED"); if (ep->e_flags & TMPNAME) - (void) strcat(flagbuf, "|TMPNAME"); + strcat(flagbuf, "|TMPNAME"); if (ep->e_flags & EXTRACT) - (void) strcat(flagbuf, "|EXTRACT"); + strcat(flagbuf, "|EXTRACT"); if (ep->e_flags & NEW) - (void) strcat(flagbuf, "|NEW"); + strcat(flagbuf, "|NEW"); if (ep->e_flags & KEEP) - (void) strcat(flagbuf, "|KEEP"); + strcat(flagbuf, "|KEEP"); if (ep->e_flags & EXISTED) - (void) strcat(flagbuf, "|EXISTED"); + strcat(flagbuf, "|EXISTED"); return (&flagbuf[1]); } @@ -388,7 +388,7 @@ reply(char *question) do { fprintf(stderr, "%s? [yn] ", question); - (void) fflush(stderr); + fflush(stderr); c = getc(terminal); while (c != '\n' && getc(terminal) != '\n') if (c == EOF) diff --git a/sbin/routed/if.c b/sbin/routed/if.c index 1758a85b7c..c14a46365b 100644 --- a/sbin/routed/if.c +++ b/sbin/routed/if.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sbin/routed/if.c,v 1.6.2.1 2000/08/14 17:00:03 sheldonh Exp $ - * $DragonFly: src/sbin/routed/if.c,v 1.3 2004/07/28 12:27:40 joerg Exp $ + * $DragonFly: src/sbin/routed/if.c,v 1.4 2004/12/18 21:43:40 swildner Exp $ */ #include "defs.h" @@ -512,7 +512,7 @@ ifdel(struct interface *ifp) rip_sock_mcast = 0; } if (ifp->int_rip_sock >= 0) { - (void)close(ifp->int_rip_sock); + close(ifp->int_rip_sock); ifp->int_rip_sock = -1; fix_select(); } @@ -525,7 +525,7 @@ ifdel(struct interface *ifp) * Assume routes just using gateways beyond this interface * will timeout naturally, and have probably already died. */ - (void)rn_walktree(rhead, walk_bad, 0); + rn_walktree(rhead, walk_bad, 0); set_rdisc_mg(ifp, 0); if_bad_rdisc(ifp); @@ -576,7 +576,7 @@ if_bad(struct interface *ifp) && !strcmp(ifp->int_name, ifp1->int_name)) if_bad(ifp1); } - (void)rn_walktree(rhead, walk_bad, 0); + rn_walktree(rhead, walk_bad, 0); if_bad_rdisc(ifp); } } @@ -981,7 +981,7 @@ ifinit(void) /* or that were off and are now ok */ if (!iff_up(ifp->int_if_flags)) { ifp->int_if_flags |= IFF_UP; - (void)if_ok(ifp, ""); + if_ok(ifp, ""); } /* If it has been long enough, @@ -1055,7 +1055,7 @@ ifinit(void) /* otherwise, it is active and healthy */ ifp->int_act_time = now.tv_sec; - (void)if_ok(ifp, ""); + if_ok(ifp, ""); continue; } diff --git a/sbin/routed/input.c b/sbin/routed/input.c index f590f8806f..ebbf97e225 100644 --- a/sbin/routed/input.c +++ b/sbin/routed/input.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sbin/routed/input.c,v 1.7.2.1 2001/08/01 09:01:45 obrien Exp $ - * $DragonFly: src/sbin/routed/input.c,v 1.3 2004/07/28 12:27:40 joerg Exp $ + * $DragonFly: src/sbin/routed/input.c,v 1.4 2004/12/18 21:43:40 swildner Exp $ */ #include "defs.h" @@ -215,7 +215,7 @@ input(struct sockaddr_in *from, /* received from this IP address */ aifp = ifp1; if (check_remote(aifp)) { aifp->int_act_time = now.tv_sec; - (void)if_ok(aifp, "remote "); + if_ok(aifp, "remote "); } } else if (from->sin_port == htons(RIP_PORT)) { trace_pkt(" discard our own RIP request"); @@ -429,13 +429,13 @@ input(struct sockaddr_in *from, /* received from this IP address */ if (from->sin_port != htons(RIP_PORT)) { /* query */ - (void)output(OUT_QUERY, from, aifp, - v12buf.buf, - ((char *)v12buf.n - (char*)v12buf.buf)); + output(OUT_QUERY, from, aifp, + v12buf.buf, + ((char *)v12buf.n - (char*)v12buf.buf)); } else if (supplier) { - (void)output(OUT_UNICAST, from, aifp, - v12buf.buf, - ((char *)v12buf.n - (char*)v12buf.buf)); + output(OUT_UNICAST, from, aifp, + v12buf.buf, + ((char *)v12buf.n - (char*)v12buf.buf)); } else { /* Only answer a router if we are a supplier * to keep an unwary host that is just starting @@ -504,7 +504,7 @@ input(struct sockaddr_in *from, /* received from this IP address */ aifp = ifp1; if (check_remote(aifp)) { aifp->int_act_time = now.tv_sec; - (void)if_ok(aifp, "remote "); + if_ok(aifp, "remote "); } } else { trace_pkt(" discard our own RIP response"); diff --git a/sbin/routed/main.c b/sbin/routed/main.c index 2d784b54bb..ac7d7ba54c 100644 --- a/sbin/routed/main.c +++ b/sbin/routed/main.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sbin/routed/main.c,v 1.11.2.1 2000/08/14 17:00:03 sheldonh Exp $ - * $DragonFly: src/sbin/routed/main.c,v 1.2 2003/06/17 04:27:34 dillon Exp $ + * $DragonFly: src/sbin/routed/main.c,v 1.3 2004/12/18 21:43:40 swildner Exp $ */ #include "defs.h" @@ -135,8 +135,8 @@ main(int argc, now_garbage = EPOCH - GARBAGE_TIME; wtime.tv_sec = 0; - (void)gethostname(myname, sizeof(myname)-1); - (void)gethost(myname, &myaddr); + gethostname(myname, sizeof(myname)-1); + gethost(myname, &myaddr); while ((n = getopt(argc, argv, "sqdghmpAtvT:F:P:")) != -1) { switch (n) { @@ -555,7 +555,7 @@ void sigterm(int sig) { stopint = sig; - (void)signal(sig, SIG_DFL); /* catch it only once */ + signal(sig, SIG_DFL); /* catch it only once */ } @@ -683,7 +683,7 @@ rip_off(void) if (rip_sock >= 0 && !mhome) { trace_act("turn off RIP"); - (void)close(rip_sock); + close(rip_sock); rip_sock = -1; /* get non-broadcast sockets to listen to queries. @@ -759,7 +759,7 @@ rip_on(struct interface *ifp) */ for (ifp = ifnet; ifp != 0; ifp = ifp->int_next) { if (ifp->int_rip_sock >= 0) { - (void)close(ifp->int_rip_sock); + close(ifp->int_rip_sock); ifp->int_rip_sock = -1; } } @@ -860,9 +860,9 @@ msglog(const char *p, ...) if (ftrace != 0) { if (ftrace == stdout) - (void)fputs("routed: ", ftrace); - (void)vfprintf(ftrace, p, args); - (void)fputc('\n', ftrace); + fputs("routed: ", ftrace); + vfprintf(ftrace, p, args); + fputc('\n', ftrace); } } @@ -923,8 +923,8 @@ msglim(struct msg_limit *lim, naddr addr, const char *p, ...) /* always display the message if tracing */ if (ftrace != 0) { - (void)vfprintf(ftrace, p, args); - (void)fputc('\n', ftrace); + vfprintf(ftrace, p, args); + fputc('\n', ftrace); } } @@ -939,10 +939,10 @@ logbad(int dump, const char *p, ...) va_start(args, p); vsyslog(LOG_ERR, p, args); - (void)fputs("routed: ", stderr); - (void)vfprintf(stderr, p, args); - (void)fputs("; giving up\n",stderr); - (void)fflush(stderr); + fputs("routed: ", stderr); + vfprintf(stderr, p, args); + fputs("; giving up\n",stderr); + fflush(stderr); if (dump) abort(); diff --git a/sbin/routed/output.c b/sbin/routed/output.c index b0fc207aad..646ad740fe 100644 --- a/sbin/routed/output.c +++ b/sbin/routed/output.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sbin/routed/output.c,v 1.5.2.1 2000/08/14 17:00:03 sheldonh Exp $ - * $DragonFly: src/sbin/routed/output.c,v 1.3 2004/07/28 12:27:40 joerg Exp $ + * $DragonFly: src/sbin/routed/output.c,v 1.4 2004/12/18 21:43:40 swildner Exp $ */ #include "defs.h" @@ -789,7 +789,7 @@ supply(struct sockaddr_in *dst, } } - (void)rn_walktree(rhead, walk_supply, 0); + rn_walktree(rhead, walk_supply, 0); ag_flush(0,0,supply_out); /* Flush the packet buffers, provided they are not empty and diff --git a/sbin/routed/parms.c b/sbin/routed/parms.c index 0905cc25f9..6b05a95685 100644 --- a/sbin/routed/parms.c +++ b/sbin/routed/parms.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sbin/routed/parms.c,v 1.7.2.1 2000/08/14 17:00:03 sheldonh Exp $ - * $DragonFly: src/sbin/routed/parms.c,v 1.3 2004/07/28 12:27:40 joerg Exp $ + * $DragonFly: src/sbin/routed/parms.c,v 1.4 2004/12/18 21:43:40 swildner Exp $ */ #include "defs.h" @@ -184,7 +184,7 @@ gwkludge(void) if (0 > fstat(fileno(fp), &sb)) { msglog("could not stat() "_PATH_GATEWAYS); - (void)fclose(fp); + fclose(fp); return; } @@ -341,7 +341,7 @@ gwkludge(void) if (!(state & IS_EXTERNAL) && ifp->int_mask != ifp->int_std_mask) ifp->int_state |= IS_SUBNET; - (void)sprintf(ifp->int_name, "%s(%s)", type, gname); + sprintf(ifp->int_name, "%s(%s)", type, gname); ifp->int_index = -1; if_link(ifp); @@ -360,7 +360,7 @@ gwkludge(void) trace_if("Add", ifp); } - (void)fclose(fp); + fclose(fp); } diff --git a/sbin/routed/rdisc.c b/sbin/routed/rdisc.c index f6f9bf60b0..72ec398b5b 100644 --- a/sbin/routed/rdisc.c +++ b/sbin/routed/rdisc.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sbin/routed/rdisc.c,v 1.5.2.1 2000/08/14 17:00:04 sheldonh Exp $ - * $DragonFly: src/sbin/routed/rdisc.c,v 1.2 2003/06/17 04:27:34 dillon Exp $ + * $DragonFly: src/sbin/routed/rdisc.c,v 1.3 2004/12/18 21:43:40 swildner Exp $ */ #include "defs.h" @@ -124,22 +124,22 @@ trace_rdisc(const char *act, lastlog(); if (p->icmp.icmp_type == ICMP_ROUTERADVERT) { - (void)fprintf(ftrace, "%s Router Ad" - " from %s to %s via %s life=%d\n", - act, naddr_ntoa(from), naddr_ntoa(to), - ifp ? ifp->int_name : "?", - ntohs(p->ad.icmp_ad_life)); + fprintf(ftrace, "%s Router Ad" + " from %s to %s via %s life=%d\n", + act, naddr_ntoa(from), naddr_ntoa(to), + ifp ? ifp->int_name : "?", + ntohs(p->ad.icmp_ad_life)); if (!TRACECONTENTS) return; wp = &p->ad.icmp_ad_info[0].icmp_ad_addr; lim = &wp[(len - sizeof(p->ad)) / sizeof(*wp)]; for (i = 0; i < p->ad.icmp_ad_num && wp <= lim; i++) { - (void)fprintf(ftrace, "\t%s preference=%d", - naddr_ntoa(wp[0]), (int)ntohl(wp[1])); + fprintf(ftrace, "\t%s preference=%d", + naddr_ntoa(wp[0]), (int)ntohl(wp[1])); wp += p->ad.icmp_ad_asize; } - (void)fputc('\n',ftrace); + fputc('\n',ftrace); } else { trace_act("%s Router Solic. from %s to %s via %s value=%#x", diff --git a/sbin/routed/rtquery/rtquery.c b/sbin/routed/rtquery/rtquery.c index 8e21973c1e..12257525b4 100644 --- a/sbin/routed/rtquery/rtquery.c +++ b/sbin/routed/rtquery/rtquery.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sbin/routed/rtquery/rtquery.c,v 1.13 1999/08/28 00:14:21 peter Exp $ - * $DragonFly: src/sbin/routed/rtquery/rtquery.c,v 1.3 2004/07/28 12:27:40 joerg Exp $ + * $DragonFly: src/sbin/routed/rtquery/rtquery.c,v 1.4 2004/12/18 21:43:46 swildner Exp $ */ char copyright[] = @@ -320,7 +320,7 @@ trace_loop(char *argv[]) int res; if (geteuid() != 0) { - (void)fprintf(stderr, "-t requires UID 0\n"); + fprintf(stderr, "-t requires UID 0\n"); exit(1); } @@ -646,14 +646,14 @@ rip_input(struct sockaddr_in *from, name = ""; if (n->n_family == RIP_AF_INET) { in.s_addr = n->n_dst; - (void)strcpy(net_buf, inet_ntoa(in)); + strcpy(net_buf, inet_ntoa(in)); mask = ntohl(n->n_mask); dmask = mask & -mask; if (mask != 0) { sp = &net_buf[strlen(net_buf)]; if (IMSG.rip_vers == RIPv1) { - (void)sprintf(sp," mask=%#x ? ",mask); + sprintf(sp," mask=%#x ? ",mask); mask = 0; } else if (mask + dmask == 0) { for (i = 0; @@ -661,9 +661,9 @@ rip_input(struct sockaddr_in *from, && ((1<a_type == RIP_AUTH_PW && n == IMSG.rip_nets) { - (void)printf(" Password Authentication:" - " \"%s\"\n", - qstring(na->au.au_pw, - RIP_AUTH_PW_LEN)); + printf(" Password Authentication: \"%s\"\n", + qstring(na->au.au_pw, RIP_AUTH_PW_LEN)); continue; } if (na->a_type == RIP_AUTH_MD5 && n == IMSG.rip_nets) { - (void)printf(" MD5 Auth" - " len=%d KeyID=%d" - " auth_len=%d" - " seqno=%#x" - " rsvd=%#x,%#x\n", - ntohs(na->au.a_md5.md5_pkt_len), - na->au.a_md5.md5_keyid, - na->au.a_md5.md5_auth_len, - (int)ntohl(na->au.a_md5.md5_seqno), - na->au.a_md5.rsvd[0], - na->au.a_md5.rsvd[1]); + printf(" MD5 Auth" + " len=%d KeyID=%d" + " auth_len=%d" + " seqno=%#x" + " rsvd=%#x,%#x\n", + ntohs(na->au.a_md5.md5_pkt_len), + na->au.a_md5.md5_keyid, + na->au.a_md5.md5_auth_len, + (int)ntohl(na->au.a_md5.md5_seqno), + na->au.a_md5.rsvd[0], + na->au.a_md5.rsvd[1]); md5_authed = 1; continue; } - (void)printf(" Authentication type %d: ", - ntohs(na->a_type)); + printf(" Authentication type %d: ", ntohs(na->a_type)); for (i = 0; i < (int)sizeof(na->au.au_pw); i++) - (void)printf("%02x ", na->au.au_pw[i]); + printf("%02x ", na->au.au_pw[i]); putc('\n', stdout); if (md5_authed && n+1 > lim && na->a_type == ntohs(1)) { @@ -740,24 +737,23 @@ rip_input(struct sockaddr_in *from, MD5Update(&md5_ctx, (u_char *)passwd, RIP_AUTH_MD5_LEN); MD5Final(hash, &md5_ctx); - (void)printf(" %s hash\n", - memcmp(hash, na->au.au_pw, - sizeof(hash)) - ? "WRONG" : "correct"); + printf(" %s hash\n", + memcmp(hash, na->au.au_pw, sizeof(hash)) + ? "WRONG" : "correct"); } continue; } else { - (void)sprintf(net_buf, "(af %#x) %d.%d.%d.%d", - ntohs(n->n_family), - (char)(n->n_dst >> 24), - (char)(n->n_dst >> 16), - (char)(n->n_dst >> 8), - (char)n->n_dst); + sprintf(net_buf, "(af %#x) %d.%d.%d.%d", + ntohs(n->n_family), + (char)(n->n_dst >> 24), + (char)(n->n_dst >> 16), + (char)(n->n_dst >> 8), + (char)n->n_dst); } - (void)printf(" %-18s metric %2d %-10s", - net_buf, (int)ntohl(n->n_metric), name); + printf(" %-18s metric %2d %-10s", + net_buf, (int)ntohl(n->n_metric), name); if (n->n_nhop != 0) { in.s_addr = n->n_nhop; @@ -766,13 +762,13 @@ rip_input(struct sockaddr_in *from, else hp = gethostbyaddr((char*)&in, sizeof(in), AF_INET); - (void)printf(" nhop=%-15s%s", - (hp != 0) ? hp->h_name : inet_ntoa(in), - (IMSG.rip_vers == RIPv1) ? " ?" : ""); + printf(" nhop=%-15s%s", + (hp != 0) ? hp->h_name : inet_ntoa(in), + (IMSG.rip_vers == RIPv1) ? " ?" : ""); } if (n->n_tag != 0) - (void)printf(" tag=%#x%s", n->n_tag, - (IMSG.rip_vers == RIPv1) ? " ?" : ""); + printf(" tag=%#x%s", n->n_tag, + (IMSG.rip_vers == RIPv1) ? " ?" : ""); putc('\n', stdout); } } diff --git a/sbin/routed/table.c b/sbin/routed/table.c index 860fcd4ec0..894c5b039b 100644 --- a/sbin/routed/table.c +++ b/sbin/routed/table.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sbin/routed/table.c,v 1.9.2.2 2000/08/14 17:00:04 sheldonh Exp $ - * $DragonFly: src/sbin/routed/table.c,v 1.4 2004/07/28 12:27:40 joerg Exp $ + * $DragonFly: src/sbin/routed/table.c,v 1.5 2004/12/18 21:43:40 swildner Exp $ */ #include "defs.h" @@ -106,7 +106,7 @@ struct ag_info ag_slots[NUM_AG_SLOTS], *ag_avail, *ag_corsest, *ag_finest; for (cag = ag_corsest; cag != 0; cag = cag->ag_fine) \ acnt++; \ if (acnt != NUM_AG_SLOTS) { \ - (void)fflush(stderr); \ + fflush(stderr); \ abort(); \ } \ } @@ -577,7 +577,7 @@ ag_check(naddr dst, } #ifdef DEBUG_AG - (void)fflush(stderr); + fflush(stderr); if (ag == 0 && ag_cors != ag_finest) abort(); if (ag_cors == 0 && ag != ag_corsest) @@ -1479,7 +1479,7 @@ fix_kern(void) /* Walk daemon table, updating the copy of the kernel table. */ - (void)rn_walktree(rhead, walk_kern, 0); + rn_walktree(rhead, walk_kern, 0); ag_flush(0,0,kern_out); for (i = 0; i < KHASH_SIZE; i++) { @@ -1824,7 +1824,7 @@ rtswitch(struct rt_entry *rt, return; swap = rt->rt_spares[0]; - (void)sprintf(label, "Use #%d", (int)(rts - rt->rt_spares)); + sprintf(label, "Use #%d", (int)(rts - rt->rt_spares)); rtchange(rt, rt->rt_state & ~(RS_NET_SYN | RS_RDISC), rts, label); if (swap.rts_metric == HOPCNT_INFINITY) { *rts = rts_empty; @@ -2127,7 +2127,7 @@ age(naddr bad_gate) /* Age routes. */ age_bad_gate = bad_gate; - (void)rn_walktree(rhead, walk_age, 0); + rn_walktree(rhead, walk_age, 0); /* delete old redirected routes to keep the kernel table small * and prevent blackholes diff --git a/sbin/routed/trace.c b/sbin/routed/trace.c index 8288b3de67..4db48e74a9 100644 --- a/sbin/routed/trace.c +++ b/sbin/routed/trace.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sbin/routed/trace.c,v 1.5.2.1 2002/11/07 17:19:13 imp Exp $ - * $DragonFly: src/sbin/routed/trace.c,v 1.2 2003/06/17 04:27:34 dillon Exp $ + * $DragonFly: src/sbin/routed/trace.c,v 1.3 2004/12/18 21:43:40 swildner Exp $ */ #define RIPCMDS @@ -154,7 +154,7 @@ ts(time_t secs) { secs += epoch.tv_sec; #ifdef sgi - (void)cftime(s, "%T", &secs); + cftime(s, "%T", &secs); #else memcpy(s, ctime(&secs)+11, 8); s[8] = '\0'; @@ -174,7 +174,7 @@ lastlog(void) { if (lastlog_time.tv_sec != now.tv_sec || lastlog_time.tv_usec != now.tv_usec) { - (void)fprintf(ftrace, "-- %s --\n", ts(now.tv_sec)); + fprintf(ftrace, "-- %s --\n", ts(now.tv_sec)); lastlog_time = now; } } @@ -189,7 +189,7 @@ tmsg(const char *p, ...) lastlog(); va_start(args, p); vfprintf(ftrace, p, args); - (void)fputc('\n',ftrace); + fputc('\n',ftrace); fflush(ftrace); } } @@ -210,12 +210,12 @@ trace_close(int zap_stdio) ftrace = 0; fd = open(_PATH_DEVNULL, O_RDWR); if (isatty(STDIN_FILENO)) - (void)dup2(fd, STDIN_FILENO); + dup2(fd, STDIN_FILENO); if (isatty(STDOUT_FILENO)) - (void)dup2(fd, STDOUT_FILENO); + dup2(fd, STDOUT_FILENO); if (isatty(STDERR_FILENO)) - (void)dup2(fd, STDERR_FILENO); - (void)close(fd); + dup2(fd, STDERR_FILENO); + close(fd); } lastlog_time.tv_sec = 0; } @@ -242,7 +242,7 @@ trace_off(const char *p, ...) lastlog(); va_start(args, p); vfprintf(ftrace, p, args); - (void)fputc('\n',ftrace); + fputc('\n',ftrace); } trace_close(file_trace); @@ -454,10 +454,10 @@ addrname(naddr addr, /* in network byte order */ if (mask + dmask == 0) { for (i = 0; i != 32 && ((1<bits_name[0] != '\0') { if (c) - (void)putc(c, ftrace); - (void)fprintf(ftrace, "%s", tbl->bits_name); + putc(c, ftrace); + fprintf(ftrace, "%s", tbl->bits_name); c = '|'; } if (0 == (field &= ~(b | tbl->bits_clear))) @@ -568,13 +568,13 @@ trace_bits(const struct bits *tbl, } if (field != 0 && tbl->bits_name != 0) { if (c) - (void)putc(c, ftrace); - (void)fprintf(ftrace, tbl->bits_name, field); + putc(c, ftrace); + fprintf(ftrace, tbl->bits_name, field); c = '|'; } if (c != '<' || force) - (void)fputs("> ", ftrace); + fputs("> ", ftrace); } @@ -588,7 +588,7 @@ rtname(naddr dst, int i; i = sprintf(buf, "%-16s-->", addrname(dst, mask, 0)); - (void)sprintf(&buf[i], "%-*s", 15+20-MAX(20,i), naddr_ntoa(gate)); + sprintf(&buf[i], "%-*s", 15+20-MAX(20,i), naddr_ntoa(gate)); return buf; } @@ -605,23 +605,22 @@ print_rts(struct rt_spare *rts, if (force_metric >= 0) - (void)fprintf(ftrace, "metric=%-2d ", rts->rts_metric); + fprintf(ftrace, "metric=%-2d ", rts->rts_metric); if (force_ifp >= 0) - (void)fprintf(ftrace, "%s ", (rts->rts_ifp == 0 ? - "if?" : rts->rts_ifp->int_name)); + fprintf(ftrace, "%s ", (rts->rts_ifp == 0 ? + "if?" : rts->rts_ifp->int_name)); if (force_router > 0 || (force_router == 0 && rts->rts_router != rts->rts_gate)) - (void)fprintf(ftrace, "router=%s ", - naddr_ntoa(rts->rts_router)); + fprintf(ftrace, "router=%s ", naddr_ntoa(rts->rts_router)); if (force_time > 0) - (void)fprintf(ftrace, "%s ", ts(rts->rts_time)); + fprintf(ftrace, "%s ", ts(rts->rts_time)); if (force_tag > 0 || (force_tag == 0 && rts->rts_tag != 0)) - (void)fprintf(ftrace, "tag=%#x ", ntohs(rts->rts_tag)); + fprintf(ftrace, "tag=%#x ", ntohs(rts->rts_tag)); if (rts->rts_de_ag != 0) { for (i = 1; (u_int)(1 << i) <= rts->rts_de_ag; i++) continue; - (void)fprintf(ftrace, "de_ag=%d ", i); + fprintf(ftrace, "de_ag=%d ", i); } } @@ -635,21 +634,20 @@ trace_if(const char *act, return; lastlog(); - (void)fprintf(ftrace, "%-3s interface %-4s ", act, ifp->int_name); - (void)fprintf(ftrace, "%-15s-->%-15s ", - naddr_ntoa(ifp->int_addr), - addrname(((ifp->int_if_flags & IFF_POINTOPOINT) - ? ifp->int_dstaddr - : htonl(ifp->int_net)), - ifp->int_mask, 1)); + fprintf(ftrace, "%-3s interface %-4s ", act, ifp->int_name); + fprintf(ftrace, "%-15s-->%-15s ", + naddr_ntoa(ifp->int_addr), + addrname(((ifp->int_if_flags & IFF_POINTOPOINT) + ? ifp->int_dstaddr : htonl(ifp->int_net)), + ifp->int_mask, 1)); if (ifp->int_metric != 0) - (void)fprintf(ftrace, "metric=%d ", ifp->int_metric); + fprintf(ftrace, "metric=%d ", ifp->int_metric); if (!IS_RIP_OUT_OFF(ifp->int_state) && ifp->int_d_metric != 0) - (void)fprintf(ftrace, "fake_default=%d ", ifp->int_d_metric); + fprintf(ftrace, "fake_default=%d ", ifp->int_d_metric); trace_bits(if_bits, ifp->int_if_flags, 0); trace_bits(is_bits, ifp->int_state, 0); - (void)fputc('\n',ftrace); + fputc('\n',ftrace); } @@ -670,26 +668,26 @@ trace_upslot(struct rt_entry *rt, lastlog(); if (new->rts_gate == 0) { - (void)fprintf(ftrace, "Del #%d %-35s ", - (int)(rts - rt->rt_spares), - rtname(rt->rt_dst, rt->rt_mask, rts->rts_gate)); + fprintf(ftrace, "Del #%d %-35s ", + (int)(rts - rt->rt_spares), + rtname(rt->rt_dst, rt->rt_mask, rts->rts_gate)); print_rts(rts, 0,0,0,0, (rts != rt->rt_spares || AGE_RT(rt->rt_state,new->rts_ifp))); } else if (rts->rts_gate != RIP_DEFAULT) { - (void)fprintf(ftrace, "Chg #%d %-35s ", - (int)(rts - rt->rt_spares), - rtname(rt->rt_dst, rt->rt_mask, rts->rts_gate)); + fprintf(ftrace, "Chg #%d %-35s ", + (int)(rts - rt->rt_spares), + rtname(rt->rt_dst, rt->rt_mask, rts->rts_gate)); print_rts(rts, 0,0, rts->rts_gate != new->rts_gate, rts->rts_tag != new->rts_tag, rts != rt->rt_spares || AGE_RT(rt->rt_state, rt->rt_ifp)); - (void)fprintf(ftrace, "\n %19s%-16s ", "", - (new->rts_gate != rts->rts_gate - ? naddr_ntoa(new->rts_gate) : "")); + fprintf(ftrace, "\n %19s%-16s ", "", + (new->rts_gate != rts->rts_gate + ? naddr_ntoa(new->rts_gate) : "")); print_rts(new, -(new->rts_metric == rts->rts_metric), -(new->rts_ifp == rts->rts_ifp), @@ -700,14 +698,14 @@ trace_upslot(struct rt_entry *rt, || AGE_RT(rt->rt_state, new->rts_ifp)))); } else { - (void)fprintf(ftrace, "Add #%d %-35s ", - (int)(rts - rt->rt_spares), - rtname(rt->rt_dst, rt->rt_mask, new->rts_gate)); + fprintf(ftrace, "Add #%d %-35s ", + (int)(rts - rt->rt_spares), + rtname(rt->rt_dst, rt->rt_mask, new->rts_gate)); print_rts(new, 0,0,0,0, (rts != rt->rt_spares || AGE_RT(rt->rt_state,new->rts_ifp))); } - (void)fputc('\n',ftrace); + fputc('\n',ftrace); } @@ -724,7 +722,7 @@ trace_misc(const char *p, ...) lastlog(); va_start(args, p); vfprintf(ftrace, p, args); - (void)fputc('\n',ftrace); + fputc('\n',ftrace); } @@ -741,7 +739,7 @@ trace_act(const char *p, ...) lastlog(); va_start(args, p); vfprintf(ftrace, p, args); - (void)fputc('\n',ftrace); + fputc('\n',ftrace); } @@ -758,7 +756,7 @@ trace_pkt(const char *p, ...) lastlog(); va_start(args, p); vfprintf(ftrace, p, args); - (void)fputc('\n',ftrace); + fputc('\n',ftrace); } @@ -780,17 +778,16 @@ trace_change(struct rt_entry *rt, return; lastlog(); - (void)fprintf(ftrace, "%s %-35s ", - label, - rtname(rt->rt_dst, rt->rt_mask, rt->rt_gate)); + fprintf(ftrace, "%s %-35s ", + label, rtname(rt->rt_dst, rt->rt_mask, rt->rt_gate)); print_rts(rt->rt_spares, 0,0,0,0, AGE_RT(rt->rt_state, rt->rt_ifp)); trace_bits(rs_bits, rt->rt_state, rt->rt_state != state); - (void)fprintf(ftrace, "\n%*s %19s%-16s ", - (int)strlen(label), "", "", - (rt->rt_gate != new->rts_gate - ? naddr_ntoa(new->rts_gate) : "")); + fprintf(ftrace, "\n%*s %19s%-16s ", + (int)strlen(label), "", "", + (rt->rt_gate != new->rts_gate + ? naddr_ntoa(new->rts_gate) : "")); print_rts(new, -(new->rts_metric == rt->rt_metric), -(new->rts_ifp == rt->rt_ifp), @@ -800,7 +797,7 @@ trace_change(struct rt_entry *rt, && AGE_RT(rt->rt_state,new->rts_ifp))); if (rt->rt_state != state) trace_bits(rs_bits, state, 1); - (void)fputc('\n',ftrace); + fputc('\n',ftrace); } @@ -811,12 +808,11 @@ trace_add_del(const char * action, struct rt_entry *rt) return; lastlog(); - (void)fprintf(ftrace, "%s %-35s ", - action, - rtname(rt->rt_dst, rt->rt_mask, rt->rt_gate)); + fprintf(ftrace, "%s %-35s ", + action, rtname(rt->rt_dst, rt->rt_mask, rt->rt_gate)); print_rts(rt->rt_spares, 0,0,0,0,AGE_RT(rt->rt_state,rt->rt_ifp)); trace_bits(rs_bits, rt->rt_state, 0); - (void)fputc('\n',ftrace); + fputc('\n',ftrace); } @@ -829,24 +825,24 @@ walk_trace(struct radix_node *rn, struct rt_spare *rts; int i; - (void)fprintf(ftrace, " %-35s ", - rtname(RT->rt_dst, RT->rt_mask, RT->rt_gate)); + fprintf(ftrace, " %-35s ", + rtname(RT->rt_dst, RT->rt_mask, RT->rt_gate)); print_rts(&RT->rt_spares[0], 0,0,0,0, AGE_RT(RT->rt_state, RT->rt_ifp)); trace_bits(rs_bits, RT->rt_state, 0); if (RT->rt_poison_time >= now_garbage && RT->rt_poison_metric < RT->rt_metric) - (void)fprintf(ftrace, "pm=%d@%s", - RT->rt_poison_metric, ts(RT->rt_poison_time)); + fprintf(ftrace, "pm=%d@%s", + RT->rt_poison_metric, ts(RT->rt_poison_time)); rts = &RT->rt_spares[1]; for (i = 1; i < NUM_SPARES; i++, rts++) { if (rts->rts_gate != RIP_DEFAULT) { - (void)fprintf(ftrace,"\n #%d%15s%-16s ", - i, "", naddr_ntoa(rts->rts_gate)); + fprintf(ftrace,"\n #%d%15s%-16s ", + i, "", naddr_ntoa(rts->rts_gate)); print_rts(rts, 0,0,0,0,1); } } - (void)fputc('\n',ftrace); + fputc('\n',ftrace); return 0; } @@ -861,10 +857,10 @@ trace_dump(void) return; lastlog(); - (void)fputs("current daemon state:\n", ftrace); + fputs("current daemon state:\n", ftrace); for (ifp = ifnet; ifp != 0; ifp = ifp->int_next) trace_if("", ifp); - (void)rn_walktree(rhead, walk_trace, 0); + rn_walktree(rhead, walk_trace, 0); } @@ -885,19 +881,19 @@ trace_rip(const char *dir1, const char *dir2, lastlog(); if (msg->rip_cmd >= RIPCMD_MAX || msg->rip_vers == 0) { - (void)fprintf(ftrace, "%s bad RIPv%d cmd=%d %s" - " %s.%d size=%d\n", - dir1, msg->rip_vers, msg->rip_cmd, dir2, - naddr_ntoa(who->sin_addr.s_addr), - ntohs(who->sin_port), - size); + fprintf(ftrace, "%s bad RIPv%d cmd=%d %s" + " %s.%d size=%d\n", + dir1, msg->rip_vers, msg->rip_cmd, dir2, + naddr_ntoa(who->sin_addr.s_addr), + ntohs(who->sin_port), + size); return; } - (void)fprintf(ftrace, "%s RIPv%d %s %s %s.%d%s%s\n", - dir1, msg->rip_vers, ripcmds[msg->rip_cmd], dir2, - naddr_ntoa(who->sin_addr.s_addr), ntohs(who->sin_port), - ifp ? " via " : "", ifp ? ifp->int_name : ""); + fprintf(ftrace, "%s RIPv%d %s %s %s.%d%s%s\n", + dir1, msg->rip_vers, ripcmds[msg->rip_cmd], dir2, + naddr_ntoa(who->sin_addr.s_addr), ntohs(who->sin_port), + ifp ? " via " : "", ifp ? ifp->int_name : ""); if (!TRACECONTENTS) return; @@ -915,42 +911,42 @@ trace_rip(const char *dir1, const char *dir2, && (n+1 == lim || (n+2 == lim && (n+1)->n_family == RIP_AF_AUTH))) { - (void)fputs("\tQUERY ", ftrace); + fputs("\tQUERY ", ftrace); if (n->n_dst != 0) - (void)fprintf(ftrace, "%s ", - naddr_ntoa(n->n_dst)); + fprintf(ftrace, "%s ", + naddr_ntoa(n->n_dst)); if (n->n_mask != 0) - (void)fprintf(ftrace, "mask=%#x ", - (u_int)ntohl(n->n_mask)); + fprintf(ftrace, "mask=%#x ", + (u_int)ntohl(n->n_mask)); if (n->n_nhop != 0) - (void)fprintf(ftrace, "nhop=%s ", - naddr_ntoa(n->n_nhop)); + fprintf(ftrace, "nhop=%s ", + naddr_ntoa(n->n_nhop)); if (n->n_tag != 0) - (void)fprintf(ftrace, "tag=%#x ", - ntohs(n->n_tag)); - (void)fputc('\n',ftrace); + fprintf(ftrace, "tag=%#x ", + ntohs(n->n_tag)); + fputc('\n',ftrace); continue; } if (n->n_family == RIP_AF_AUTH) { if (NA->a_type == RIP_AUTH_PW && n == msg->rip_nets) { - (void)fprintf(ftrace, "\tPassword" - " Authentication:" - " \"%s\"\n", - qstring(NA->au.au_pw, - RIP_AUTH_PW_LEN)); + fprintf(ftrace, "\tPassword" + " Authentication:" + " \"%s\"\n", + qstring(NA->au.au_pw, + RIP_AUTH_PW_LEN)); continue; } if (NA->a_type == RIP_AUTH_MD5 && n == msg->rip_nets) { - (void)fprintf(ftrace, - "\tMD5 Auth" - " pkt_len=%d KeyID=%u" - " auth_len=%d" - " seqno=%#x" - " rsvd=%#x,%#x\n", + fprintf(ftrace, + "\tMD5 Auth" + " pkt_len=%d KeyID=%u" + " auth_len=%d" + " seqno=%#x" + " rsvd=%#x,%#x\n", ntohs(NA->au.a_md5.md5_pkt_len), NA->au.a_md5.md5_keyid, NA->au.a_md5.md5_auth_len, @@ -959,49 +955,45 @@ trace_rip(const char *dir1, const char *dir2, (int)ntohs(NA->au.a_md5.rsvd[1])); continue; } - (void)fprintf(ftrace, - "\tAuthentication type %d: ", - ntohs(NA->a_type)); + fprintf(ftrace, + "\tAuthentication type %d: ", + ntohs(NA->a_type)); for (i = 0; i < (int)sizeof(NA->au.au_pw); i++) - (void)fprintf(ftrace, "%02x ", - NA->au.au_pw[i]); - (void)fputc('\n',ftrace); + fprintf(ftrace, "%02x ", + NA->au.au_pw[i]); + fputc('\n',ftrace); continue; } seen_route = 1; if (n->n_family != RIP_AF_INET) { - (void)fprintf(ftrace, - "\t(af %d) %-18s mask=%#x ", - ntohs(n->n_family), - naddr_ntoa(n->n_dst), - (u_int)ntohl(n->n_mask)); + fprintf(ftrace, + "\t(af %d) %-18s mask=%#x ", + ntohs(n->n_family), + naddr_ntoa(n->n_dst), + (u_int)ntohl(n->n_mask)); } else if (msg->rip_vers == RIPv1) { - (void)fprintf(ftrace, "\t%-18s ", - addrname(n->n_dst, - ntohl(n->n_mask), - n->n_mask==0 ? 2 : 1)); + fprintf(ftrace, "\t%-18s ", + addrname(n->n_dst, ntohl(n->n_mask), + n->n_mask==0 ? 2 : 1)); } else { - (void)fprintf(ftrace, "\t%-18s ", - addrname(n->n_dst, - ntohl(n->n_mask), - n->n_mask==0 ? 2 : 0)); + fprintf(ftrace, "\t%-18s ", + addrname(n->n_dst, ntohl(n->n_mask), + n->n_mask==0 ? 2 : 0)); } - (void)fprintf(ftrace, "metric=%-2d ", - (u_int)ntohl(n->n_metric)); + fprintf(ftrace, "metric=%-2d ", + (u_int)ntohl(n->n_metric)); if (n->n_nhop != 0) - (void)fprintf(ftrace, " nhop=%s ", - naddr_ntoa(n->n_nhop)); + fprintf(ftrace, " nhop=%s ", + naddr_ntoa(n->n_nhop)); if (n->n_tag != 0) - (void)fprintf(ftrace, "tag=%#x", - ntohs(n->n_tag)); - (void)fputc('\n',ftrace); + fprintf(ftrace, "tag=%#x", ntohs(n->n_tag)); + fputc('\n',ftrace); } if (size != (char *)n - (char *)msg) - (void)fprintf(ftrace, "truncated record, len %d\n", - size); + fprintf(ftrace, "truncated record, len %d\n", size); break; case RIPCMD_TRACEON: diff --git a/sbin/savecore/savecore.c b/sbin/savecore/savecore.c index 119ffcf6bf..70344318bc 100644 --- a/sbin/savecore/savecore.c +++ b/sbin/savecore/savecore.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1986, 1992, 1993 The Regents of the University of California. All rights reserved. * @(#)savecore.c 8.3 (Berkeley) 1/2/94 * $FreeBSD: src/sbin/savecore/savecore.c,v 1.28.2.13 2002/04/07 21:17:50 asmodai Exp $ - * $DragonFly: src/sbin/savecore/savecore.c,v 1.7 2004/11/05 03:12:03 dillon Exp $ + * $DragonFly: src/sbin/savecore/savecore.c,v 1.8 2004/12/18 21:43:46 swildner Exp $ */ #include @@ -181,7 +181,7 @@ main(int argc, char **argv) if (argc == 2) kernel = argv[1]; - (void)time(&now); + time(&now); kmem_setup(); if (clear) { @@ -267,13 +267,13 @@ kmem_setup(void) kmem = Open(_PATH_KMEM, O_RDONLY); Lseek(kmem, (off_t)current_nl[X_DUMPLO].n_value, L_SET); - (void)Read(kmem, &kdumplo, sizeof(kdumplo)); + Read(kmem, &kdumplo, sizeof(kdumplo)); dumplo = (off_t)kdumplo * DEV_BSIZE; if (verbose) - (void)printf("dumplo = %lld (%ld * %d)\n", + printf("dumplo = %lld (%ld * %d)\n", (long long)dumplo, kdumplo, DEV_BSIZE); Lseek(kmem, (off_t)current_nl[X_DUMPMAG].n_value, L_SET); - (void)Read(kmem, &dumpmag, sizeof(dumpmag)); + Read(kmem, &dumpmag, sizeof(dumpmag)); find_dev(dumpdev); dumpfd = Open(ddname, O_RDWR); if (kernel) @@ -367,7 +367,7 @@ save_core(void) * Get the current number and update the bounds file. Do the update * now, because may fail later and don't want to overwrite anything. */ - (void)snprintf(path, sizeof(path), "%s/bounds", savedir); + snprintf(path, sizeof(path), "%s/bounds", savedir); if ((fp = fopen(path, "r")) == NULL) goto err1; if (fgets(buf, sizeof(buf), fp) == NULL) { @@ -377,17 +377,17 @@ err1: syslog(LOG_WARNING, "%s: %m", path); } else bounds = atoi(buf); if (fp != NULL) - (void)fclose(fp); + fclose(fp); if ((fp = fopen(path, "w")) == NULL) syslog(LOG_ERR, "%s: %m", path); else { - (void)fprintf(fp, "%d\n", bounds + 1); - (void)fclose(fp); + fprintf(fp, "%d\n", bounds + 1); + fclose(fp); } /* Create the core file. */ oumask = umask(S_IRWXG|S_IRWXO); /* Restrict access to the core file.*/ - (void)snprintf(path, sizeof(path), "%s/vmcore.%d%s", + snprintf(path, sizeof(path), "%s/vmcore.%d%s", savedir, bounds, compress ? ".gz" : ""); if (compress) fp = zopen(path, "w"); @@ -397,7 +397,7 @@ err1: syslog(LOG_WARNING, "%s: %m", path); syslog(LOG_ERR, "%s: %m", path); exit(1); } - (void)umask(oumask); + umask(oumask); /* Seek to the start of the core. */ Lseek(dumpfd, (off_t)dumplo, L_SET); @@ -407,7 +407,7 @@ err1: syslog(LOG_WARNING, "%s: %m", path); compress ? "compressed " : "", path); for (; dumpsize > 0; dumpsize -= nr) { printf("%6ldK\r", (long)(dumpsize / 1024)); - (void)fflush(stdout); + fflush(stdout); nr = read(dumpfd, buf, MIN(dumpsize, sizeof(buf))); if (nr <= 0) { if (nr == 0) @@ -457,16 +457,16 @@ err1: syslog(LOG_WARNING, "%s: %m", path); syslog(LOG_ERR, "%s: %m", path); err2: syslog(LOG_WARNING, "WARNING: vmcore may be incomplete"); - (void)printf("\n"); + printf("\n"); exit(1); } } - (void)fclose(fp); + fclose(fp); /* Copy the kernel. */ ifd = Open(kernel ? kernel : getbootfile(), O_RDONLY); - (void)snprintf(path, sizeof(path), "%s/kernel.%d%s", + snprintf(path, sizeof(path), "%s/kernel.%d%s", savedir, bounds, compress ? ".gz" : ""); if (compress) fp = zopen(path, "w"); @@ -493,7 +493,7 @@ err2: syslog(LOG_WARNING, "WARNING: kernel may be incomplete"); exit(1); } - (void)fclose(fp); + fclose(fp); close(ifd); } @@ -567,10 +567,10 @@ get_crashtime(void) syslog(LOG_ERR, "dump time is zero"); return (0); } - (void)printf("savecore: system went down at %s", ctime(&dumptime)); + printf("savecore: system went down at %s", ctime(&dumptime)); #define LEEWAY (7 * 86400) if (dumptime < now - LEEWAY || dumptime > now + LEEWAY) { - (void)printf("dump time is unreasonable\n"); + printf("dump time is unreasonable\n"); return (0); } return (1); @@ -618,7 +618,7 @@ check_space(void) spacefree = ((off_t) fsbuf.f_bavail * fsbuf.f_bsize) / 1024; totfree = ((off_t) fsbuf.f_bfree * fsbuf.f_bsize) / 1024; - (void)snprintf(path, sizeof(path), "%s/minfree", savedir); + snprintf(path, sizeof(path), "%s/minfree", savedir); if ((fp = fopen(path, "r")) == NULL) minfree = 0; else { @@ -626,7 +626,7 @@ check_space(void) minfree = 0; else minfree = atoi(buf); - (void)fclose(fp); + fclose(fp); } needed = (dumpsize + kernelsize) / 1024; @@ -699,7 +699,7 @@ DumpWrite(int fd, void *bp, int size, off_t off, int flag) while (size) { pos = off & ~(DUMPBUFSIZE - 1); Lseek(fd, pos, flag); - (void)Read(fd, buf, sizeof(buf)); + Read(fd, buf, sizeof(buf)); j = off & (DUMPBUFSIZE - 1); p = buf + j; i = size; @@ -707,7 +707,7 @@ DumpWrite(int fd, void *bp, int size, off_t off, int flag) i = DUMPBUFSIZE - j; memcpy(p, q, i); Lseek(fd, pos, flag); - (void)Write(fd, buf, sizeof(buf)); + Write(fd, buf, sizeof(buf)); size -= i; q += i; off += i; @@ -729,7 +729,7 @@ DumpRead(int fd, void *bp, int size, off_t off, int flag) while (size) { pos = off & ~(DUMPBUFSIZE - 1); Lseek(fd, pos, flag); - (void)Read(fd, buf, sizeof(buf)); + Read(fd, buf, sizeof(buf)); j = off & (DUMPBUFSIZE - 1); p = buf + j; i = size; @@ -756,6 +756,6 @@ Write(int fd, void *bp, int size) void usage(void) { - (void)syslog(LOG_ERR, "usage: savecore [-cfkvz] [-N system] directory"); + syslog(LOG_ERR, "usage: savecore [-cfkvz] [-N system] directory"); exit(1); } diff --git a/sbin/shutdown/shutdown.c b/sbin/shutdown/shutdown.c index 8e2149894b..aba5518ab0 100644 --- a/sbin/shutdown/shutdown.c +++ b/sbin/shutdown/shutdown.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1988, 1990, 1993 The Regents of the University of California. All rights reserved. * @(#)shutdown.c 8.4 (Berkeley) 4/28/95 * $FreeBSD: src/sbin/shutdown/shutdown.c,v 1.21.2.1 2001/07/30 10:38:08 dd Exp $ - * $DragonFly: src/sbin/shutdown/shutdown.c,v 1.4 2003/11/01 17:16:02 drhodus Exp $ + * $DragonFly: src/sbin/shutdown/shutdown.c,v 1.5 2004/12/18 21:43:46 swildner Exp $ */ #include @@ -186,17 +186,17 @@ main(int argc, char **argv) mbuflen = strlen(mbuf); if (offset) - (void)printf("Shutdown at %.24s.\n", ctime(&shuttime)); + printf("Shutdown at %.24s.\n", ctime(&shuttime)); else - (void)printf("Shutdown NOW!\n"); + printf("Shutdown NOW!\n"); if (!(whom = getlogin())) whom = (pw = getpwuid(getuid())) ? pw->pw_name : "???"; #ifdef DEBUG - (void)putc('\n', stdout); + putc('\n', stdout); #else - (void)setpriority(PRIO_PROCESS, 0, PRIO_MIN); + setpriority(PRIO_PROCESS, 0, PRIO_MIN); { int forkpid; @@ -228,7 +228,7 @@ loop(void) logged = 0; tp = tlist; if (tp->timeleft < offset) - (void)sleep((u_int)(offset - tp->timeleft)); + sleep((u_int)(offset - tp->timeleft)); else { while (tp->timeleft && offset < tp->timeleft) ++tp; @@ -239,7 +239,7 @@ loop(void) if ((sltime = offset - tp->timeleft)) { if (sltime > (u_int)(tp->timetowait / 5)) timewarn(offset); - (void)sleep(sltime); + sleep(sltime); } } for (;; ++tp) { @@ -248,7 +248,7 @@ loop(void) logged = 1; nolog(); } - (void)sleep((u_int)tp->timetowait); + sleep((u_int)tp->timetowait); if (!tp->timeleft) break; } @@ -272,44 +272,44 @@ timewarn(int timeleft) extern const char **environ; if (!first++) - (void)gethostname(hostname, sizeof(hostname)); + gethostname(hostname, sizeof(hostname)); /* undoc -n option to wall suppresses normal wall banner */ - (void)snprintf(wcmd, sizeof(wcmd), "%s -n", _PATH_WALL); + snprintf(wcmd, sizeof(wcmd), "%s -n", _PATH_WALL); environ = restricted_environ; if (!(pf = popen(wcmd, "w"))) { syslog(LOG_ERR, "shutdown: can't find %s: %m", _PATH_WALL); return; } - (void)fprintf(pf, + fprintf(pf, "\007*** %sSystem shutdown message from %s@%s ***\007\n", timeleft ? "": "FINAL ", whom, hostname); if (timeleft > 10*60) - (void)fprintf(pf, "System going down at %5.5s\n\n", + fprintf(pf, "System going down at %5.5s\n\n", ctime(&shuttime) + 11); else if (timeleft > 59) - (void)fprintf(pf, "System going down in %d minute%s\n\n", + fprintf(pf, "System going down in %d minute%s\n\n", timeleft / 60, (timeleft > 60) ? "s" : ""); else if (timeleft) - (void)fprintf(pf, "System going down in 30 seconds\n\n"); + fprintf(pf, "System going down in 30 seconds\n\n"); else - (void)fprintf(pf, "System going down IMMEDIATELY\n\n"); + fprintf(pf, "System going down IMMEDIATELY\n\n"); if (mbuflen) - (void)fwrite(mbuf, sizeof(*mbuf), mbuflen, pf); + fwrite(mbuf, sizeof(*mbuf), mbuflen, pf); /* * play some games, just in case wall doesn't come back * probably unnecessary, given that wall is careful. */ if (!setjmp(alarmbuf)) { - (void)signal(SIGALRM, timeout); - (void)alarm((u_int)30); - (void)pclose(pf); - (void)alarm((u_int)0); - (void)signal(SIGALRM, SIG_DFL); + signal(SIGALRM, timeout); + alarm((u_int)30); + pclose(pf); + alarm((u_int)0); + signal(SIGALRM, SIG_DFL); } } @@ -327,29 +327,29 @@ die_you_gravy_sucking_pig_dog(void) syslog(LOG_NOTICE, "%s by %s: %s", doreboot ? "reboot" : dohalt ? "halt" : dopower ? "power-down" : "shutdown", whom, mbuf); - (void)sleep(2); + sleep(2); - (void)printf("\r\nSystem shutdown time has arrived\007\007\r\n"); + printf("\r\nSystem shutdown time has arrived\007\007\r\n"); if (killflg) { - (void)printf("\rbut you'll have to do it yourself\r\n"); + printf("\rbut you'll have to do it yourself\r\n"); exit(0); } #ifdef DEBUG if (doreboot) - (void)printf("reboot"); + printf("reboot"); else if (dohalt) - (void)printf("halt"); + printf("halt"); else if (dopower) - (void)printf("power-down"); + printf("power-down"); if (nosync != NULL) - (void)printf(" no sync"); - (void)printf("\nkill -HUP 1\n"); + printf(" no sync"); + printf("\nkill -HUP 1\n"); #else if (!oflag) { - (void)kill(1, doreboot ? SIGINT : /* reboot */ - dohalt ? SIGUSR1 : /* halt */ - dopower ? SIGUSR2 : /* power-down */ - SIGTERM); /* single-user */ + kill(1, doreboot ? SIGINT : /* reboot */ + dohalt ? SIGUSR1 : /* halt */ + dopower ? SIGUSR2 : /* power-down */ + SIGTERM); /* single-user */ } else { if (doreboot) { execle(_PATH_REBOOT, "reboot", "-l", nosync, @@ -372,7 +372,7 @@ die_you_gravy_sucking_pig_dog(void) _PATH_HALT); warn(_PATH_HALT); } - (void)kill(1, SIGTERM); /* to single-user */ + kill(1, SIGTERM); /* to single-user */ } #endif finish(0); @@ -388,7 +388,7 @@ getoffset(char *timearg) time_t now; int this_year; - (void)time(&now); + time(&now); if (!strcasecmp(timearg, "now")) { /* now */ offset = 0; @@ -469,19 +469,19 @@ nolog(void) int logfd; char *ct; - (void)unlink(_PATH_NOLOGIN); /* in case linked to another file */ - (void)signal(SIGINT, finish); - (void)signal(SIGHUP, finish); - (void)signal(SIGQUIT, finish); - (void)signal(SIGTERM, finish); + unlink(_PATH_NOLOGIN); /* in case linked to another file */ + signal(SIGINT, finish); + signal(SIGHUP, finish); + signal(SIGQUIT, finish); + signal(SIGTERM, finish); if ((logfd = open(_PATH_NOLOGIN, O_WRONLY|O_CREAT|O_TRUNC, 0664)) >= 0) { - (void)write(logfd, NOMSG, sizeof(NOMSG) - 1); + write(logfd, NOMSG, sizeof(NOMSG) - 1); ct = ctime(&shuttime); - (void)write(logfd, ct + 11, 5); - (void)write(logfd, "\n\n", 2); - (void)write(logfd, mbuf, strlen(mbuf)); - (void)close(logfd); + write(logfd, ct + 11, 5); + write(logfd, "\n\n", 2); + write(logfd, mbuf, strlen(mbuf)); + close(logfd); } } @@ -489,7 +489,7 @@ void finish(int signo __unused) { if (!killflg) - (void)unlink(_PATH_NOLOGIN); + unlink(_PATH_NOLOGIN); exit(0); } @@ -504,7 +504,7 @@ usage(const char *cp) { if (cp != NULL) warnx("%s", cp); - (void)fprintf(stderr, + fprintf(stderr, "usage: shutdown [-] [-h | -p | -r | -k] [-o [-n]]" " time [warning-message ...]\n"); exit(1); diff --git a/sbin/slattach/slattach.c b/sbin/slattach/slattach.c index 94ad0eb9dc..79b81918f9 100644 --- a/sbin/slattach/slattach.c +++ b/sbin/slattach/slattach.c @@ -36,7 +36,7 @@ * @(#) Copyright (c) 1988 Regents of the University of California. All rights reserved. * @(#)slattach.c 4.6 (Berkeley) 6/1/90 * $FreeBSD: src/sbin/slattach/slattach.c,v 1.36 1999/08/28 00:14:25 peter Exp $ - * $DragonFly: src/sbin/slattach/slattach.c,v 1.4 2003/11/01 17:16:02 drhodus Exp $ + * $DragonFly: src/sbin/slattach/slattach.c,v 1.5 2004/12/18 21:43:46 swildner Exp $ */ #include @@ -243,11 +243,11 @@ void acquire_line(void) exit_handler(1); } - (void)close(STDIN_FILENO); /* close FDs before forking. */ - (void)close(STDOUT_FILENO); - (void)close(STDERR_FILENO); + close(STDIN_FILENO); /* close FDs before forking. */ + close(STDOUT_FILENO); + close(STDERR_FILENO); if (fd > 2) - (void)close(fd); + close(fd); signal(SIGHUP, SIG_IGN); /* ignore HUP signal when parent dies. */ if (daemon(0,0)) { /* fork, setsid, chdir /, and close std*. */ @@ -292,11 +292,11 @@ void acquire_line(void) syslog(LOG_ERR, "fcntl(F_SETFL) failed: %m"); exit_handler(1); } - (void)dup2(fd, STDIN_FILENO); - (void)dup2(fd, STDOUT_FILENO); - (void)dup2(fd, STDERR_FILENO); + dup2(fd, STDIN_FILENO); + dup2(fd, STDOUT_FILENO); + dup2(fd, STDERR_FILENO); if (fd > 2) - (void)close (fd); + close (fd); fd = STDIN_FILENO; /* acquire the serial line as a controlling terminal. */ @@ -560,7 +560,7 @@ void exit_handler(int ret) uu_unlock(dvname); /* Remove the PID file */ - (void)unlink(pidfilename); + unlink(pidfilename); if (config_cmd) { char *s; diff --git a/sbin/startslip/startslip.c b/sbin/startslip/startslip.c index d21ac8b332..253342dd14 100644 --- a/sbin/startslip/startslip.c +++ b/sbin/startslip/startslip.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1990, 1991, 1993 The Regents of the University of California. All rights reserved. * @(#)startslip.c 8.1 (Berkeley) 6/5/93 * $FreeBSD: src/sbin/startslip/startslip.c,v 1.31.2.1 2000/05/07 18:26:51 joe Exp $ - * $DragonFly: src/sbin/startslip/startslip.c,v 1.5 2004/09/22 08:38:09 joerg Exp $ + * $DragonFly: src/sbin/startslip/startslip.c,v 1.6 2004/12/18 21:43:46 swildner Exp $ */ #include @@ -246,7 +246,7 @@ restart: sprintf(buf, "LINE=%d %s %s down", diali ? (dialc - 1) % diali : 0, downscript ? downscript : "/sbin/ifconfig" , unitname); - (void) system(buf); + system(buf); logged_in = 0; } if (terminate) @@ -448,7 +448,7 @@ restart: sprintf(buf, "LINE=%d %s %s up", diali ? (dialc - 1) % diali : 0, upscript ? upscript : "/sbin/ifconfig" , unitname); - (void) system(buf); + system(buf); printd(", ready\n"); if (!first) @@ -578,7 +578,7 @@ down(int code) static void usage(void) { - (void)fprintf(stderr, "%s\n%s\n%s\n%s\n", + fprintf(stderr, "%s\n%s\n%s\n%s\n", "usage: startslip [-d] [-b speed] [-s string1 [-s string2 [...]]] [-h] [-l]", " [-L] [-A annexname] [-U upscript] [-D downscript]", " [-t script_timeout] [-W maxtries] [-w retry_pause]", diff --git a/sbin/sysctl/pathconf.c b/sbin/sysctl/pathconf.c index 562488fd18..888fbdb7d5 100644 --- a/sbin/sysctl/pathconf.c +++ b/sbin/sysctl/pathconf.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1993 The Regents of the University of California. All rights reserved. * @(#)pathconf.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/sbin/sysctl/pathconf.c,v 1.4 1999/08/28 00:14:30 peter Exp $ - * $DragonFly: src/sbin/sysctl/Attic/pathconf.c,v 1.4 2003/11/01 17:16:02 drhodus Exp $ + * $DragonFly: src/sbin/sysctl/Attic/pathconf.c,v 1.5 2004/12/18 21:43:46 swildner Exp $ */ #include @@ -216,7 +216,7 @@ static void usage(void) { - (void)fprintf(stderr, "%s\n%s\n%s\n", + fprintf(stderr, "%s\n%s\n%s\n", "usage: pathname [-n] variable ...", " pathname [-n] -a", " pathname [-n] -A"); diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index 540f9159a9..fa7ab9ba6b 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1993 The Regents of the University of California. All rights reserved. * @(#)from: sysctl.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/sbin/sysctl/sysctl.c,v 1.25.2.11 2003/05/01 22:48:08 trhodes Exp $ - * $DragonFly: src/sbin/sysctl/sysctl.c,v 1.5 2004/05/31 14:59:34 hmp Exp $ + * $DragonFly: src/sbin/sysctl/sysctl.c,v 1.6 2004/12/18 21:43:46 swildner Exp $ */ #ifdef __i386__ @@ -68,7 +68,7 @@ static void usage(void) { - (void)fprintf(stderr, "%s\n%s\n", + fprintf(stderr, "%s\n%s\n", "usage: sysctl [-bdeNnox] variable[=value] ...", " sysctl [-bdeNnox] -a"); exit(1); diff --git a/sbin/tunefs/tunefs.c b/sbin/tunefs/tunefs.c index e7a09a41e0..633f992287 100644 --- a/sbin/tunefs/tunefs.c +++ b/sbin/tunefs/tunefs.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1983, 1993 The Regents of the University of California. All rights reserved. * @(#)tunefs.c 8.2 (Berkeley) 4/19/94 * $FreeBSD: src/sbin/tunefs/tunefs.c,v 1.11.2.5 2001/10/14 21:50:39 iedowse Exp $ - * $DragonFly: src/sbin/tunefs/tunefs.c,v 1.5 2003/11/01 17:16:02 drhodus Exp $ + * $DragonFly: src/sbin/tunefs/tunefs.c,v 1.6 2004/12/18 21:43:46 swildner Exp $ */ /* @@ -105,8 +105,8 @@ again: if (*special != '/') { if (*special == 'r') special++; - (void)snprintf(device, sizeof(device), "%s%s", - _PATH_DEV, special); + snprintf(device, sizeof(device), "%s%s", + _PATH_DEV, special); special = device; goto again; } diff --git a/sbin/umount/umount.c b/sbin/umount/umount.c index ec7d88685a..eb533c9d93 100644 --- a/sbin/umount/umount.c +++ b/sbin/umount/umount.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1980, 1989, 1993 The Regents of the University of California. All rights reserved. * @(#)umount.c 8.8 (Berkeley) 5/8/95 * $FreeBSD: src/sbin/umount/umount.c,v 1.22.2.1 2001/12/13 01:27:15 iedowse Exp $ - * $DragonFly: src/sbin/umount/umount.c,v 1.2 2003/06/17 04:27:34 dillon Exp $ + * $DragonFly: src/sbin/umount/umount.c,v 1.3 2004/12/18 21:43:46 swildner Exp $ */ #include @@ -172,7 +172,7 @@ main(int argc, char *argv[]) errs = 1; break; } - (void)getmntname(NULL, NULL, NOTHING, NULL, FREE); + getmntname(NULL, NULL, NOTHING, NULL, FREE); exit(errs); } @@ -218,7 +218,7 @@ umountall(char **typelist) */ if ((cp = malloc((size_t)strlen(fs->fs_file) + 1)) == NULL) err(1, "malloc failed"); - (void)strcpy(cp, fs->fs_file); + strcpy(cp, fs->fs_file); rval = umountall(typelist); rval = umountfs(cp, typelist) || rval; free(cp); @@ -251,7 +251,7 @@ umountfs(char *name, char **typelist) /* * 1. Check if the name exists in the mounttable. */ - (void)checkmntlist(name, &mntfromname, &mntonname, &type); + checkmntlist(name, &mntfromname, &mntonname, &type); /* * 2. Remove trailing slashes if there are any. After that * we look up the name in the mounttable again. @@ -262,7 +262,7 @@ umountfs(char *name, char **typelist) speclen > 1 && name[speclen - 1] == '/'; speclen--) name[speclen - 1] = '\0'; - (void)checkmntlist(name, &mntfromname, &mntonname, &type); + checkmntlist(name, &mntfromname, &mntonname, &type); resolved = name; /* Save off original name in origname */ if ((origname = strdup(name)) == NULL) @@ -295,7 +295,7 @@ umountfs(char *name, char **typelist) speclen--) name[speclen - 1] = '\0'; name[len + speclen + 1] = '\0'; - (void)checkmntlist(name, &mntfromname, + checkmntlist(name, &mntfromname, &mntonname, &type); resolved = name; } @@ -308,9 +308,9 @@ umountfs(char *name, char **typelist) * Check the name in mounttable one last time. */ if (mntfromname == NULL && mntonname == NULL) { - (void)strcpy(name, origname); + strcpy(name, origname); if ((getrealname(name, realname)) != NULL) { - (void)checkmntlist(realname, + checkmntlist(realname, &mntfromname, &mntonname, &type); resolved = realname; } @@ -318,7 +318,7 @@ umountfs(char *name, char **typelist) * All tests failed, return to main() */ if (mntfromname == NULL && mntonname == NULL) { - (void)strcpy(name, origname); + strcpy(name, origname); warnx("%s: not currently mounted", origname); free(origname); @@ -358,7 +358,7 @@ umountfs(char *name, char **typelist) /* * Mark the uppermost mount as unmounted. */ - (void)getmntname(mntfromname, mntonname, NOTHING, &type, MARK); + getmntname(mntfromname, mntonname, NOTHING, &type, MARK); /* * If several equal mounts are in the mounttable, check the order * and warn the user if necessary. @@ -370,7 +370,7 @@ umountfs(char *name, char **typelist) mntonname, mntfromnamerev); /* call getmntname again to set mntcheck[i] to 0 */ - (void)getmntname(mntfromname, mntonname, + getmntname(mntfromname, mntonname, NOTHING, &type, UNMARK); return (1); } @@ -394,7 +394,7 @@ umountfs(char *name, char **typelist) return (1); } if (vflag) - (void)printf("%s: unmount from %s\n", mntfromname, mntonname); + printf("%s: unmount from %s\n", mntfromname, mntonname); /* * Report to mountd-server which nfsname * has been unmounted. @@ -624,7 +624,7 @@ getrealname(char *name, char *realname) } } else { if (ISDOT(name) || ISDOTDOT(name)) - (void)realpath(name, realname); + realpath(name, realname); else { if ((dirname = strrchr(name, '/')) == NULL) { if ((realpath(name, realname)) == NULL) @@ -678,7 +678,7 @@ void usage() { - (void)fprintf(stderr, "%s\n%s\n", + fprintf(stderr, "%s\n%s\n", "usage: umount [-fv] special | node", " umount -a | -A [-fv] [-h host] [-t type]"); exit(1);