diff options
author | Renato Botelho <renato@netgate.com> | 2015-10-21 16:04:13 -0200 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2015-10-21 16:04:13 -0200 |
commit | 6dfdfbb12b356dae762c3bce132809457ed60d97 (patch) | |
tree | 4e87edfd6f7353e79d923ab457270e9351daec3d /sbin | |
parent | 13010d6b0da4d97e56243edbea0a585b8285cd3e (diff) | |
parent | d621159ed6a7d1c98cf81f17e313dffc64bf7c4f (diff) | |
download | FreeBSD-src-6dfdfbb12b356dae762c3bce132809457ed60d97.zip FreeBSD-src-6dfdfbb12b356dae762c3bce132809457ed60d97.tar.gz |
Merge branch 'stable/10' into devel
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/geom/class/nop/geom_nop.c | 6 | ||||
-rw-r--r-- | sbin/geom/class/nop/gnop.8 | 8 | ||||
-rw-r--r-- | sbin/init/init.8 | 3 | ||||
-rw-r--r-- | sbin/ipf/Makefile | 5 | ||||
-rw-r--r-- | sbin/ipf/ipftest/Makefile | 24 | ||||
-rw-r--r-- | sbin/ipf/iptest/Makefile | 11 | ||||
-rw-r--r-- | sbin/ipf/rules/Makefile | 17 | ||||
-rw-r--r-- | sbin/mdconfig/mdconfig.8 | 103 | ||||
-rw-r--r-- | sbin/mdconfig/mdconfig.c | 10 | ||||
-rw-r--r-- | sbin/mount_unionfs/mount_unionfs.8 | 4 | ||||
-rw-r--r-- | sbin/newfs_msdos/newfs_msdos.c | 62 | ||||
-rw-r--r-- | sbin/sysctl/sysctl.c | 12 |
12 files changed, 139 insertions, 126 deletions
diff --git a/sbin/geom/class/nop/geom_nop.c b/sbin/geom/class/nop/geom_nop.c index 25163cc..f05a522 100644 --- a/sbin/geom/class/nop/geom_nop.c +++ b/sbin/geom/class/nop/geom_nop.c @@ -43,14 +43,16 @@ struct g_command class_commands[] = { { { 'e', "error", "-1", G_TYPE_NUMBER }, { 'o', "offset", "0", G_TYPE_NUMBER }, + { 'p', "stripesize", "0", G_TYPE_NUMBER }, + { 'P', "stripeoffset", "0", G_TYPE_NUMBER }, { 'r', "rfailprob", "-1", G_TYPE_NUMBER }, { 's', "size", "0", G_TYPE_NUMBER }, { 'S', "secsize", "0", G_TYPE_NUMBER }, { 'w', "wfailprob", "-1", G_TYPE_NUMBER }, G_OPT_SENTINEL }, - "[-v] [-e error] [-o offset] [-r rfailprob] [-s size] " - "[-S secsize] [-w wfailprob] dev ..." + "[-v] [-e error] [-o offset] [-p stripesize] [-P stripeoffset] " + "[-r rfailprob] [-s size] [-S secsize] [-w wfailprob] dev ..." }, { "configure", G_FLAG_VERBOSE, NULL, { diff --git a/sbin/geom/class/nop/gnop.8 b/sbin/geom/class/nop/gnop.8 index 2bcbef3..0103579 100644 --- a/sbin/geom/class/nop/gnop.8 +++ b/sbin/geom/class/nop/gnop.8 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 14, 2013 +.Dd September 15, 2015 .Dt GNOP 8 .Os .Sh NAME @@ -36,6 +36,8 @@ .Op Fl v .Op Fl e Ar error .Op Fl o Ar offset +.Op Fl p Ar stripesize +.Op Fl P Ar stripeoffset .Op Fl r Ar rfailprob .Op Fl s Ar size .Op Fl S Ar secsize @@ -115,6 +117,10 @@ Specifies the error number to return on failure. Force the removal of the specified provider. .It Fl o Ar offset Where to begin on the original provider. +.It Fl p Ar stripesize +Value of the stripesize property of the transparent provider. +.It Fl P Ar stripeoffset +Value of the stripeoffset property of the transparent provider. .It Fl r Ar rfailprob Specifies read failure probability in percent. .It Fl s Ar size diff --git a/sbin/init/init.8 b/sbin/init/init.8 index a7488a9..13659e3 100644 --- a/sbin/init/init.8 +++ b/sbin/init/init.8 @@ -31,7 +31,7 @@ .\" @(#)init.8 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd March 14, 2012 +.Dd July 24, 2015 .Dt INIT 8 .Os .Sh NAME @@ -284,6 +284,7 @@ will signal the original as follows: .Bl -column Run-level SIGTERM .It Sy "Run-level Signal Action" +.It Cm 0 Ta Dv SIGUSR1 Ta "Halt" .It Cm 0 Ta Dv SIGUSR2 Ta "Halt and turn the power off" .It Cm 1 Ta Dv SIGTERM Ta "Go to single-user mode" .It Cm 6 Ta Dv SIGINT Ta "Reboot the machine" diff --git a/sbin/ipf/Makefile b/sbin/ipf/Makefile index df57c80..8b10c98 100644 --- a/sbin/ipf/Makefile +++ b/sbin/ipf/Makefile @@ -1,8 +1,7 @@ # $FreeBSD$ -#.WAIT -SUBDIR= libipf +SUBDIR= libipf .WAIT SUBDIR+= ipf ipfs ipfstat ipftest ipmon ipnat ippool ipresend -#SUBDIR+= ipsend iptest rules +SUBDIR_PARALLEL= .include <bsd.subdir.mk> diff --git a/sbin/ipf/ipftest/Makefile b/sbin/ipf/ipftest/Makefile index 32b074c..7d8260a 100644 --- a/sbin/ipf/ipftest/Makefile +++ b/sbin/ipf/ipftest/Makefile @@ -32,15 +32,19 @@ CLEANFILES+= ipnat.tab.c ipnat.tab.h CLEANFILES+= ippool_y.c ippool_l.c CLEANFILES+= ippool.tab.c ippool.tab.h -ipnat_y.c: ipnat_y.y +ipnat.tab.c ipnat.tab.h: ipnat_y.y ${YACC} -b ipnat -d ${.ALLSRC} + +ipnat_y.c: ipnat.tab.c sed -e 's/yy/ipnat_yy/g' \ -e 's/y.tab.c/ipnat_y.c/' \ -e s/\"ipnat_y.y\"/\"..\\/tools\\/ipnat_y.y\"/ \ ipnat.tab.c > ${.TARGET} + +ipnat_y.h: ipnat.tab.h sed -e 's/yy/ipnat_yy/g' \ -e 's/y.tab.h/ipnat_y.h/' \ - ipnat.tab.h > ${.TARGET:.c=.h} + ipnat.tab.h > ${.TARGET} ipnat_y.h: ipnat_y.c @@ -54,13 +58,17 @@ ipnat_l.h: lexer.h sed -e 's/yy/ipnat_yy/g' \ ${.ALLSRC} > ${.TARGET} -ippool_y.c: ippool_y.y +ippool.tab.c ippool.tab.h: ippool_y.y ${YACC} -b ippool -d ${.ALLSRC} + +ippool_y.c: ippool.tab.c sed -e 's/yy/ippool_yy/g' \ -e 's/"ippool_y.y"/"..\/tools\/ippool_y.y"/' \ ippool.tab.c > ${.TARGET} + +ippool_y.h: ippool.tab.h sed -e 's/yy/ippool_yy/g' \ - ippool.tab.h > ${.TARGET:.c=.h} + ippool.tab.h > ${.TARGET} ippool_y.h: ippool_y.c @@ -74,13 +82,17 @@ ippool_l.h: lexer.h sed -e 's/yy/ippool_yy/g' \ ${.ALLSRC} > ${.TARGET} -ipf_y.c: ipf_y.y +ipf.tab.c ipf.tab.h: ipf_y.y ${YACC} -b ipf -d ${.ALLSRC} + +ipf_y.c: ipf.tab.c sed -e 's/yy/ipf_yy/g' \ -e 's/"ipf_y.y"/"..\/tools\/ipf_y.y"/' \ ipf.tab.c > ${.TARGET} + +ipf_y.h: ipf.tab.h sed -e 's/yy/ipf_yy/g' \ - ipf.tab.h > ${.TARGET:.c=.h} + ipf.tab.h > ${.TARGET} ipf_y.h: ipf_y.c diff --git a/sbin/ipf/iptest/Makefile b/sbin/ipf/iptest/Makefile deleted file mode 100644 index 647471c..0000000 --- a/sbin/ipf/iptest/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -# $FreeBSD$ - -.include <bsd.own.mk> - -PROG= iptest -SRCS= iptest.c iptests.c ip.c sbpf.c sock.c 44arp.c -MAN= iptest.1 - -.PATH: ${NETBSDSRCDIR}/dist/ipf/ipsend - -.include <bsd.prog.mk> diff --git a/sbin/ipf/rules/Makefile b/sbin/ipf/rules/Makefile deleted file mode 100644 index a90907f..0000000 --- a/sbin/ipf/rules/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -# $FreeBSD$ - -.include <bsd.own.mk> - -MAN= mkfilters.1 -.if ${MKSHARE} != "no" -FILESDIR= /usr/share/examples/ipf - -FILES= BASIC.NAT BASIC_1.FW BASIC_2.FW example.1 example.2 example.3 \ - example.4 example.5 example.6 example.7 example.8 example.9 \ - example.10 example.11 example.12 example.13 example.sr \ - firewall ftp-proxy ftppxy mediaone nat-setup \ - nat.eg server tcpstate mkfilters -.endif - -.PATH: ${NETBSDSRCDIR}/dist/ipf/rules -.include <bsd.prog.mk> diff --git a/sbin/mdconfig/mdconfig.8 b/sbin/mdconfig/mdconfig.8 index 9e30896..8cb9a69 100644 --- a/sbin/mdconfig/mdconfig.8 +++ b/sbin/mdconfig/mdconfig.8 @@ -41,12 +41,12 @@ .\" .\" $FreeBSD$ .\" -.Dd June 20, 2013 +.Dd August 6, 2015 .Dt MDCONFIG 8 .Os .Sh NAME .Nm mdconfig -.Nd configure and enable memory disks +.Nd create and control memory disks .Sh SYNOPSIS .Nm .Fl a @@ -79,7 +79,7 @@ .Sh DESCRIPTION The .Nm -utility configures and enables +utility creates and controls .Xr md 4 devices. .Pp @@ -89,6 +89,9 @@ Options indicate an action to be performed: Attach a memory disk. This will configure and attach a memory disk with the parameters specified and attach it to the system. +If the +.Fl u Ar unit +option is not provided, the newly created device name will be printed on stdout. .It Fl d Detach a memory disk from the system and release all resources. .It Fl r @@ -104,7 +107,7 @@ If the .Fl o Cm reserve option is not set, creating and filling a large malloc-backed memory disk is a very easy way to -panic a system. +panic the system. .It Cm vnode A file specified with .Fl f Ar file @@ -119,6 +122,8 @@ Using backing is generally preferred instead of using .Cm malloc backing. +.It Cm null +Bitsink; all writes do nothing, all reads return zeroes. .El .It Fl f Ar file Filename to use for the vnode type memory disk. @@ -163,7 +168,9 @@ or .Cm t which denotes byte, kilobyte, megabyte, gigabyte and terabyte respectively. -The +When used without the +.Fl r +option, the .Fl a and .Fl t Ar swap @@ -205,13 +212,21 @@ Enable/disable compression features to reduce memory usage. .It Oo Cm no Oc Ns Cm force Disable/enable extra sanity checks to prevent the user from doing something that might adversely affect the system. +This can be used with the +.Fl d +flag to forcibly destroy an +.Xr md 4 +disk that is still in use. .It Oo Cm no Oc Ns Cm readonly Enable/disable readonly mode. .El .It Fl u Ar unit -Request a specific unit number for the +Request a specific unit number or device name for the .Xr md 4 device instead of automatic allocation. +If a device name is specified, it must be start with +.Dq md +followed by the unit number. .El .Pp The last form, @@ -223,66 +238,58 @@ is provided for convenience as an abbreviation of .Fl t Ar vnode .Fl f Ar file . .Sh EXAMPLES -Create a 4 megabyte -.Xr malloc 9 -backed memory disk. -The name of the allocated unit will be printed on stdout, such as -.Dq Li md3 : -.Pp -.Dl mdconfig -a -t malloc -s 4m -.Pp -Create a disk named -.Pa /dev/md4 -with +Create a disk with .Pa /tmp/boot.flp -as backing storage: +as backing storage. +The name of the allocated unit will be printed on stdout, such as +.Dq Li md0 : +.Bd -literal -offset indent +mdconfig /tmp/boot.flp +.Ed .Pp -.Dl mdconfig -a -t vnode -f /tmp/boot.flp -u 4 +Create a 1 gigabyte swap backed memory disk named +.Dq Li md3 : +.Bd -literal -offset indent +mdconfig -s 1g -u md3 +.Ed .Pp Detach and free all resources used by -.Pa /dev/md4 : +.Pa /dev/md3 : +.Bd -literal -offset indent +mdconfig -du md3 +.Ed .Pp -.Dl mdconfig -d -u 4 +Show detailed information on current memory disks: +.Bd -literal -offset indent +mdconfig -lv +.Ed .Pp -Create a 128MByte swap backed disk, initialize an +Resize the +.Dq Li md3 +memory disk to 2 gigabytes: +.Bd -literal -offset indent +mdconfig -rs 2g -u md3 +.Ed +.Pp +Create a 1 gigabyte swap backed disk, initialize an .Xr ffs 7 file system on it, and mount it on .Pa /tmp : .Bd -literal -offset indent -mdconfig -a -t swap -s 128M -u 10 +mdconfig -s 1g -u md10 newfs -U /dev/md10 mount /dev/md10 /tmp chmod 1777 /tmp .Ed .Pp -Create a 5MB file-backed disk -.Po Fl a -and -.Fl t Ar vnode -are implied -.Pc : -.Bd -literal -offset indent -dd if=/dev/zero of=somebackingfile bs=1k count=5k -mdconfig -f somebackingfile -u 0 -bsdlabel -w md0 auto -newfs md0c -mount /dev/md0c /mnt -.Ed -.Pp -Create an -.Xr md 4 -device out of an ISO 9660 CD image file -.Po Fl a -and -.Fl t Ar vnode -are implied -.Pc , using the first available +Create a memory disk out of an ISO 9660 CD image file, +using the first available .Xr md 4 -device, and then mount the new memory disk: +device, and then mount it: .Bd -literal -offset indent mount -t cd9660 /dev/`mdconfig -f cdimage.iso` /mnt -.Pp .Ed +.Pp Create a file-backed device from a hard disk image that begins with 512K of raw header information. .Xr gnop 8 @@ -290,7 +297,7 @@ is used to skip over the header information, positioning .Pa md1.nop to the start of the filesystem in the image. .Bd -literal -offset indent -mdconfig -f diskimage.img -u 1 +mdconfig -u md1 -f diskimage.img gnop create -o 512K md1 mount /dev/md1.nop /mnt .Ed diff --git a/sbin/mdconfig/mdconfig.c b/sbin/mdconfig/mdconfig.c index 4257dd7..d741c77 100644 --- a/sbin/mdconfig/mdconfig.c +++ b/sbin/mdconfig/mdconfig.c @@ -155,6 +155,9 @@ main(int argc, char **argv) } else if (!strcmp(optarg, "swap")) { mdio.md_type = MD_SWAP; mdio.md_options |= MD_CLUSTER | MD_AUTOUNIT | MD_COMPRESS; + } else if (!strcmp(optarg, "null")) { + mdio.md_type = MD_NULL; + mdio.md_options |= MD_CLUSTER | MD_AUTOUNIT | MD_COMPRESS; } else errx(1, "unknown type: %s", optarg); break; @@ -287,9 +290,10 @@ main(int argc, char **argv) } } - if ((mdio.md_type == MD_MALLOC || mdio.md_type == MD_SWAP) && - sflag == NULL) - errx(1, "must specify -s for -t malloc or -t swap"); + if ((mdio.md_type == MD_MALLOC || mdio.md_type == MD_SWAP || + mdio.md_type == MD_NULL) && sflag == NULL) + errx(1, "must specify -s for -t malloc, -t swap, " + "or -t null"); if (mdio.md_type == MD_VNODE && mdio.md_file[0] == '\0') errx(1, "must specify -f for -t vnode"); } else { diff --git a/sbin/mount_unionfs/mount_unionfs.8 b/sbin/mount_unionfs/mount_unionfs.8 index b613a94..b9290db 100644 --- a/sbin/mount_unionfs/mount_unionfs.8 +++ b/sbin/mount_unionfs/mount_unionfs.8 @@ -83,7 +83,7 @@ becomes the upper layer. However, .Ar uniondir remains the mount point. -.It Sm Cm copymode No = Cm traditional | transparent | masquerade Sm +.It Cm copymode No = Cm traditional | transparent | masquerade Specifies the way to create a file or a directory in the upper layer automatically when needed. The @@ -98,7 +98,7 @@ For behavior of the mode, see .Sx MASQUERADE MODE below. -.It Sm Cm whiteout No = Cm always | whenneeded Sm +.It Cm whiteout No = Cm always | whenneeded Specifies whether whiteouts should always be made in the upper layer when removing a file or directory or only when it already exists in the lower layer. diff --git a/sbin/newfs_msdos/newfs_msdos.c b/sbin/newfs_msdos/newfs_msdos.c index 69b92d0..f315d98 100644 --- a/sbin/newfs_msdos/newfs_msdos.c +++ b/sbin/newfs_msdos/newfs_msdos.c @@ -51,50 +51,50 @@ static const char rcsid[] = #include <time.h> #include <unistd.h> -#define MAXU16 0xffff /* maximum unsigned 16-bit quantity */ -#define BPN 4 /* bits per nibble */ -#define NPB 2 /* nibbles per byte */ +#define MAXU16 0xffff /* maximum unsigned 16-bit quantity */ +#define BPN 4 /* bits per nibble */ +#define NPB 2 /* nibbles per byte */ -#define DOSMAGIC 0xaa55 /* DOS magic number */ -#define MINBPS 512 /* minimum bytes per sector */ -#define MAXSPC 128 /* maximum sectors per cluster */ -#define MAXNFT 16 /* maximum number of FATs */ -#define DEFBLK 4096 /* default block size */ -#define DEFBLK16 2048 /* default block size FAT16 */ -#define DEFRDE 512 /* default root directory entries */ -#define RESFTE 2 /* reserved FAT entries */ -#define MINCLS12 1U /* minimum FAT12 clusters */ -#define MINCLS16 0x1000U /* minimum FAT16 clusters */ -#define MINCLS32 2U /* minimum FAT32 clusters */ -#define MAXCLS12 0xfedU /* maximum FAT12 clusters */ -#define MAXCLS16 0xfff5U /* maximum FAT16 clusters */ -#define MAXCLS32 0xffffff5U /* maximum FAT32 clusters */ +#define DOSMAGIC 0xaa55 /* DOS magic number */ +#define MINBPS 512 /* minimum bytes per sector */ +#define MAXSPC 128 /* maximum sectors per cluster */ +#define MAXNFT 16 /* maximum number of FATs */ +#define DEFBLK 4096 /* default block size */ +#define DEFBLK16 2048 /* default block size FAT16 */ +#define DEFRDE 512 /* default root directory entries */ +#define RESFTE 2 /* reserved FAT entries */ +#define MINCLS12 1U /* minimum FAT12 clusters */ +#define MINCLS16 0xff5U /* minimum FAT16 clusters */ +#define MINCLS32 0xfff5U /* minimum FAT32 clusters */ +#define MAXCLS12 0xff4U /* maximum FAT12 clusters */ +#define MAXCLS16 0xfff4U /* maximum FAT16 clusters */ +#define MAXCLS32 0xffffff4U /* maximum FAT32 clusters */ -#define mincls(fat) ((fat) == 12 ? MINCLS12 : \ +#define mincls(fat) ((fat) == 12 ? MINCLS12 : \ (fat) == 16 ? MINCLS16 : \ MINCLS32) -#define maxcls(fat) ((fat) == 12 ? MAXCLS12 : \ +#define maxcls(fat) ((fat) == 12 ? MAXCLS12 : \ (fat) == 16 ? MAXCLS16 : \ MAXCLS32) -#define mk1(p, x) \ +#define mk1(p, x) \ (p) = (u_int8_t)(x) -#define mk2(p, x) \ +#define mk2(p, x) \ (p)[0] = (u_int8_t)(x), \ (p)[1] = (u_int8_t)((x) >> 010) -#define mk4(p, x) \ +#define mk4(p, x) \ (p)[0] = (u_int8_t)(x), \ (p)[1] = (u_int8_t)((x) >> 010), \ (p)[2] = (u_int8_t)((x) >> 020), \ (p)[3] = (u_int8_t)((x) >> 030) -#define argto1(arg, lo, msg) argtou(arg, lo, 0xff, msg) -#define argto2(arg, lo, msg) argtou(arg, lo, 0xffff, msg) -#define argto4(arg, lo, msg) argtou(arg, lo, 0xffffffff, msg) -#define argtox(arg, lo, msg) argtou(arg, lo, UINT_MAX, msg) +#define argto1(arg, lo, msg) argtou(arg, lo, 0xff, msg) +#define argto2(arg, lo, msg) argtou(arg, lo, 0xffff, msg) +#define argto4(arg, lo, msg) argtou(arg, lo, 0xffffffff, msg) +#define argtox(arg, lo, msg) argtou(arg, lo, UINT_MAX, msg) struct bs { u_int8_t bsJump[3]; /* bootstrap entry point */ @@ -131,7 +131,7 @@ struct bsx { u_int8_t exReserved1; /* reserved */ u_int8_t exBootSignature; /* extended boot signature */ u_int8_t exVolumeID[4]; /* volume ID number */ - u_int8_t exVolumeLabel[11]; /* volume label */ + u_int8_t exVolumeLabel[11]; /* volume label */ u_int8_t exFileSysType[8]; /* file system type */ } __packed; @@ -164,7 +164,7 @@ struct bpb { u_int bpbBackup; /* backup boot sector */ }; -#define BPBGAP 0, 0, 0, 0, 0, 0 +#define BPBGAP 0, 0, 0, 0, 0, 0 static struct { const char *name; @@ -174,10 +174,10 @@ static struct { {"180", {512, 1, 1, 2, 64, 360, 0xfc, 2, 9, 1, BPBGAP}}, {"320", {512, 2, 1, 2, 112, 640, 0xff, 1, 8, 2, BPBGAP}}, {"360", {512, 2, 1, 2, 112, 720, 0xfd, 2, 9, 2, BPBGAP}}, - {"640", {512, 2, 1, 2, 112, 1280, 0xfb, 2, 8, 2, BPBGAP}}, + {"640", {512, 2, 1, 2, 112, 1280, 0xfb, 2, 8, 2, BPBGAP}}, {"720", {512, 2, 1, 2, 112, 1440, 0xf9, 3, 9, 2, BPBGAP}}, {"1200", {512, 1, 1, 2, 224, 2400, 0xf9, 7, 15, 2, BPBGAP}}, - {"1232", {1024,1, 1, 2, 192, 1232, 0xfe, 2, 8, 2, BPBGAP}}, + {"1232", {1024,1, 1, 2, 192, 1232, 0xfe, 2, 8, 2, BPBGAP}}, {"1440", {512, 1, 1, 2, 224, 2880, 0xf0, 9, 18, 2, BPBGAP}}, {"2880", {512, 2, 1, 2, 240, 5760, 0xf0, 9, 36, 2, BPBGAP}} }; @@ -1029,7 +1029,7 @@ usage(void) fprintf(stderr, "usage: newfs_msdos [ -options ] special [disktype]\n" "where the options are:\n" - "\t-@ create file system at specified offset\n" + "\t-@ create file system at specified offset\n" "\t-B get bootstrap from file\n" "\t-C create image file with specified size\n" "\t-F FAT type (12, 16, or 32)\n" diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index f9207f1..c0bcc81 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -233,6 +233,12 @@ parse(const char *string, int lineno) newval = cp; newsize = strlen(cp); } + /* Trim spaces */ + cp = bufp + strlen(bufp) - 1; + while (cp >= bufp && isspace((int)*cp)) { + *cp = '\0'; + cp--; + } len = name2oid(bufp, mib); if (len < 0) { @@ -241,7 +247,11 @@ parse(const char *string, int lineno) if (qflag) return (1); else { - warn("unknown oid '%s'%s", bufp, line); + if (errno == ENOENT) { + warnx("unknown oid '%s'%s", bufp, line); + } else { + warn("unknown oid '%s'%s", bufp, line); + } return (1); } } |