diff options
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/ipfw/tables.c | 9 | ||||
-rw-r--r-- | sbin/ping6/ping6.c | 7 | ||||
-rw-r--r-- | sbin/umount/umount.8 | 15 | ||||
-rw-r--r-- | sbin/umount/umount.c | 16 |
4 files changed, 29 insertions, 18 deletions
diff --git a/sbin/ipfw/tables.c b/sbin/ipfw/tables.c index 2264e32..d14c9e9 100644 --- a/sbin/ipfw/tables.c +++ b/sbin/ipfw/tables.c @@ -914,9 +914,10 @@ table_modify_record(ipfw_obj_header *oh, int ac, char *av[], int add, xi.vmask = vmask; strlcpy(xi.tablename, oh->ntlv.name, sizeof(xi.tablename)); - fprintf(stderr, "DEPRECATED: inserting data into " - "non-existent table %s. (auto-created)\n", - xi.tablename); + if (quiet == 0) + warnx("DEPRECATED: inserting data into " + "non-existent table %s. (auto-created)", + xi.tablename); table_do_create(oh, &xi); } @@ -937,8 +938,6 @@ table_modify_record(ipfw_obj_header *oh, int ac, char *av[], int add, error = table_do_modify_record(cmd, oh, tent_buf, count, atomic); - quiet = 0; - /* * Compatibility stuff: do not yell on duplicate keys or * failed deletions. diff --git a/sbin/ping6/ping6.c b/sbin/ping6/ping6.c index 732e634..51a154d 100644 --- a/sbin/ping6/ping6.c +++ b/sbin/ping6/ping6.c @@ -515,7 +515,6 @@ main(int argc, char *argv[]) memcpy(&src, res->ai_addr, res->ai_addrlen); srclen = res->ai_addrlen; freeaddrinfo(res); - res = NULL; options |= F_SRCADDR; break; case 's': /* size of packet to send */ @@ -631,7 +630,7 @@ main(int argc, char *argv[]) if (error) errx(1, "%s", gai_strerror(error)); if (res->ai_canonname) - hostname = res->ai_canonname; + hostname = strdup(res->ai_canonname); else hostname = target; @@ -643,6 +642,7 @@ main(int argc, char *argv[]) if ((s = socket(res->ai_family, res->ai_socktype, res->ai_protocol)) < 0) err(1, "socket"); + freeaddrinfo(res); /* set the source address if specified. */ if ((options & F_SRCADDR) != 0) { @@ -1208,9 +1208,6 @@ main(int argc, char *argv[]) sigaction(SIGALRM, &si_sa, 0); summary(); - if (res != NULL) - freeaddrinfo(res); - if(packet != NULL) free(packet); diff --git a/sbin/umount/umount.8 b/sbin/umount/umount.8 index 2ddbf5a..0f672b8 100644 --- a/sbin/umount/umount.8 +++ b/sbin/umount/umount.8 @@ -28,7 +28,7 @@ .\" @(#)umount.8 8.2 (Berkeley) 5/8/95 .\" $FreeBSD$ .\" -.Dd June 17, 2015 +.Dd July 7, 2016 .Dt UMOUNT 8 .Os .Sh NAME @@ -36,12 +36,12 @@ .Nd unmount file systems .Sh SYNOPSIS .Nm -.Op Fl fv +.Op Fl fnv .Ar special ... | node ... | fsid ... .Nm .Fl a | A .Op Fl F Ar fstab -.Op Fl fv +.Op Fl fnv .Op Fl h Ar host .Op Fl t Ar type .Sh DESCRIPTION @@ -94,6 +94,15 @@ option and, unless otherwise specified with the option, will only unmount .Tn NFS file systems. +.It Fl n +Unless the +.Fl f +is used, the +.Nm +will not unmount an active file system. +It will, however, perform a flush. +This flag disables this behaviour, preventing the flush +if there are any files open. .It Fl t Ar type Is used to indicate the actions should only be taken on file systems of the specified type. diff --git a/sbin/umount/umount.c b/sbin/umount/umount.c index 6cd8ea7..20b7804 100644 --- a/sbin/umount/umount.c +++ b/sbin/umount/umount.c @@ -91,7 +91,7 @@ main(int argc, char *argv[]) struct addrinfo hints; all = errs = 0; - while ((ch = getopt(argc, argv, "AaF:fh:t:v")) != -1) + while ((ch = getopt(argc, argv, "AaF:fh:nt:v")) != -1) switch (ch) { case 'A': all = 2; @@ -103,12 +103,15 @@ main(int argc, char *argv[]) setfstab(optarg); break; case 'f': - fflag = MNT_FORCE; + fflag |= MNT_FORCE; break; case 'h': /* -h implies -A. */ all = 2; nfshost = optarg; break; + case 'n': + fflag |= MNT_NONBUSY; + break; case 't': if (typelist != NULL) err(1, "only one -t option may be specified"); @@ -124,8 +127,11 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; + if ((fflag & MNT_FORCE) != 0 && (fflag & MNT_NONBUSY) != 0) + err(1, "-f and -n are mutually exclusive"); + /* Start disks transferring immediately. */ - if ((fflag & MNT_FORCE) == 0) + if ((fflag & (MNT_FORCE | MNT_NONBUSY)) == 0) sync(); if ((argc == 0 && !all) || (argc != 0 && all)) @@ -609,7 +615,7 @@ usage(void) { (void)fprintf(stderr, "%s\n%s\n", - "usage: umount [-fv] special ... | node ... | fsid ...", - " umount -a | -A [-F fstab] [-fv] [-h host] [-t type]"); + "usage: umount [-fnv] special ... | node ... | fsid ...", + " umount -a | -A [-F fstab] [-fnv] [-h host] [-t type]"); exit(1); } |