diff options
author | gjb <gjb@FreeBSD.org> | 2016-04-11 15:24:59 +0000 |
---|---|---|
committer | gjb <gjb@FreeBSD.org> | 2016-04-11 15:24:59 +0000 |
commit | e0e3598ce13850597a66fd28d102b36881f7d610 (patch) | |
tree | f5194d1ce3fa45b67cf63080fc519fec83abc57a /usr.sbin | |
parent | cbc3bd9845ba5fd58e8132f9565cfbc41433938d (diff) | |
parent | 26836fccd261358467b3d92e77ff4695af286de9 (diff) | |
download | FreeBSD-src-e0e3598ce13850597a66fd28d102b36881f7d610.zip FreeBSD-src-e0e3598ce13850597a66fd28d102b36881f7d610.tar.gz |
MFH
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/bhyve/Makefile | 4 | ||||
-rwxr-xr-x | usr.sbin/bsdinstall/scripts/zfsboot | 6 | ||||
-rw-r--r-- | usr.sbin/etcupdate/tests/tzsetup_test.sh | 2 | ||||
-rw-r--r-- | usr.sbin/lpr/chkprintcap/chkprintcap.c | 8 | ||||
-rw-r--r-- | usr.sbin/lpr/common_source/common.c | 4 | ||||
-rw-r--r-- | usr.sbin/lpr/common_source/net.c | 2 | ||||
-rw-r--r-- | usr.sbin/lpr/common_source/printcap.c | 8 | ||||
-rw-r--r-- | usr.sbin/lpr/common_source/request.c | 4 | ||||
-rw-r--r-- | usr.sbin/lpr/common_source/rmjob.c | 2 | ||||
-rw-r--r-- | usr.sbin/lpr/lpc/lpc.c | 12 | ||||
-rw-r--r-- | usr.sbin/lpr/lpd/printjob.c | 6 |
11 files changed, 31 insertions, 27 deletions
diff --git a/usr.sbin/bhyve/Makefile b/usr.sbin/bhyve/Makefile index e1992a7..d85403c 100644 --- a/usr.sbin/bhyve/Makefile +++ b/usr.sbin/bhyve/Makefile @@ -9,6 +9,8 @@ DEBUG_FLAGS= -g -O0 MAN= bhyve.8 +SYSDIR?=${.CURDIR}/../.. + SRCS= \ atkbdc.c \ acpi.c \ @@ -43,7 +45,7 @@ SRCS= \ xmsr.c \ spinup_ap.c -.PATH: ${.CURDIR}/../../sys/amd64/vmm +.PATH: ${SYSDIR}/sys/amd64/vmm SRCS+= vmm_instruction_emul.c LIBADD= vmmapi md pthread diff --git a/usr.sbin/bsdinstall/scripts/zfsboot b/usr.sbin/bsdinstall/scripts/zfsboot index 4dedbf0..415afb6 100755 --- a/usr.sbin/bsdinstall/scripts/zfsboot +++ b/usr.sbin/bsdinstall/scripts/zfsboot @@ -964,6 +964,8 @@ zfs_create_diskpart() f_expand_number "$ZFSBOOT_SWAP_SIZE" swapsize if [ "$isswapmirror" ]; then # This is not the first disk in the mirror, do nothing + elif [ ${swapsize:-0} -eq 0 ]; then + # If swap is 0 sized, don't add it to fstab elif [ "$ZFSBOOT_SWAP_ENCRYPTION" -a "$ZFSBOOT_SWAP_MIRROR" ]; then f_eval_catch $funcname printf "$PRINTF_FSTAB" \ /dev/mirror/swap.eli none swap sw 0 0 \ @@ -981,8 +983,6 @@ zfs_create_diskpart() /dev/$disk${swappart}.eli none swap sw 0 0 \ $BSDINSTALL_TMPETC/fstab || return $FAILURE - elif [ ${swapsize:-0} -eq 0 ]; then - # If swap is 0 sized, don't add it to fstab else f_eval_catch $funcname printf "$PRINTF_FSTAB" \ /dev/$disk$swappart none swap sw 0 0 \ @@ -1256,6 +1256,8 @@ zfs_create_boot() f_dprintf "$funcname: Modifying directory permissions..." local dir for dir in /tmp /var/tmp; do + f_eval_catch $funcname mkdir "$MKDIR_P" \ + $BSDINSTALL_CHROOT$dir || return $FAILURE f_eval_catch $funcname chmod "$CHMOD_MODE" 1777 \ $BSDINSTALL_CHROOT$dir || return $FAILURE done diff --git a/usr.sbin/etcupdate/tests/tzsetup_test.sh b/usr.sbin/etcupdate/tests/tzsetup_test.sh index dbdcc0e..5d3fe89 100644 --- a/usr.sbin/etcupdate/tests/tzsetup_test.sh +++ b/usr.sbin/etcupdate/tests/tzsetup_test.sh @@ -196,7 +196,7 @@ $COMMAND -nr -d $WORKDIR -D $TEST > $WORKDIR/testn.out cat > $WORKDIR/correct.out <<EOF Warnings: - Needs update: /etc/localtime (required manual update via tzsetup(1)) + Needs update: /etc/localtime (required manual update via tzsetup(8)) EOF echo "Differences for missing /var/db/zoneinfo with -n:" diff --git a/usr.sbin/lpr/chkprintcap/chkprintcap.c b/usr.sbin/lpr/chkprintcap/chkprintcap.c index 91e8299..96fe489 100644 --- a/usr.sbin/lpr/chkprintcap/chkprintcap.c +++ b/usr.sbin/lpr/chkprintcap/chkprintcap.c @@ -222,7 +222,7 @@ note_spool_dir(const struct printer *pp, const struct stat *st) struct dirlist *dp, *dp2, *last; dp = malloc(sizeof *dp); - if (dp == 0) + if (dp == NULL) err(++problems, "malloc(%lu)", (u_long)sizeof *dp); dp->stab = *st; @@ -233,7 +233,7 @@ note_spool_dir(const struct printer *pp, const struct stat *st) if (dp->path == 0) err(++problems, "malloc(%lu)", strlen(pp->spool_dir) + 1UL); - last = 0; + last = NULL; LIST_FOREACH(dp2, &dirlist, link) { if(!lessp(dp, dp2)) break; @@ -255,7 +255,7 @@ check_spool_dirs(void) for (dp = LIST_FIRST(&dirlist); dp; dp = dp2) { dp2 = LIST_NEXT(dp, link); - if (dp2 != 0 && equal(dp, dp2)) { + if (dp2 != NULL && equal(dp, dp2)) { ++problems; if (strcmp(dp->path, dp2->path) == 0) { warnx("%s and %s share the same spool, %s", @@ -289,7 +289,7 @@ make_spool_dir(const struct printer *pp) return; } gr = getgrnam("daemon"); - if (gr == 0) + if (gr == NULL) errx(++problems, "cannot locate daemon group"); if (chown(sd, pp->daemon_user, gr->gr_gid) < 0) { diff --git a/usr.sbin/lpr/common_source/common.c b/usr.sbin/lpr/common_source/common.c index 52d6c9f..ce0ba7c 100644 --- a/usr.sbin/lpr/common_source/common.c +++ b/usr.sbin/lpr/common_source/common.c @@ -282,7 +282,7 @@ lock_file_name(const struct printer *pp, char *buf, size_t len) { static char staticbuf[MAXPATHLEN]; - if (buf == 0) + if (buf == NULL) buf = staticbuf; if (len == 0) len = MAXPATHLEN; @@ -300,7 +300,7 @@ status_file_name(const struct printer *pp, char *buf, size_t len) { static char staticbuf[MAXPATHLEN]; - if (buf == 0) + if (buf == NULL) buf = staticbuf; if (len == 0) len = MAXPATHLEN; diff --git a/usr.sbin/lpr/common_source/net.c b/usr.sbin/lpr/common_source/net.c index ab6fa16..c495bbb 100644 --- a/usr.sbin/lpr/common_source/net.c +++ b/usr.sbin/lpr/common_source/net.c @@ -280,7 +280,7 @@ writel(int strm, ...) if (n > NIOV) { iovp = malloc(n * sizeof *iovp); - if (iovp == 0) + if (iovp == NULL) return -1; } diff --git a/usr.sbin/lpr/common_source/printcap.c b/usr.sbin/lpr/common_source/printcap.c index 0d3644b..707b7b8 100644 --- a/usr.sbin/lpr/common_source/printcap.c +++ b/usr.sbin/lpr/common_source/printcap.c @@ -220,7 +220,7 @@ getprintcap_int(char *bp, struct printer *pp) char *rp_name; int error; - if ((pp->printer = capdb_canonical_name(bp)) == 0) + if ((pp->printer = capdb_canonical_name(bp)) == NULL) return PCAPERR_OSERR; #define CHK(x) do {if ((x) == PCAPERR_OSERR) return PCAPERR_OSERR;}while(0) @@ -386,7 +386,7 @@ capdb_getaltstr(char *bp, const char *shrt, const char *lng, return status; if (dflt) { *result = strdup(dflt); - if (*result == 0) + if (*result == NULL) return PCAPERR_OSERR; return strlen(*result); } @@ -439,9 +439,9 @@ capdb_canonical_name(const char *bp) const char *nameend; nameend = strpbrk(bp, "|:"); - if (nameend == 0) + if (nameend == NULL) nameend = bp + 1; - if ((retval = malloc(nameend - bp + 1)) != 0) { + if ((retval = malloc(nameend - bp + 1)) != NULL) { retval[0] = '\0'; strncat(retval, bp, nameend - bp); } diff --git a/usr.sbin/lpr/common_source/request.c b/usr.sbin/lpr/common_source/request.c index b650e5c..0c68fe9 100644 --- a/usr.sbin/lpr/common_source/request.c +++ b/usr.sbin/lpr/common_source/request.c @@ -69,11 +69,11 @@ free_request(struct request *rp) free(rp->prettyname); if (rp->authinfo) free(rp->authinfo); - while ((ru = TAILQ_FIRST(&rp->users)) != 0) { + while ((ru = TAILQ_FIRST(&rp->users)) != NULL) { TAILQ_REMOVE(&rp->users, ru, ru_link); free(ru); } - while ((rj = TAILQ_FIRST(&rp->jobids)) != 0) { + while ((rj = TAILQ_FIRST(&rp->jobids)) != NULL) { TAILQ_REMOVE(&rp->jobids, rj, rj_link); free(rj); } diff --git a/usr.sbin/lpr/common_source/rmjob.c b/usr.sbin/lpr/common_source/rmjob.c index c89a6f0..96f20be 100644 --- a/usr.sbin/lpr/common_source/rmjob.c +++ b/usr.sbin/lpr/common_source/rmjob.c @@ -332,7 +332,7 @@ rmremote(const struct printer *pp) else niov = 4 + requests + 1; iov = malloc(niov * sizeof *iov); - if (iov == 0) + if (iov == NULL) fatal(pp, "out of memory in rmremote()"); iov[0].iov_base = "\5"; iov[1].iov_base = pp->remote_queue; diff --git a/usr.sbin/lpr/lpc/lpc.c b/usr.sbin/lpr/lpc/lpc.c index cc58bd9..5b5ec78 100644 --- a/usr.sbin/lpr/lpc/lpc.c +++ b/usr.sbin/lpr/lpc/lpc.c @@ -103,7 +103,7 @@ main(int argc, char *argv[]) printf("?Ambiguous command\n"); exit(1); } - if (c == 0) { + if (c == NULL) { printf("?Invalid command\n"); exit(1); } @@ -112,7 +112,7 @@ main(int argc, char *argv[]) printf("?Privileged command\n"); exit(1); } - if (c->c_generic != 0) + if (c->c_generic != NULL) generic(c->c_generic, c->c_opts, c->c_handler, argc, argv); else @@ -205,7 +205,7 @@ cmdscanner(void) printf("?Ambiguous command\n"); continue; } - if (c == 0) { + if (c == NULL) { printf("?Invalid command\n"); continue; } @@ -222,7 +222,7 @@ cmdscanner(void) * routine might also be set on a generic routine for * initial parameter processing. */ - if (c->c_generic != 0) + if (c->c_generic != NULL) generic(c->c_generic, c->c_opts, c->c_handler, margc, margv); else @@ -239,7 +239,7 @@ getcmd(const char *name) longest = 0; nmatches = 0; - found = 0; + found = NULL; for (c = cmdtab; (p = c->c_name); c++) { for (q = name; *q == *p++; q++) if (*q == 0) /* exact match? */ @@ -283,7 +283,7 @@ makeargv(void) break; *cp++ = '\0'; } - *argp++ = 0; + *argp++ = NULL; } #define HELPINDENT (sizeof ("directory")) diff --git a/usr.sbin/lpr/lpd/printjob.c b/usr.sbin/lpr/lpd/printjob.c index 06ea1b0..b388b96 100644 --- a/usr.sbin/lpr/lpd/printjob.c +++ b/usr.sbin/lpr/lpd/printjob.c @@ -673,7 +673,7 @@ print(struct printer *pp, int format, char *file) av[i++] = "-L"; av[i++] = *locale ? locale : "C"; av[i++] = "-F"; - av[i] = 0; + av[i] = NULL; fo = ofd; goto start; } @@ -795,7 +795,7 @@ print(struct printer *pp, int format, char *file) av[n++] = "-h"; av[n++] = origin_host; av[n++] = pp->acct_file; - av[n] = 0; + av[n] = NULL; fo = pfd; if (of_pid > 0) { /* stop output filter */ write(ofd, "\031\1", 2); @@ -1737,7 +1737,7 @@ init(struct printer *pp) sprintf(&length[2], "%ld", pp->page_length); sprintf(&pxwidth[2], "%ld", pp->page_pwidth); sprintf(&pxlength[2], "%ld", pp->page_plength); - if ((s = checkremote(pp)) != 0) { + if ((s = checkremote(pp)) != NULL) { syslog(LOG_WARNING, "%s", s); free(s); } |