CVS commit: src/sbin
Module Name:src Committed By: mlelstv Date: Sun Jul 26 08:20:23 UTC 2020 Modified Files: src/sbin/mount: pathadj.c src/sbin/mount_ados: Makefile mount_ados.c src/sbin/mount_autofs: Makefile mount_autofs.c src/sbin/mount_fdesc: Makefile mount_fdesc.c src/sbin/mount_filecore: Makefile mount_filecore.c src/sbin/mount_kernfs: Makefile mount_kernfs.c src/sbin/mount_null: Makefile mount_null.c src/sbin/mount_overlay: Makefile mount_overlay.c src/sbin/mount_procfs: Makefile mount_procfs.c src/sbin/mount_ptyfs: Makefile mount_ptyfs.c src/sbin/mount_umap: Makefile mount_umap.c src/sbin/mount_union: Makefile mount_union.c Log Message: Refactor remaining mount_* commands to use the common pathadj() function for resolving paths. Make pathadj() no longer warn about symlinks. Symlinks in /dev are regularly used in several places like LVM . The warning was also only visible when calling a mount_* command directly as mount(8) itself would resolve the path witout warning before passing it to a mount_* command. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sbin/mount/pathadj.c cvs rdiff -u -r1.13 -r1.14 src/sbin/mount_ados/Makefile cvs rdiff -u -r1.29 -r1.30 src/sbin/mount_ados/mount_ados.c cvs rdiff -u -r1.2 -r1.3 src/sbin/mount_autofs/Makefile cvs rdiff -u -r1.4 -r1.5 src/sbin/mount_autofs/mount_autofs.c cvs rdiff -u -r1.13 -r1.14 src/sbin/mount_fdesc/Makefile cvs rdiff -u -r1.26 -r1.27 src/sbin/mount_fdesc/mount_fdesc.c cvs rdiff -u -r1.8 -r1.9 src/sbin/mount_filecore/Makefile cvs rdiff -u -r1.20 -r1.21 src/sbin/mount_filecore/mount_filecore.c cvs rdiff -u -r1.13 -r1.14 src/sbin/mount_kernfs/Makefile cvs rdiff -u -r1.25 -r1.26 src/sbin/mount_kernfs/mount_kernfs.c cvs rdiff -u -r1.12 -r1.13 src/sbin/mount_null/Makefile cvs rdiff -u -r1.20 -r1.21 src/sbin/mount_null/mount_null.c cvs rdiff -u -r1.5 -r1.6 src/sbin/mount_overlay/Makefile cvs rdiff -u -r1.13 -r1.14 src/sbin/mount_overlay/mount_overlay.c cvs rdiff -u -r1.14 -r1.15 src/sbin/mount_procfs/Makefile cvs rdiff -u -r1.24 -r1.25 src/sbin/mount_procfs/mount_procfs.c cvs rdiff -u -r1.5 -r1.6 src/sbin/mount_ptyfs/Makefile cvs rdiff -u -r1.17 -r1.18 src/sbin/mount_ptyfs/mount_ptyfs.c cvs rdiff -u -r1.11 -r1.12 src/sbin/mount_umap/Makefile cvs rdiff -u -r1.26 -r1.27 src/sbin/mount_umap/mount_umap.c cvs rdiff -u -r1.14 -r1.15 src/sbin/mount_union/Makefile cvs rdiff -u -r1.22 -r1.23 src/sbin/mount_union/mount_union.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/mount/pathadj.c diff -u src/sbin/mount/pathadj.c:1.2 src/sbin/mount/pathadj.c:1.3 --- src/sbin/mount/pathadj.c:1.2 Thu Feb 17 16:57:46 2011 +++ src/sbin/mount/pathadj.c Sun Jul 26 08:20:22 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: pathadj.c,v 1.2 2011/02/17 16:57:46 pooka Exp $ */ +/* $NetBSD: pathadj.c,v 1.3 2020/07/26 08:20:22 mlelstv Exp $ */ /* * Copyright (c) 2008 The NetBSD Foundation. All Rights Reserved. @@ -37,10 +37,13 @@ void pathadj(const char *input, char *adjusted) { - if (realpath(input, adjusted) == NULL) + if (realpath(input, adjusted) == NULL) { warn("Warning: realpath %s", input); - if (strncmp(input, adjusted, MAXPATHLEN)) { - warnx("\"%s\" is a non-resolved or relative path.", input); + return; + } + + if (input[0] != '/') { + warnx("\"%s\" is a relative path.", input); warnx("using \"%s\" instead.", adjusted); } } Index: src/sbin/mount_ados/Makefile diff -u src/sbin/mount_ados/Makefile:1.13 src/sbin/mount_ados/Makefile:1.14 --- src/sbin/mount_ados/Makefile:1.13 Mon Jun 27 01:00:05 2005 +++ src/sbin/mount_ados/Makefile Sun Jul 26 08:20:22 2020 @@ -1,9 +1,9 @@ -# $NetBSD: Makefile,v 1.13 2005/06/27 01:00:05 christos Exp $ +# $NetBSD: Makefile,v 1.14 2020/07/26 08:20:22 mlelstv Exp $ .include PROG= mount_ados -SRCS= mount_ados.c fattr.c +SRCS= mount_ados.c fattr.c pathadj.c MAN= mount_ados.8 MOUNT= ${NETBSDSRCDIR}/sbin/mount Index: src/sbin/mount_ados/mount_ados.c diff -u src/sbin/mount_ados/mount_ados.c:1.29 src/sbin/mount_ados/mount_ados.c:1.30 --- src/sbin/mount_ados/mount_ados.c:1.29 Mon Aug 29 14:35:00 2011 +++ src/sbin/mount_ados/mount_ados.c Sun Jul 26 08:20:22 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: mount_ados.c,v 1.29 2011/08/29 14:35:00 joerg Exp $ */ +/* $NetBSD: mount_ados.c,v 1.30 2020/07/26 08:20:22 mlelstv Exp $ */ /* * Copyright (c) 1994 Christopher G. Demetriou @@ -36,7 +36,7 @@ #include #ifndef lint -__RCSID("$NetBSD: mount_ados.c,v 1.29 2011/08/29 14:35:00 joerg Exp $"); +__RCSID("$NetBSD: mount_ados.c,v 1.30 2020/07/26 08:20:22 mlelstv Exp $"); #endif /* not lint */ #include @@ -120,21 +120,11 @@ mount_ados(int argc, char **argv) dev = argv[optind]; dir = argv[optind + 1]; - if (realpath(dev, canon_dev) == NULL)/* Check device path */ - err(1, "realpath %s", dev); - if (strncmp(dev, canon_dev, MAXPA
CVS commit: src/sbin
Module Name:src Committed By: joerg Date: Fri Apr 3 19:36:33 UTC 2020 Modified Files: src/sbin/fsck: fsutil.c fsutil.h src/sbin/fsck_lfs: bufcache.c dir.c extern.h fsck.h fsck_vars.h inode.c lfs.c main.c pass0.c pass1.c pass2.c pass4.c pass5.c pass6.c segwrite.c setup.c utilities.c vars.c vnode.c Log Message: Avoid common symbols for fsck_lfs. To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/sbin/fsck/fsutil.c cvs rdiff -u -r1.20 -r1.21 src/sbin/fsck/fsutil.h cvs rdiff -u -r1.20 -r1.21 src/sbin/fsck_lfs/bufcache.c cvs rdiff -u -r1.46 -r1.47 src/sbin/fsck_lfs/dir.c src/sbin/fsck_lfs/pass1.c \ src/sbin/fsck_lfs/segwrite.c cvs rdiff -u -r1.15 -r1.16 src/sbin/fsck_lfs/extern.h \ src/sbin/fsck_lfs/fsck_vars.h src/sbin/fsck_lfs/vnode.c cvs rdiff -u -r1.26 -r1.27 src/sbin/fsck_lfs/fsck.h cvs rdiff -u -r1.69 -r1.70 src/sbin/fsck_lfs/inode.c cvs rdiff -u -r1.74 -r1.75 src/sbin/fsck_lfs/lfs.c cvs rdiff -u -r1.54 -r1.55 src/sbin/fsck_lfs/main.c cvs rdiff -u -r1.42 -r1.43 src/sbin/fsck_lfs/pass0.c cvs rdiff -u -r1.34 -r1.35 src/sbin/fsck_lfs/pass2.c cvs rdiff -u -r1.27 -r1.28 src/sbin/fsck_lfs/pass4.c cvs rdiff -u -r1.36 -r1.37 src/sbin/fsck_lfs/pass5.c cvs rdiff -u -r1.50 -r1.51 src/sbin/fsck_lfs/pass6.c cvs rdiff -u -r1.61 -r1.62 src/sbin/fsck_lfs/setup.c cvs rdiff -u -r1.41 -r1.42 src/sbin/fsck_lfs/utilities.c cvs rdiff -u -r1.18 -r1.19 src/sbin/fsck_lfs/vars.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/fsck/fsutil.c diff -u src/sbin/fsck/fsutil.c:1.26 src/sbin/fsck/fsutil.c:1.27 --- src/sbin/fsck/fsutil.c:1.26 Sun Jun 21 04:01:40 2015 +++ src/sbin/fsck/fsutil.c Fri Apr 3 19:36:32 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: fsutil.c,v 1.26 2015/06/21 04:01:40 dholland Exp $ */ +/* $NetBSD: fsutil.c,v 1.27 2020/04/03 19:36:32 joerg Exp $ */ /* * Copyright (c) 1990, 1993 @@ -31,7 +31,7 @@ #include #ifndef lint -__RCSID("$NetBSD: fsutil.c,v 1.26 2015/06/21 04:01:40 dholland Exp $"); +__RCSID("$NetBSD: fsutil.c,v 1.27 2020/04/03 19:36:32 joerg Exp $"); #endif /* not lint */ /* @@ -66,10 +66,12 @@ __RCSID("$NetBSD: fsutil.c,v 1.26 2015/0 volatile sig_atomic_t returntosingle; +void (*ckfinish)(int); + static const char *dev = NULL; static int hot = 0; static int preen = 0; -int quiet; +int quiet; /* don't report clean filesystems */ #define F_ERROR 0x8000 void Index: src/sbin/fsck/fsutil.h diff -u src/sbin/fsck/fsutil.h:1.20 src/sbin/fsck/fsutil.h:1.21 --- src/sbin/fsck/fsutil.h:1.20 Sun Jun 21 03:58:36 2015 +++ src/sbin/fsck/fsutil.h Fri Apr 3 19:36:32 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: fsutil.h,v 1.20 2015/06/21 03:58:36 dholland Exp $ */ +/* $NetBSD: fsutil.h,v 1.21 2020/04/03 19:36:32 joerg Exp $ */ /* * Copyright (c) 1996 Christos Zoulas. All rights reserved. @@ -50,8 +50,10 @@ struct fstab; int checkfstab(int, int, void *(*)(struct fstab *), int (*) (const char *, const char *, const char *, void *, pid_t *)); -void (*ckfinish)(int); +extern void (*ckfinish)(int); extern volatile sig_atomic_t returntosingle; void catch(int) __dead; void catchquit(int); void voidquit(int); + +extern int quiet; Index: src/sbin/fsck_lfs/bufcache.c diff -u src/sbin/fsck_lfs/bufcache.c:1.20 src/sbin/fsck_lfs/bufcache.c:1.21 --- src/sbin/fsck_lfs/bufcache.c:1.20 Fri Mar 30 12:56:46 2018 +++ src/sbin/fsck_lfs/bufcache.c Fri Apr 3 19:36:33 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: bufcache.c,v 1.20 2018/03/30 12:56:46 christos Exp $ */ +/* $NetBSD: bufcache.c,v 1.21 2020/04/03 19:36:33 joerg Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. * All rights reserved. @@ -44,7 +44,7 @@ #include #include "bufcache.h" -#include "vnode.h" +#include "extern.h" /* * Definitions for the buffer free lists. Index: src/sbin/fsck_lfs/dir.c diff -u src/sbin/fsck_lfs/dir.c:1.46 src/sbin/fsck_lfs/dir.c:1.47 --- src/sbin/fsck_lfs/dir.c:1.46 Mon Sep 21 01:24:23 2015 +++ src/sbin/fsck_lfs/dir.c Fri Apr 3 19:36:33 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: dir.c,v 1.46 2015/09/21 01:24:23 dholland Exp $ */ +/* $NetBSD: dir.c,v 1.47 2020/04/03 19:36:33 joerg Exp $ */ /* * Copyright (c) 1980, 1986, 1993 @@ -45,7 +45,6 @@ #include #include "bufcache.h" -#include "vnode.h" #include "lfs_user.h" #include "fsck.h" @@ -53,7 +52,6 @@ #include "extern.h" const char *lfname = "lost+found"; -int lfmode = 01700; #if 0 struct lfs_dirtemplate emptydir = { .dot_ino = 0, Index: src/sbin/fsck_lfs/pass1.c diff -u src/sbin/fsck_lfs/pass1.c:1.46 src/sbin/fsck_lfs/pass1.c:1.47 --- src/sbin/fsck_lfs/pass1.c:1.46 Sun Feb 23 15:11:33 2020 +++ src/sbin/fsck_lfs/pass1.c Fri Apr 3 19:36:33 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: pass1.c,v 1.46 2020/02/23 15:11:33 riastradh Exp $ */ +/* $NetBSD: pass1.c,v 1.47 2020/04/03 19:36:33 joerg Exp $ */ /* * Copyright (c) 1980, 1986, 1993 @@ -48,7 +48,6 @@ #include #include "
CVS commit: src/sbin
Module Name:src Committed By: jdolecek Date: Sat Apr 18 12:54:38 UTC 2020 Modified Files: src/sbin/fsck_ffs: fsck.h src/sbin/newfs: extern.h Log Message: add NO_IOBUF_ALIGNED to not pull aligned_alloc() for really constrained boot media To generate a diff of this commit: cvs rdiff -u -r1.54 -r1.55 src/sbin/fsck_ffs/fsck.h cvs rdiff -u -r1.18 -r1.19 src/sbin/newfs/extern.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/fsck_ffs/fsck.h diff -u src/sbin/fsck_ffs/fsck.h:1.54 src/sbin/fsck_ffs/fsck.h:1.55 --- src/sbin/fsck_ffs/fsck.h:1.54 Sun Apr 5 15:25:40 2020 +++ src/sbin/fsck_ffs/fsck.h Sat Apr 18 12:54:38 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: fsck.h,v 1.54 2020/04/05 15:25:40 joerg Exp $ */ +/* $NetBSD: fsck.h,v 1.55 2020/04/18 12:54:38 jdolecek Exp $ */ /* * Copyright (c) 1980, 1986, 1993 @@ -394,3 +394,7 @@ iswap64(u_int64_t x) #define iswap32(x) (x) #define iswap64(x) (x) #endif /* NO_FFS_EI */ + +#ifdef NO_IOBUF_ALIGNED +#define aligned_alloc(align, size) malloc((size)) +#endif Index: src/sbin/newfs/extern.h diff -u src/sbin/newfs/extern.h:1.18 src/sbin/newfs/extern.h:1.19 --- src/sbin/newfs/extern.h:1.18 Wed Feb 8 18:05:25 2017 +++ src/sbin/newfs/extern.h Sat Apr 18 12:54:38 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: extern.h,v 1.18 2017/02/08 18:05:25 rin Exp $ */ +/* $NetBSD: extern.h,v 1.19 2020/04/18 12:54:38 jdolecek Exp $ */ /* * Copyright (c) 1997 Christos Zoulas. All rights reserved. @@ -72,3 +72,8 @@ extern char *appleufs_volname; /* Apple /* Disable Apple UFS support for install media */ #define isappleufs (0) #endif + +#ifdef NO_IOBUF_ALIGNED +#define aligned_alloc(align, size) malloc((size)) +#endif +
CVS commit: src/sbin
Module Name:src Committed By: abhinav Date: Wed Jun 7 15:24:50 UTC 2017 Modified Files: src/sbin/dump_lfs: dump_lfs.8 src/sbin/mount_cd9660: mount_cd9660.8 src/sbin/mount_union: mount_union.8 src/sbin/umount: umount.8 Log Message: s/filesystem/file system/ To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/sbin/dump_lfs/dump_lfs.8 cvs rdiff -u -r1.28 -r1.29 src/sbin/mount_cd9660/mount_cd9660.8 cvs rdiff -u -r1.19 -r1.20 src/sbin/mount_union/mount_union.8 cvs rdiff -u -r1.17 -r1.18 src/sbin/umount/umount.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/dump_lfs/dump_lfs.8 diff -u src/sbin/dump_lfs/dump_lfs.8:1.16 src/sbin/dump_lfs/dump_lfs.8:1.17 --- src/sbin/dump_lfs/dump_lfs.8:1.16 Sun Apr 8 22:00:37 2012 +++ src/sbin/dump_lfs/dump_lfs.8 Wed Jun 7 15:24:50 2017 @@ -1,4 +1,4 @@ -.\" $NetBSD: dump_lfs.8,v 1.16 2012/04/08 22:00:37 wiz Exp $ +.\" $NetBSD: dump_lfs.8,v 1.17 2017/06/07 15:24:50 abhinav Exp $ .\" .\" Copyright (c) 1980, 1991, 1993 .\" Regents of the University of California. @@ -36,7 +36,7 @@ .Sh NAME .Nm dump_lfs , .Nm rdump_lfs -.Nd filesystem backup +.Nd file system backup .Sh SYNOPSIS .Nm .Op Fl 0123456789aceFnStuX @@ -287,7 +287,7 @@ is ignored. .It Fl X Prevent the log from wrapping until the dump completes, guaranteeing a consistent backup. -Processes that write to the filesystem will continue as usual +Processes that write to the file system will continue as usual until the entire log is full, after which they will block until the dump is complete. This functionality is analogous to what Index: src/sbin/mount_cd9660/mount_cd9660.8 diff -u src/sbin/mount_cd9660/mount_cd9660.8:1.28 src/sbin/mount_cd9660/mount_cd9660.8:1.29 --- src/sbin/mount_cd9660/mount_cd9660.8:1.28 Sat Jan 3 22:56:23 2009 +++ src/sbin/mount_cd9660/mount_cd9660.8 Wed Jun 7 15:24:50 2017 @@ -1,4 +1,4 @@ -.\" $NetBSD: mount_cd9660.8,v 1.28 2009/01/03 22:56:23 christos Exp $ +.\" $NetBSD: mount_cd9660.8,v 1.29 2017/06/07 15:24:50 abhinav Exp $ .\" .\" Copyright (c) 2004 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -62,7 +62,7 @@ .Os .Sh NAME .Nm mount_cd9660 -.Nd mount an ISO-9660 filesystem +.Nd mount an ISO-9660 file system .Sh SYNOPSIS .Nm .Op Fl o Ar options @@ -70,9 +70,9 @@ .Sh DESCRIPTION The .Nm -command attaches the ISO-9660 filesystem residing on the device +command attaches the ISO-9660 file system residing on the device .Pa special -to the global filesystem namespace at the location indicated by +to the global file system namespace at the location indicated by .Pa node . Both .Ar special @@ -110,7 +110,7 @@ A synonym for .Cm nomaplcase . .It Cm nojoliet Do not make use of Joliet extensions for long filenames which -may be present in the filesystem. +may be present in the file system. .Pp Interpretation of Joliet extensions is enabled by default, Unicode file names are encoded into UTF-8. @@ -122,7 +122,7 @@ names read from a non-Rock Ridge disk to .Cm nomaplcase turns off this mapping. .It Cm norrip -Do not use any Rockridge extensions included in the filesystem. +Do not use any Rockridge extensions included in the file system. .It Cm nrr Same as .Cm norrip . @@ -164,7 +164,7 @@ The .Nm utility first appeared .Bx 4.4 . -Support for Joliet filesystem appeared in +Support for Joliet file system appeared in .Nx 1.4 . Options .Cm nomaplcase @@ -172,10 +172,10 @@ and .Cm rrcaseins were added in .Nx 1.5 . -UTF-8 encoding of Unicode file names for Joliet filesystems was added in +UTF-8 encoding of Unicode file names for Joliet file systems was added in .Nx 3.0 . .Sh NOTES -For Joliet filesystems, the Unicode file names used to be filtered +For Joliet file systems, the Unicode file names used to be filtered to ISO-8859-1 character set. This changed in .Nx 3.0 , @@ -192,7 +192,7 @@ system call returns .Er EBADF causing, e.g., "ls -l" to fail with "Bad file descriptor". .Pp -The cd9660 filesystem does not support the original "High Sierra" +The cd9660 file system does not support the original "High Sierra" ("CDROM001") format. .Pp POSIX device node mapping is currently not supported. Index: src/sbin/mount_union/mount_union.8 diff -u src/sbin/mount_union/mount_union.8:1.19 src/sbin/mount_union/mount_union.8:1.20 --- src/sbin/mount_union/mount_union.8:1.19 Mon May 4 20:11:30 2009 +++ src/sbin/mount_union/mount_union.8 Wed Jun 7 15:24:50 2017 @@ -1,4 +1,4 @@ -.\" $NetBSD: mount_union.8,v 1.19 2009/05/04 20:11:30 wiz Exp $ +.\" $NetBSD: mount_union.8,v 1.20 2017/06/07 15:24:50 abhinav Exp $ .\" .\" Copyright (c) 1994 .\" The Regents of the University of California. All rights reserved. @@ -37,7 +37,7 @@ .Os .Sh NAME .Nm mount_union -.Nd mount union filesystems +.Nd mount union file systems .Sh SYNOPSIS .Nm .Op Fl b @@ -107,7 +107,7 @@ which will still allow the lower fil
CVS commit: src/sbin
Module Name:src Committed By: wiz Date: Mon Jul 3 21:33:42 UTC 2017 Modified Files: src/sbin/bioctl: bioctl.8 src/sbin/chown: chgrp.1 chown.8 src/sbin/disklabel: disklabel.5 disklabel.8 src/sbin/fsdb: fsdb.8 src/sbin/mknod: mknod.8 src/sbin/mount_nfs: mount_nfs.8 src/sbin/mount_portal: mount_portal.8 src/sbin/mount_procfs: mount_procfs.8 src/sbin/newbtconf: newbtconf.8 src/sbin/newfs: mount_mfs.8 newfs.8 src/sbin/newfs_ext2fs: newfs_ext2fs.8 src/sbin/raidctl: raidctl.8 src/sbin/restore: restore.8 src/sbin/route: route.8 src/sbin/routed: routed.8 src/sbin/veriexecctl: veriexecctl.8 Log Message: Remove workaround for ancient HTML generation code. To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/sbin/bioctl/bioctl.8 cvs rdiff -u -r1.6 -r1.7 src/sbin/chown/chgrp.1 cvs rdiff -u -r1.10 -r1.11 src/sbin/chown/chown.8 cvs rdiff -u -r1.29 -r1.30 src/sbin/disklabel/disklabel.5 cvs rdiff -u -r1.67 -r1.68 src/sbin/disklabel/disklabel.8 cvs rdiff -u -r1.23 -r1.24 src/sbin/fsdb/fsdb.8 cvs rdiff -u -r1.29 -r1.30 src/sbin/mknod/mknod.8 cvs rdiff -u -r1.45 -r1.46 src/sbin/mount_nfs/mount_nfs.8 cvs rdiff -u -r1.21 -r1.22 src/sbin/mount_portal/mount_portal.8 cvs rdiff -u -r1.34 -r1.35 src/sbin/mount_procfs/mount_procfs.8 cvs rdiff -u -r1.19 -r1.20 src/sbin/newbtconf/newbtconf.8 cvs rdiff -u -r1.17 -r1.18 src/sbin/newfs/mount_mfs.8 cvs rdiff -u -r1.83 -r1.84 src/sbin/newfs/newfs.8 cvs rdiff -u -r1.11 -r1.12 src/sbin/newfs_ext2fs/newfs_ext2fs.8 cvs rdiff -u -r1.71 -r1.72 src/sbin/raidctl/raidctl.8 cvs rdiff -u -r1.53 -r1.54 src/sbin/restore/restore.8 cvs rdiff -u -r1.58 -r1.59 src/sbin/route/route.8 cvs rdiff -u -r1.44 -r1.45 src/sbin/routed/routed.8 cvs rdiff -u -r1.39 -r1.40 src/sbin/veriexecctl/veriexecctl.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/bioctl/bioctl.8 diff -u src/sbin/bioctl/bioctl.8:1.22 src/sbin/bioctl/bioctl.8:1.23 --- src/sbin/bioctl/bioctl.8:1.22 Sun Sep 11 01:03:15 2016 +++ src/sbin/bioctl/bioctl.8 Mon Jul 3 21:33:41 2017 @@ -1,4 +1,4 @@ -.\" $NetBSD: bioctl.8,v 1.22 2016/09/11 01:03:15 sevan Exp $ +.\" $NetBSD: bioctl.8,v 1.23 2017/07/03 21:33:41 wiz Exp $ .\" $OpenBSD: bioctl.8,v 1.43 2007/03/20 06:12:11 jmc Exp $ .\" .\" Copyright (c) 2007, 2008 Juan Romero Pardines @@ -129,10 +129,10 @@ $ bioctl arcmsr0 show Volume Status Size Device/Label RAID Level Stripe = 0 Building 468G sd0 ARC-1210-VOL#00 RAID 6 128KB 0% done - 0:0 Online 234G 0:0.0 noencl \*[Lt]WDC WD2500YS-01SHB1 20.06C06\*[Gt] - 0:1 Online 234G 0:1.0 noencl \*[Lt]WDC WD2500YS-01SHB1 20.06C06\*[Gt] - 0:2 Online 234G 0:2.0 noencl \*[Lt]WDC WD2500YS-01SHB1 20.06C06\*[Gt] - 0:3 Online 234G 0:3.0 noencl \*[Lt]WDC WD2500YS-01SHB1 20.06C06\*[Gt] + 0:0 Online 234G 0:0.0 noencl + 0:1 Online 234G 0:1.0 noencl + 0:2 Online 234G 0:2.0 noencl + 0:3 Online 234G 0:3.0 noencl .Ed .Pp To create a RAID 5 volume on the SCSI 0:15.0 location on the disks Index: src/sbin/chown/chgrp.1 diff -u src/sbin/chown/chgrp.1:1.6 src/sbin/chown/chgrp.1:1.7 --- src/sbin/chown/chgrp.1:1.6 Tue Dec 17 09:54:08 2013 +++ src/sbin/chown/chgrp.1 Mon Jul 3 21:33:41 2017 @@ -29,7 +29,7 @@ .\" SUCH DAMAGE. .\" .\" from: @(#)chgrp.1 8.3 (Berkeley) 3/31/94 -.\" $NetBSD: chgrp.1,v 1.6 2013/12/17 09:54:08 apb Exp $ +.\" $NetBSD: chgrp.1,v 1.7 2017/07/03 21:33:41 wiz Exp $ .\" .Dd October 22, 2012 .Dt CHGRP 1 @@ -145,7 +145,7 @@ programs. .Pp The .Nm -utility exits 0 on success, and \*[Gt]0 if an error occurs. +utility exits 0 on success, and >0 if an error occurs. .Sh FILES .Bl -tag -width /etc/group -compact .It Pa /etc/group Index: src/sbin/chown/chown.8 diff -u src/sbin/chown/chown.8:1.10 src/sbin/chown/chown.8:1.11 --- src/sbin/chown/chown.8:1.10 Sun Sep 11 01:23:26 2016 +++ src/sbin/chown/chown.8 Mon Jul 3 21:33:41 2017 @@ -26,7 +26,7 @@ .\" SUCH DAMAGE. .\" .\" from: @(#)chown.8 8.3 (Berkeley) 3/31/94 -.\" $NetBSD: chown.8,v 1.10 2016/09/11 01:23:26 sevan Exp $ +.\" $NetBSD: chown.8,v 1.11 2017/07/03 21:33:41 wiz Exp $ .\" .Dd September 11, 2016 .Dt CHOWN 8 @@ -154,7 +154,7 @@ programs. .Pp The .Nm -utility exits 0 on success, and \*[Gt]0 if an error occurs. +utility exits 0 on success, and >0 if an error occurs. .Sh COMPATIBILITY Previous versions of the .Nm Index: src/sbin/disklabel/disklabel.5 diff -u src/sbin/disklabel/disklabel.5:1.29 src/sbin/disklabel/disklabel.5:1.30 --- src/sbin/disklabel/disklabel.5:1.29 Sat Oct 15 06:23:28 2016 +++ src/sbin/disklabel/disklabel.5 Mon Jul 3 21:33:41 2017 @@ -1,4 +1,4 @@ -.\" $NetBSD: disklabel.5,v 1.29 2
CVS commit: src/sbin
Module Name:src Committed By: christos Date: Wed Mar 23 21:43:33 UTC 2016 Modified Files: src/sbin/fsck_ffs: Makefile src/sbin/fsdb: Makefile Log Message: -O0 for pass1.c and vax To generate a diff of this commit: cvs rdiff -u -r1.45 -r1.46 src/sbin/fsck_ffs/Makefile cvs rdiff -u -r1.37 -r1.38 src/sbin/fsdb/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/fsck_ffs/Makefile diff -u src/sbin/fsck_ffs/Makefile:1.45 src/sbin/fsck_ffs/Makefile:1.46 --- src/sbin/fsck_ffs/Makefile:1.45 Sat Jul 5 15:22:03 2014 +++ src/sbin/fsck_ffs/Makefile Wed Mar 23 17:43:33 2016 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.45 2014/07/05 19:22:03 dholland Exp $ +# $NetBSD: Makefile,v 1.46 2016/03/23 21:43:33 christos Exp $ # @(#)Makefile 8.2 (Berkeley) 4/27/95 .include @@ -35,6 +35,9 @@ COPTS.ffs_appleufs.c+= -Wno-pointer-sign .if ${MACHINE_ARCH} == "m68000" COPTS.pass1.c+= -fno-tree-fre -fno-tree-lrs .endif +.if ${MACHINE_ARCH} == "vax" +COPTS.pass1.c+= -O0 +.endif SUBDIR+=SMM.doc Index: src/sbin/fsdb/Makefile diff -u src/sbin/fsdb/Makefile:1.37 src/sbin/fsdb/Makefile:1.38 --- src/sbin/fsdb/Makefile:1.37 Wed Apr 15 15:13:47 2015 +++ src/sbin/fsdb/Makefile Wed Mar 23 17:43:33 2016 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.37 2015/04/15 19:13:47 mrg Exp $ +# $NetBSD: Makefile,v 1.38 2016/03/23 21:43:33 christos Exp $ # @(#)Makefile 8.1 (Berkeley) 6/5/93 .include @@ -39,4 +39,8 @@ COPTS.${f}.c+= -Wno-pointer-sign COPTS.pass1.c+= -fno-tree-fre -fno-tree-lrs .endif +.if ${MACHINE_ARCH} == "vax" +COPTS.pass1.c+= -O0 +.endif + .include
CVS commit: src/sbin
Module Name:src Committed By: khorben Date: Fri May 6 00:24:45 UTC 2016 Modified Files: src/sbin/modload: main.c src/sbin/modunload: main.c Log Message: More friendly error messages for modload(8) and modunload(8) Tested on NetBSD/amd64. >From Christian Koch (cfkoch@) of EdgeBSD; thanks! To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/sbin/modload/main.c cvs rdiff -u -r1.4 -r1.5 src/sbin/modunload/main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/modload/main.c diff -u src/sbin/modload/main.c:1.15 src/sbin/modload/main.c:1.16 --- src/sbin/modload/main.c:1.15 Thu Feb 7 12:04:01 2013 +++ src/sbin/modload/main.c Fri May 6 00:24:45 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.15 2013/02/07 12:04:01 apb Exp $ */ +/* $NetBSD: main.c,v 1.16 2016/05/06 00:24:45 khorben Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -28,7 +28,7 @@ #include #ifndef lint -__RCSID("$NetBSD: main.c,v 1.15 2013/02/07 12:04:01 apb Exp $"); +__RCSID("$NetBSD: main.c,v 1.16 2016/05/06 00:24:45 khorben Exp $"); #endif /* !lint */ #include @@ -170,7 +170,7 @@ main(int argc, char **argv) cmdargs.ml_propslen = strlen(propsstr); if (prog_modctl(MODCTL_LOAD, &cmdargs)) { - err(EXIT_FAILURE, NULL); + err(EXIT_FAILURE, "%s", cmdargs.ml_filename); } } Index: src/sbin/modunload/main.c diff -u src/sbin/modunload/main.c:1.4 src/sbin/modunload/main.c:1.5 --- src/sbin/modunload/main.c:1.4 Mon Dec 13 20:48:45 2010 +++ src/sbin/modunload/main.c Fri May 6 00:24:45 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.4 2010/12/13 20:48:45 pooka Exp $ */ +/* $NetBSD: main.c,v 1.5 2016/05/06 00:24:45 khorben Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -28,7 +28,7 @@ #include #ifndef lint -__RCSID("$NetBSD: main.c,v 1.4 2010/12/13 20:48:45 pooka Exp $"); +__RCSID("$NetBSD: main.c,v 1.5 2016/05/06 00:24:45 khorben Exp $"); #endif /* !lint */ #include @@ -57,7 +57,7 @@ main(int argc, char **argv) for (i = 1; i < argc; i++) { if (prog_modctl(MODCTL_UNLOAD, argv[i])) { - err(EXIT_FAILURE, NULL); + err(EXIT_FAILURE, "%s", argv[i]); } }
CVS commit: src/sbin
Module Name:src Committed By: christos Date: Tue Oct 10 19:30:06 UTC 2017 Modified Files: src/sbin/ifconfig: Makefile src/sbin/ping6: Makefile src/sbin/route: Makefile Log Message: user librumpres To generate a diff of this commit: cvs rdiff -u -r1.60 -r1.61 src/sbin/ifconfig/Makefile cvs rdiff -u -r1.16 -r1.17 src/sbin/ping6/Makefile cvs rdiff -u -r1.29 -r1.30 src/sbin/route/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/ifconfig/Makefile diff -u src/sbin/ifconfig/Makefile:1.60 src/sbin/ifconfig/Makefile:1.61 --- src/sbin/ifconfig/Makefile:1.60 Wed Feb 8 18:34:15 2017 +++ src/sbin/ifconfig/Makefile Tue Oct 10 15:30:06 2017 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.60 2017/02/08 23:34:15 rin Exp $ +# $NetBSD: Makefile,v 1.61 2017/10/10 19:30:06 christos Exp $ # @(#)Makefile 8.1 (Berkeley) 6/5/93 # when making a change to this file, please check if the change is @@ -22,10 +22,10 @@ SRCS+= af_inet6.c .include "Makefile.common" -.PATH: ${.CURDIR}/../../lib/libc/net -RUMPSRCS= getifaddrs.c getnameinfo.c if_indextoname.c .if (${MKRUMP} != "no") CPPFLAGS+= -DRUMP_ACTION +LDADD.rump += -lrumpres +DPADD.rump += ${LIBRUMPRES} .endif .include Index: src/sbin/ping6/Makefile diff -u src/sbin/ping6/Makefile:1.16 src/sbin/ping6/Makefile:1.17 --- src/sbin/ping6/Makefile:1.16 Wed Sep 9 06:06:05 2015 +++ src/sbin/ping6/Makefile Tue Oct 10 15:30:06 2017 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.16 2015/09/09 10:06:05 ozaki-r Exp $ +# $NetBSD: Makefile,v 1.17 2017/10/10 19:30:06 christos Exp $ .include @@ -15,11 +15,10 @@ CPPFLAGS+= -DIPSEC LDADD+= -lipsec -lm DPADD+= ${LIBIPSEC} ${LIBM} -.PATH: ${.CURDIR}/../../lib/libc/net -RUMPSRCS= getaddrinfo.c getifaddrs.c getnameinfo.c -RUMPSRCS+= if_indextoname.c if_nametoindex.c .if (${MKRUMP} != "no") CPPFLAGS+= -DRUMP_ACTION +LDADD.rump+= -lrumpres +DPADD.rump+= ${LIBRUMPRES} .endif .include Index: src/sbin/route/Makefile diff -u src/sbin/route/Makefile:1.29 src/sbin/route/Makefile:1.30 --- src/sbin/route/Makefile:1.29 Mon Sep 14 01:12:52 2015 +++ src/sbin/route/Makefile Tue Oct 10 15:30:06 2017 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.29 2015/09/14 05:12:52 ozaki-r Exp $ +# $NetBSD: Makefile,v 1.30 2017/10/10 19:30:06 christos Exp $ # @(#)Makefile 8.1 (Berkeley) 6/5/93 .include @@ -7,11 +7,10 @@ RUMPPRG=route MAN= route.8 SRCS= route.c show.c keywords.c rtutil.c -.PATH: ${.CURDIR}/../../lib/libc/net -RUMPSRCS= getaddrinfo.c getifaddrs.c getnameinfo.c -RUMPSRCS+= if_indextoname.c if_nametoindex.c .if (${MKRUMP} != "no") CPPFLAGS+= -DRUMP_ACTION +LDADD.rump += -lrumpres +DPADD.rump += ${LIBRUMPRES} .endif .if (${USE_INET6} != "no")
CVS commit: src/sbin
Module Name:src Committed By: dholland Date: Tue Sep 1 06:15:02 UTC 2015 Modified Files: src/sbin/fsck_lfs: fsck_vars.h inode.c lfs.c pass1.c pass4.c pass5.c pass6.c segwrite.c segwrite.h setup.c src/sbin/newfs_lfs: make_lfs.c Log Message: Use daddr_t, not ulfs_daddr_t, as the latter's 32 bits wide. Don't use either for on-disk items. Declare external data in header files. Part 3 of 3. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/sbin/fsck_lfs/fsck_vars.h cvs rdiff -u -r1.61 -r1.62 src/sbin/fsck_lfs/inode.c cvs rdiff -u -r1.62 -r1.63 src/sbin/fsck_lfs/lfs.c cvs rdiff -u -r1.43 -r1.44 src/sbin/fsck_lfs/pass1.c \ src/sbin/fsck_lfs/segwrite.c cvs rdiff -u -r1.26 -r1.27 src/sbin/fsck_lfs/pass4.c cvs rdiff -u -r1.35 -r1.36 src/sbin/fsck_lfs/pass5.c cvs rdiff -u -r1.47 -r1.48 src/sbin/fsck_lfs/pass6.c cvs rdiff -u -r1.6 -r1.7 src/sbin/fsck_lfs/segwrite.h cvs rdiff -u -r1.58 -r1.59 src/sbin/fsck_lfs/setup.c cvs rdiff -u -r1.47 -r1.48 src/sbin/newfs_lfs/make_lfs.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/fsck_lfs/fsck_vars.h diff -u src/sbin/fsck_lfs/fsck_vars.h:1.14 src/sbin/fsck_lfs/fsck_vars.h:1.15 --- src/sbin/fsck_lfs/fsck_vars.h:1.14 Wed Aug 12 18:28:00 2015 +++ src/sbin/fsck_lfs/fsck_vars.h Tue Sep 1 06:15:02 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: fsck_vars.h,v 1.14 2015/08/12 18:28:00 dholland Exp $ */ +/* $NetBSD: fsck_vars.h,v 1.15 2015/09/01 06:15:02 dholland Exp $ */ /* * Copyright (c) 1980, 1986, 1993 @@ -77,3 +77,9 @@ extern daddr_t n_blks; /* number of blo extern ino_t n_files; /* number of files in use */ extern int no_roll_forward; /* Don't roll forward */ + +blkcnt_t badblkcount; /* count of "bad" blocks */ + +/* from setup.c */ +extern SEGUSE *seg_table; +extern daddr_t *din_table; Index: src/sbin/fsck_lfs/inode.c diff -u src/sbin/fsck_lfs/inode.c:1.61 src/sbin/fsck_lfs/inode.c:1.62 --- src/sbin/fsck_lfs/inode.c:1.61 Tue Sep 1 06:08:37 2015 +++ src/sbin/fsck_lfs/inode.c Tue Sep 1 06:15:02 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: inode.c,v 1.61 2015/09/01 06:08:37 dholland Exp $ */ +/* $NetBSD: inode.c,v 1.62 2015/09/01 06:15:02 dholland Exp $ */ /*- * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. @@ -87,9 +87,6 @@ #include "fsutil.h" #include "extern.h" -extern SEGUSE *seg_table; -extern ulfs_daddr_t *din_table; - static int iblock(struct inodesc *, long, u_int64_t); int blksreqd(struct lfs *, int); int lfs_maxino(void); @@ -128,7 +125,7 @@ ginode(ino_t ino) int ckinode(union lfs_dinode *dp, struct inodesc *idesc) { - ulfs_daddr_t lbn, pbn; + daddr_t lbn, pbn; long ret, n, ndb, offset; union lfs_dinode dino; u_int64_t remsize, sizepb; @@ -234,7 +231,8 @@ ckinode(union lfs_dinode *dp, struct ino static int iblock(struct inodesc *idesc, long ilevel, u_int64_t isize) { - ulfs_daddr_t *ap, *aplim; + unsigned j, maxindir; + daddr_t found; struct ubuf *bp; int i, n, (*func) (struct inodesc *), nif; u_int64_t sizepb; @@ -263,23 +261,25 @@ iblock(struct inodesc *idesc, long ileve else nif = howmany(isize, sizepb); if (idesc->id_func == pass1check && nif < LFS_NINDIR(fs)) { - aplim = ((ulfs_daddr_t *) bp->b_data) + LFS_NINDIR(fs); - for (ap = ((ulfs_daddr_t *) bp->b_data) + nif; ap < aplim; ap++) { - if (*ap == 0) + maxindir = LFS_NINDIR(fs); + for (j = nif; j < maxindir; j++) { + found = lfs_iblock_get(fs, bp->b_data, j); + if (found == 0) continue; (void)snprintf(buf, sizeof(buf), "PARTIALLY TRUNCATED INODE I=%llu", (unsigned long long)idesc->id_number); if (dofix(idesc, buf)) { -*ap = 0; +lfs_iblock_set(fs, bp->b_data, j, 0); ++diddirty; } } } - aplim = ((ulfs_daddr_t *) bp->b_data) + nif; - for (ap = ((ulfs_daddr_t *) bp->b_data); ap < aplim; ap++) { - if (*ap) { - idesc->id_blkno = *ap; + maxindir = nif; + for (j = 0; j < maxindir; j++) { + found = lfs_iblock_get(fs, bp->b_data, j); + if (found) { + idesc->id_blkno = found; if (ilevel == 0) { /* * dirscan needs lfs_lblkno. @@ -370,7 +370,7 @@ cacheino(union lfs_dinode *dp, ino_t inu blks = howmany(lfs_dino_getsize(fs, dp), lfs_sb_getbsize(fs)); if (blks > ULFS_NDADDR) blks = ULFS_NDADDR + ULFS_NIADDR; - inp = emalloc(sizeof(*inp) + (blks - 1) * sizeof(ulfs_daddr_t)); + inp = emalloc(sizeof(*inp) + (blks - 1) * sizeof(inp->i_blks[0])); inpp = &inphead[inumber % numdirs]; inp->i_nexthash = *inpp; *inpp = inp; @@ -383,7 +383,7 @@ cacheino(union lfs_dinode *dp, ino_t inu inp->i_number = inumber; inp->i_isize = lfs_dino_getsize(fs, dp); - inp->i_numblks = blks * sizeof(ulfs_daddr_t); + inp->i_numblks = blks * sizeof(inp->i_blks[0]); for (i=0; ii_blks[i] = lfs_dino_getdb(fs, dp, i); } Index: src/sbin/fsck_lfs/lfs.c diff -u src/sbin/fsck_lfs/lfs.c:1.62 src/sbin/fsck_lfs/lfs.c:1.63 --- src/sbin/fsck_lfs/lfs.c:1.62 Tue Sep 1
CVS commit: src/sbin
Module Name:src Committed By: manu Date: Mon Mar 25 02:13:01 UTC 2019 Modified Files: src/sbin/dump: dump.8 dump.h itime.c main.c src/sbin/dump_lfs: dump_lfs.8 Log Message: Add -U flag to dump(8) and dump_lfs(8) to specify dumpdates entry This address situations where dump(8) cannot figure out the device being dumped. It also allows tracking of subvolume dumps by using virtual device as dumpdates entry. To generate a diff of this commit: cvs rdiff -u -r1.69 -r1.70 src/sbin/dump/dump.8 cvs rdiff -u -r1.56 -r1.57 src/sbin/dump/dump.h cvs rdiff -u -r1.21 -r1.22 src/sbin/dump/itime.c cvs rdiff -u -r1.74 -r1.75 src/sbin/dump/main.c cvs rdiff -u -r1.17 -r1.18 src/sbin/dump_lfs/dump_lfs.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/dump/dump.8 diff -u src/sbin/dump/dump.8:1.69 src/sbin/dump/dump.8:1.70 --- src/sbin/dump/dump.8:1.69 Sun Jul 15 06:14:13 2018 +++ src/sbin/dump/dump.8 Mon Mar 25 02:13:01 2019 @@ -1,4 +1,4 @@ -.\" $NetBSD: dump.8,v 1.69 2018/07/15 06:14:13 dholland Exp $ +.\" $NetBSD: dump.8,v 1.70 2019/03/25 02:13:01 manu Exp $ .\" .\" Copyright (c) 1980, 1991, 1993 .\" Regents of the University of California. @@ -51,6 +51,7 @@ .Op Fl r Ar cachesize .Op Fl s Ar feet .Op Fl T Ar date +.Op Fl U Ar dumpdev .Op Fl x Ar snap-backup .Ar files-to-dump .Nm @@ -299,10 +300,22 @@ The file .Pa /etc/dumpdates may be edited to change any of the fields, if necessary. -If a list of files or subdirectories is being dumped +If the +.Fl T +option is used or if a list of files or subdirectories is being dumped (as opposed to an entire file system), then .Fl u is ignored. +.It Fl U Ar dumpdev +Same as +.Fl u +but specifies the device in +.Pa /etc/dumpdates +as +.Ar dumpdev . +This option can be used with subdir dumps and with the +.Fl T +option. .It Fl W .Nm tells the operator what file systems need to be dumped. Index: src/sbin/dump/dump.h diff -u src/sbin/dump/dump.h:1.56 src/sbin/dump/dump.h:1.57 --- src/sbin/dump/dump.h:1.56 Fri Mar 1 16:42:11 2019 +++ src/sbin/dump/dump.h Mon Mar 25 02:13:01 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: dump.h,v 1.56 2019/03/01 16:42:11 christos Exp $ */ +/* $NetBSD: dump.h,v 1.57 2019/03/25 02:13:01 manu Exp $ */ /*- * Copyright (c) 1980, 1993 @@ -115,6 +115,7 @@ const char *temp; /* name of the file fo char lastlevel; /* dump level of previous dump */ char level; /* dump level of this dump */ int uflag; /* update flag */ +const char *dumpdev; /* device name in dumpdates */ int eflag; /* eject flag */ int lflag; /* autoload flag */ int diskfd; /* disk file descriptor */ Index: src/sbin/dump/itime.c diff -u src/sbin/dump/itime.c:1.21 src/sbin/dump/itime.c:1.22 --- src/sbin/dump/itime.c:1.21 Fri Mar 1 16:42:11 2019 +++ src/sbin/dump/itime.c Mon Mar 25 02:13:01 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: itime.c,v 1.21 2019/03/01 16:42:11 christos Exp $ */ +/* $NetBSD: itime.c,v 1.22 2019/03/25 02:13:01 manu Exp $ */ /*- * Copyright (c) 1980, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)itime.c 8.1 (Berkeley) 6/5/93"; #else -__RCSID("$NetBSD: itime.c,v 1.21 2019/03/01 16:42:11 christos Exp $"); +__RCSID("$NetBSD: itime.c,v 1.22 2019/03/25 02:13:01 manu Exp $"); #endif #endif /* not lint */ @@ -129,9 +129,9 @@ getdumptime(void) { struct dumpdates *ddp; int i; - char *fname; + const char *fname; - fname = disk; + fname = dumpdev ? dumpdev : disk; #ifdef FDEBUG msg("Looking for name %s in dumpdates = %s for level = %c\n", fname, dumpdates, level); @@ -170,15 +170,15 @@ putdumptime(void) struct dumpdates *dtwalk, *dtfound; int i; int fd; - char *fname; + const char *fname; - if(uflag == 0) + if (uflag == 0 && dumpdev == NULL) return; if ((df = fopen(dumpdates, "r+")) == NULL) quite(errno, "cannot rewrite %s", dumpdates); fd = fileno(df); (void) flock(fd, LOCK_EX); - fname = disk; + fname = dumpdev ? dumpdev : disk; free((char *)ddatev); ddatev = 0; nddates = 0; Index: src/sbin/dump/main.c diff -u src/sbin/dump/main.c:1.74 src/sbin/dump/main.c:1.75 --- src/sbin/dump/main.c:1.74 Fri Mar 1 16:42:11 2019 +++ src/sbin/dump/main.c Mon Mar 25 02:13:01 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.74 2019/03/01 16:42:11 christos Exp $ */ +/* $NetBSD: main.c,v 1.75 2019/03/25 02:13:01 manu Exp $ */ /*- * Copyright (c) 1980, 1991, 1993, 1994 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19 #if 0 static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 5/1/95"; #else -__RCSID("$NetBSD: main.c,v 1.74 2019/03/01 16:42:11 christos Exp $"); +__RCSID("$NetBSD: main.c,v 1.75 2019/03/25 02:13:01 manu Exp $"); #endif #endif /* not lint */ @@ -133,7 +133,7 @@ main(int argc, char *argv[]) obsolete(&argc, &argv); while ((ch = getopt(argc, argv, - "0123456789aB:b:cd:eFf:h:ik:l:L:nr:s:StT:uWwx:X")) != -1) + "0123456789aB:b:cd:eFf:h:ik:l:L:nr:s:StT:uU:Wwx:X")) != -1)
CVS commit: src/sbin
Module Name:src Committed By: maya Date: Sat Apr 13 19:29:27 UTC 2019 Modified Files: src/sbin/newfs: newfs.8 src/sbin/newfs_ext2fs: newfs_ext2fs.8 Log Message: Omit mention of old vnd(4) bug, now resolved. Via elge, thanks. To generate a diff of this commit: cvs rdiff -u -r1.84 -r1.85 src/sbin/newfs/newfs.8 cvs rdiff -u -r1.13 -r1.14 src/sbin/newfs_ext2fs/newfs_ext2fs.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/newfs/newfs.8 diff -u src/sbin/newfs/newfs.8:1.84 src/sbin/newfs/newfs.8:1.85 --- src/sbin/newfs/newfs.8:1.84 Mon Jul 3 21:33:42 2017 +++ src/sbin/newfs/newfs.8 Sat Apr 13 19:29:27 2019 @@ -1,4 +1,4 @@ -.\" $NetBSD: newfs.8,v 1.84 2017/07/03 21:33:42 wiz Exp $ +.\" $NetBSD: newfs.8,v 1.85 2019/04/13 19:29:27 maya Exp $ .\" .\" Copyright (c) 1983, 1987, 1991, 1993, 1994 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" @(#)newfs.8 8.6 (Berkeley) 5/3/95 .\" -.Dd June 30, 2012 +.Dd April 13, 2019 .Dt NEWFS 8 .Os .Sh NAME @@ -319,10 +319,6 @@ with the given volume name. .It Fl Z Pre-zeros the file system image created with .Fl F . -This is necessary if the image is to be used by -.Xr vnd 4 -(which doesn't support file systems with -.Sq holes ) . .El .Pp The following option overrides the standard sizes for the disk geometry. Index: src/sbin/newfs_ext2fs/newfs_ext2fs.8 diff -u src/sbin/newfs_ext2fs/newfs_ext2fs.8:1.13 src/sbin/newfs_ext2fs/newfs_ext2fs.8:1.14 --- src/sbin/newfs_ext2fs/newfs_ext2fs.8:1.13 Wed Mar 6 05:11:13 2019 +++ src/sbin/newfs_ext2fs/newfs_ext2fs.8 Sat Apr 13 19:29:27 2019 @@ -1,4 +1,4 @@ -.\" $NetBSD: newfs_ext2fs.8,v 1.13 2019/03/06 05:11:13 mrg Exp $ +.\" $NetBSD: newfs_ext2fs.8,v 1.14 2019/04/13 19:29:27 maya Exp $ .\" .\" Copyright (c) 1983, 1987, 1991, 1993, 1994 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" @(#)newfs.8 8.6 (Berkeley) 5/3/95 .\" -.Dd March 5, 2019 +.Dd April 13, 2019 .Dt NEWFS_EXT2FS 8 .Os .Sh NAME @@ -208,10 +208,6 @@ This specifies a volume name for the fil .It Fl Z Pre-zeros the file system image created with .Fl F . -This is necessary if the image is to be used by -.Xr vnd 4 -(which doesn't support file systems with -.Sq holes ) . .El .Pp The following option overrides the standard sizes for the disk geometry.
CVS commit: src/sbin
Module Name:src Committed By: sevan Date: Mon Sep 5 01:09:58 UTC 2016 Modified Files: src/sbin/badsect: badsect.c src/sbin/modload: main.c src/sbin/modstat: main.c src/sbin/modunload: main.c src/sbin/mount_hfs: mount_hfs.c src/sbin/mount_ptyfs: mount_ptyfs.c src/sbin/rcorder: rcorder.c Log Message: Drop main() prototype. To generate a diff of this commit: cvs rdiff -u -r1.33 -r1.34 src/sbin/badsect/badsect.c cvs rdiff -u -r1.16 -r1.17 src/sbin/modload/main.c cvs rdiff -u -r1.22 -r1.23 src/sbin/modstat/main.c cvs rdiff -u -r1.5 -r1.6 src/sbin/modunload/main.c cvs rdiff -u -r1.9 -r1.10 src/sbin/mount_hfs/mount_hfs.c cvs rdiff -u -r1.16 -r1.17 src/sbin/mount_ptyfs/mount_ptyfs.c cvs rdiff -u -r1.17 -r1.18 src/sbin/rcorder/rcorder.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/badsect/badsect.c diff -u src/sbin/badsect/badsect.c:1.33 src/sbin/badsect/badsect.c:1.34 --- src/sbin/badsect/badsect.c:1.33 Sun Jun 23 02:06:04 2013 +++ src/sbin/badsect/badsect.c Mon Sep 5 01:09:57 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: badsect.c,v 1.33 2013/06/23 02:06:04 dholland Exp $ */ +/* $NetBSD: badsect.c,v 1.34 2016/09/05 01:09:57 sevan Exp $ */ /* * Copyright (c) 1981, 1983, 1993 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1981, 19 #if 0 static char sccsid[] = "@(#)badsect.c 8.2 (Berkeley) 5/4/95"; #else -__RCSID("$NetBSD: badsect.c,v 1.33 2013/06/23 02:06:04 dholland Exp $"); +__RCSID("$NetBSD: badsect.c,v 1.34 2016/09/05 01:09:57 sevan Exp $"); #endif #endif /* not lint */ @@ -90,8 +90,6 @@ static int is_ufs2; static void rdfs(off_t, size_t, void *); static int chkuse(daddr_t, int); -int main(int, char *[]); - static const off_t sblock_try[] = SBLOCKSEARCH; int Index: src/sbin/modload/main.c diff -u src/sbin/modload/main.c:1.16 src/sbin/modload/main.c:1.17 --- src/sbin/modload/main.c:1.16 Fri May 6 00:24:45 2016 +++ src/sbin/modload/main.c Mon Sep 5 01:09:57 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.16 2016/05/06 00:24:45 khorben Exp $ */ +/* $NetBSD: main.c,v 1.17 2016/09/05 01:09:57 sevan Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -28,7 +28,7 @@ #include #ifndef lint -__RCSID("$NetBSD: main.c,v 1.16 2016/05/06 00:24:45 khorben Exp $"); +__RCSID("$NetBSD: main.c,v 1.17 2016/09/05 01:09:57 sevan Exp $"); #endif /* !lint */ #include @@ -46,7 +46,6 @@ __RCSID("$NetBSD: main.c,v 1.16 2016/05/ #include "prog_ops.h" -int main(int, char **); static void parse_bool_param(prop_dictionary_t, const char *, const char *); static void parse_int_param(prop_dictionary_t, const char *, Index: src/sbin/modstat/main.c diff -u src/sbin/modstat/main.c:1.22 src/sbin/modstat/main.c:1.23 --- src/sbin/modstat/main.c:1.22 Wed Aug 3 23:55:47 2016 +++ src/sbin/modstat/main.c Mon Sep 5 01:09:57 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.22 2016/08/03 23:55:47 pgoyette Exp $ */ +/* $NetBSD: main.c,v 1.23 2016/09/05 01:09:57 sevan Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -28,7 +28,7 @@ #include #ifndef lint -__RCSID("$NetBSD: main.c,v 1.22 2016/08/03 23:55:47 pgoyette Exp $"); +__RCSID("$NetBSD: main.c,v 1.23 2016/09/05 01:09:57 sevan Exp $"); #endif /* !lint */ #include @@ -45,7 +45,6 @@ __RCSID("$NetBSD: main.c,v 1.22 2016/08/ #include "prog_ops.h" -int main(int, char **); static void usage(void) __dead; static int modstatcmp(const void *, const void *); Index: src/sbin/modunload/main.c diff -u src/sbin/modunload/main.c:1.5 src/sbin/modunload/main.c:1.6 --- src/sbin/modunload/main.c:1.5 Fri May 6 00:24:45 2016 +++ src/sbin/modunload/main.c Mon Sep 5 01:09:57 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.5 2016/05/06 00:24:45 khorben Exp $ */ +/* $NetBSD: main.c,v 1.6 2016/09/05 01:09:57 sevan Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -28,7 +28,7 @@ #include #ifndef lint -__RCSID("$NetBSD: main.c,v 1.5 2016/05/06 00:24:45 khorben Exp $"); +__RCSID("$NetBSD: main.c,v 1.6 2016/09/05 01:09:57 sevan Exp $"); #endif /* !lint */ #include @@ -41,7 +41,6 @@ __RCSID("$NetBSD: main.c,v 1.5 2016/05/0 #include "prog_ops.h" -int main(int, char **); static void usage(void) __dead; int Index: src/sbin/mount_hfs/mount_hfs.c diff -u src/sbin/mount_hfs/mount_hfs.c:1.9 src/sbin/mount_hfs/mount_hfs.c:1.10 --- src/sbin/mount_hfs/mount_hfs.c:1.9 Mon Aug 29 14:35:01 2011 +++ src/sbin/mount_hfs/mount_hfs.c Mon Sep 5 01:09:57 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: mount_hfs.c,v 1.9 2011/08/29 14:35:01 joerg Exp $ */ +/* $NetBSD: mount_hfs.c,v 1.10 2016/09/05 01:09:57 sevan Exp $ */ /*- * Copyright (c) 2005, 2007 The NetBSD Foundation, Inc. @@ -64,7 +64,7 @@ __COPYRIGHT("@(#) Copyright (c) 2005 Yev #endif /* not lint */ #ifndef lint -__RCSID("$NetBSD: mount_hfs.c,v 1.9 2011/08/29 14:35:01 joerg Exp $"); +__RCSID("$NetB
CVS commit: src/sbin
Module Name:src Committed By: pgoyette Date: Sat Nov 28 23:53:48 UTC 2015 Modified Files: src/sbin/modload: modload.8 src/sbin/modunload: modunload.8 Log Message: Add cross-refs from modload(8) amd modunload(8) to modctl(2) To generate a diff of this commit: cvs rdiff -u -r1.42 -r1.43 src/sbin/modload/modload.8 cvs rdiff -u -r1.20 -r1.21 src/sbin/modunload/modunload.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/modload/modload.8 diff -u src/sbin/modload/modload.8:1.42 src/sbin/modload/modload.8:1.43 --- src/sbin/modload/modload.8:1.42 Sat Aug 6 08:43:28 2011 +++ src/sbin/modload/modload.8 Sat Nov 28 23:53:48 2015 @@ -1,4 +1,4 @@ -.\" $NetBSD: modload.8,v 1.42 2011/08/06 08:43:28 wiz Exp $ +.\" $NetBSD: modload.8,v 1.43 2015/11/28 23:53:48 pgoyette Exp $ .\" .\" Copyright (c) 1993 Christopher G. Demetriou .\" All rights reserved. @@ -32,7 +32,7 @@ .\" .\" <> .\" -.Dd August 6, 2011 +.Dd November 29, 2015 .Dt MODLOAD 8 .Os .Sh NAME @@ -128,6 +128,7 @@ The utility exits with a status of 0 on success and with a nonzero status if an error occurs. .Sh SEE ALSO +.Xr modctl 2 , .Xr module 7 , .Xr modstat 8 , .Xr modunload 8 Index: src/sbin/modunload/modunload.8 diff -u src/sbin/modunload/modunload.8:1.20 src/sbin/modunload/modunload.8:1.21 --- src/sbin/modunload/modunload.8:1.20 Tue Dec 14 16:24:00 2010 +++ src/sbin/modunload/modunload.8 Sat Nov 28 23:53:48 2015 @@ -1,4 +1,4 @@ -.\" $NetBSD: modunload.8,v 1.20 2010/12/14 16:24:00 jruoho Exp $ +.\" $NetBSD: modunload.8,v 1.21 2015/11/28 23:53:48 pgoyette Exp $ .\" .\" Copyright (c) 1993 Christopher G. Demetriou .\" All rights reserved. @@ -32,7 +32,7 @@ .\" .\" <> .\" -.Dd December 14, 2010 +.Dd November 29, 2015 .Dt MODUNLOAD 8 .Os .Sh NAME @@ -61,6 +61,7 @@ The utility exits with a status of 0 on success and with a nonzero status if an error occurs. .Sh SEE ALSO +.Xr modctl 2 , .Xr module 7 , .Xr modload 8 , .Xr modstat 8
CVS commit: src/sbin
Module Name:src Committed By: christos Date: Sun Jan 14 22:44:04 UTC 2018 Modified Files: src/sbin: Makefile Added Files: src/sbin/mount_autofs: Makefile mount_autofs.c mount_autofs.h Log Message: Add mount_autofs To generate a diff of this commit: cvs rdiff -u -r1.131 -r1.132 src/sbin/Makefile cvs rdiff -u -r0 -r1.1 src/sbin/mount_autofs/Makefile \ src/sbin/mount_autofs/mount_autofs.c src/sbin/mount_autofs/mount_autofs.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/Makefile diff -u src/sbin/Makefile:1.131 src/sbin/Makefile:1.132 --- src/sbin/Makefile:1.131 Sat Nov 25 18:29:43 2017 +++ src/sbin/Makefile Sun Jan 14 17:44:04 2018 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.131 2017/11/25 23:29:43 jmcneill Exp $ +# $NetBSD: Makefile,v 1.132 2018/01/14 22:44:04 christos Exp $ # @(#)Makefile 8.5 (Berkeley) 3/31/94 # Not ported: XNSrouted enpload scsiformat startslip @@ -25,6 +25,7 @@ SUBDIR+= newfs_sysvbfs SUBDIR+= newfs_udf SUBDIR+= newfs_v7fs fsck_v7fs SUBDIR+= mount_ados +SUBDIR+= mount_autofs SUBDIR+= mount_cd9660 SUBDIR+= mount_chfs SUBDIR+= mount_efs Added files: Index: src/sbin/mount_autofs/Makefile diff -u /dev/null src/sbin/mount_autofs/Makefile:1.1 --- /dev/null Sun Jan 14 17:44:05 2018 +++ src/sbin/mount_autofs/Makefile Sun Jan 14 17:44:04 2018 @@ -0,0 +1,14 @@ +# $NetBSD: Makefile,v 1.1 2018/01/14 22:44:04 christos Exp $ +# @(#)Makefile 8.2 (Berkeley) 3/27/94 + +NOMAN= +.include + +PROG= mount_autofs +SRCS= mount_autofs.c +#MAN= mount_autofs.8 + +DPADD+=${LIBUTIL} +LDADD+=-lutil + +.include Index: src/sbin/mount_autofs/mount_autofs.c diff -u /dev/null src/sbin/mount_autofs/mount_autofs.c:1.1 --- /dev/null Sun Jan 14 17:44:05 2018 +++ src/sbin/mount_autofs/mount_autofs.c Sun Jan 14 17:44:04 2018 @@ -0,0 +1,146 @@ +/* $NetBSD: mount_autofs.c,v 1.1 2018/01/14 22:44:04 christos Exp $ */ + +/*- + * Copyright (c) 2018 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#include +#ifndef lint +__RCSID("$NetBSD: mount_autofs.c,v 1.1 2018/01/14 22:44:04 christos Exp $"); +#endif /* not lint */ + +#include +#include + +#include +#include +#include +#include +#include + +#include + +#include + +#include "mount_autofs.h" + +static const struct mntopt mopts[] = { + MOPT_STDOPTS, + MOPT_GETARGS, + MOPT_NULL, +}; + +int mount_autofs(int argc, char **argv); +__dead static void usage(void); + +#ifndef MOUNT_NOMAIN +int +main(int argc, char **argv) +{ + return mount_autofs(argc, argv); +} +#endif + +void +mount_autofs_parseargs(int argc, char *argv[], void *v, int *mntflags, + char *canon_dev, char *canon_dir) +{ + int ch; + mntoptparse_t mp; + struct autofs_args *am = v; + + *mntflags = 0; + while ((ch = getopt(argc, argv, "f:o:O:p:")) != -1) + switch (ch) { + case 'f': + strlcpy(am->from, optarg, MAXPATHLEN); + break; + case 'o': + mp = getmntopts(optarg, mopts, mntflags, 0); + if (mp == NULL) +err(EXIT_FAILURE, "getmntopts"); + freemntopts(mp); + break; + case 'O': + strlcpy(am->master_options, optarg, MAXPATHLEN); + break; + case 'p': + strlcpy(am->master_prefix, optarg, MAXPATHLEN); + break; + + case '?': + default: + usage(); + } + argc -= optind; + argv += optind; + + if (argc != 2) + usage(); + + strlcpy(canon_dev, argv[0], MAXPATHLEN); + if (realpath(argv[1], canon_dir) == NULL)/* Check mounton path */ + err(EXIT_FAILURE, "realpath %s", canon_dir); + if (strncmp(argv[1], canon_dir, MAXPATHLEN))
CVS commit: src/sbin
Module Name:src Committed By: christos Date: Fri Jul 1 22:50:50 UTC 2016 Modified Files: src/sbin: Makefile Log Message: cgdconfig does not need crypto. To generate a diff of this commit: cvs rdiff -u -r1.128 -r1.129 src/sbin/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/Makefile diff -u src/sbin/Makefile:1.128 src/sbin/Makefile:1.129 --- src/sbin/Makefile:1.128 Sat Jun 4 12:29:35 2016 +++ src/sbin/Makefile Fri Jul 1 18:50:50 2016 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.128 2016/06/04 16:29:35 nonaka Exp $ +# $NetBSD: Makefile,v 1.129 2016/07/01 22:50:50 christos Exp $ # @(#)Makefile 8.5 (Berkeley) 3/31/94 # Not ported: XNSrouted enpload scsiformat startslip @@ -6,7 +6,7 @@ .include -SUBDIR= amrctl apmlabel atactl badsect bioctl brconfig ccdconfig \ +SUBDIR= amrctl apmlabel atactl badsect bioctl brconfig ccdconfig cgdconfig \ chown devpubd disklabel dkctl dkscan_bsdlabel dmesg dmctl \ drvctl fastboot fdisk fsck fsirand gpt ifconfig init ldconfig luactl \ mbrlabel mknod modload modstat modunload mount \ @@ -51,9 +51,6 @@ SUBDIR+= mount_umap SUBDIR+= mount_union SUBDIR+= mount_v7fs -.if (${MKCRYPTO} != "no") -SUBDIR+= cgdconfig -.endif .if (${USE_INET6} != "no") SUBDIR+= ping6
CVS commit: src/sbin
Module Name:src Committed By: rillig Date: Fri Jun 11 18:47:56 UTC 2021 Modified Files: src/sbin/ping: ping.c src/sbin/ping6: ping6.c Log Message: ping, ping6: fix comment about ID field Since ping.c 1.76 and ping6.c 1.58 from 2004-04-22, the ID field contains random bits instead of a process ID. To generate a diff of this commit: cvs rdiff -u -r1.117 -r1.118 src/sbin/ping/ping.c cvs rdiff -u -r1.105 -r1.106 src/sbin/ping6/ping6.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/ping/ping.c diff -u src/sbin/ping/ping.c:1.117 src/sbin/ping/ping.c:1.118 --- src/sbin/ping/ping.c:1.117 Mon Oct 2 10:08:11 2017 +++ src/sbin/ping/ping.c Fri Jun 11 18:47:56 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: ping.c,v 1.117 2017/10/02 10:08:11 maya Exp $ */ +/* $NetBSD: ping.c,v 1.118 2021/06/11 18:47:56 rillig Exp $ */ /* * Copyright (c) 1989, 1993 @@ -58,7 +58,7 @@ #include #ifndef lint -__RCSID("$NetBSD: ping.c,v 1.117 2017/10/02 10:08:11 maya Exp $"); +__RCSID("$NetBSD: ping.c,v 1.118 2021/06/11 18:47:56 rillig Exp $"); #endif #include @@ -187,7 +187,7 @@ static int optlen; static int npackets;/* total packets to send */ static int preload;/* number of packets to "preload" */ static int ntransmitted; /* output sequence # = #sent */ -static int ident;/* our ID, in network byte order */ +static int ident;/* 16 random bits to identify our packets */ static int nreceived;/* # of packets we got back */ @@ -884,7 +884,7 @@ jiggle(int delta) /* * Compose and transmit an ICMP ECHO REQUEST packet. The IP packet - * will be added on by the kernel. The ID field is our UNIX process ID, + * will be added on by the kernel. The ID field is random, * and the sequence number is an ascending integer. The first phdrlen bytes * of the data portion are used to hold a UNIX "timeval" struct in VAX * byte-order, to compute the round-trip time, or a UNIX "timespec" in native Index: src/sbin/ping6/ping6.c diff -u src/sbin/ping6/ping6.c:1.105 src/sbin/ping6/ping6.c:1.106 --- src/sbin/ping6/ping6.c:1.105 Mon Jun 7 22:13:34 2021 +++ src/sbin/ping6/ping6.c Fri Jun 11 18:47:56 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: ping6.c,v 1.105 2021/06/07 22:13:34 dholland Exp $ */ +/* $NetBSD: ping6.c,v 1.106 2021/06/11 18:47:56 rillig Exp $ */ /* $KAME: ping6.c,v 1.164 2002/11/16 14:05:37 itojun Exp $ */ /* @@ -77,7 +77,7 @@ static char sccsid[] = "@(#)ping.c 8.1 ( #else #include #ifndef lint -__RCSID("$NetBSD: ping6.c,v 1.105 2021/06/07 22:13:34 dholland Exp $"); +__RCSID("$NetBSD: ping6.c,v 1.106 2021/06/11 18:47:56 rillig Exp $"); #endif #endif @@ -205,7 +205,7 @@ static u_char outpack[MAXPACKETLEN] __al static char BSPACE = '\b'; /* characters written for flood */ static char DOT = '.'; static char *hostname; -static int ident; /* process id to identify our packets */ +static int ident; /* 16 random bits to identify our packets */ static u_int8_t nonce[8]; /* nonce field for node information */ static int hoplimit = -1; /* hoplimit */ @@ -1055,7 +1055,7 @@ onsignal(int sig) /* * pinger -- * Compose and transmit an ICMP ECHO REQUEST packet. The IP packet - * will be added on by the kernel. The ID field is our UNIX process ID, + * will be added on by the kernel. The ID field is random, * and the sequence number is an ascending integer. The first 8 bytes * of the data portion are used to hold a UNIX "timeval" struct in VAX * byte-order, to compute the round-trip time.
CVS commit: src/sbin
Module Name:src Committed By: rin Date: Wed Feb 8 18:05:25 UTC 2017 Modified Files: src/sbin/fsck_ffs: fsck.h src/sbin/newfs: extern.h Log Message: __empty -> __nothing To generate a diff of this commit: cvs rdiff -u -r1.51 -r1.52 src/sbin/fsck_ffs/fsck.h cvs rdiff -u -r1.17 -r1.18 src/sbin/newfs/extern.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/fsck_ffs/fsck.h diff -u src/sbin/fsck_ffs/fsck.h:1.51 src/sbin/fsck_ffs/fsck.h:1.52 --- src/sbin/fsck_ffs/fsck.h:1.51 Wed Feb 8 16:23:24 2017 +++ src/sbin/fsck_ffs/fsck.h Wed Feb 8 18:05:25 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: fsck.h,v 1.51 2017/02/08 16:23:24 christos Exp $ */ +/* $NetBSD: fsck.h,v 1.52 2017/02/08 18:05:25 rin Exp $ */ /* * Copyright (c) 1980, 1986, 1993 @@ -307,11 +307,11 @@ int do_dirswap; /* need to do dir entry #define needswap (0) #define do_blkswap (0) #define do_dirswap (0) -#define ffs_cg_swap(a, b, c) __empty -#define ffs_csum_swap(a, b, c) __empty -#define ffs_sb_swap(a, b) __empty -#define swap_dinode1(a, b) __empty -#define swap_dinode2(a, b) __empty +#define ffs_cg_swap(a, b, c) __nothing +#define ffs_csum_swap(a, b, c) __nothing +#define ffs_sb_swap(a, b) __nothing +#define swap_dinode1(a, b) __nothing +#define swap_dinode2(a, b) __nothing #endif #ifndef NO_APPLE_UFS Index: src/sbin/newfs/extern.h diff -u src/sbin/newfs/extern.h:1.17 src/sbin/newfs/extern.h:1.18 --- src/sbin/newfs/extern.h:1.17 Wed Feb 8 16:56:56 2017 +++ src/sbin/newfs/extern.h Wed Feb 8 18:05:25 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: extern.h,v 1.17 2017/02/08 16:56:56 rin Exp $ */ +/* $NetBSD: extern.h,v 1.18 2017/02/08 18:05:25 rin Exp $ */ /* * Copyright (c) 1997 Christos Zoulas. All rights reserved. @@ -59,10 +59,10 @@ extern int needswap; /* Filesystem not i #else /* Disable Endian-Independent FFS support for install media */ #define needswap (0) -#define ffs_cg_swap(a, b, c) __empty -#define ffs_csum_swap(a, b, c) __empty -#define ffs_dinode1_swap(a, b) __empty -#define ffs_sb_swap(a, b) __empty +#define ffs_cg_swap(a, b, c) __nothing +#define ffs_csum_swap(a, b, c) __nothing +#define ffs_dinode1_swap(a, b) __nothing +#define ffs_sb_swap(a, b) __nothing #endif #ifndef NO_APPLE_UFS
CVS commit: src/sbin
Module Name:src Committed By: christos Date: Sun Feb 21 22:51:30 UTC 2016 Modified Files: src/sbin/mount_ext2fs: mount_ext2fs.c src/sbin/mount_lfs: mount_lfs.c src/sbin/mount_nilfs: mount_nilfs.c src/sbin/mount_ptyfs: mount_ptyfs.c src/sbin/mount_tmpfs: mount_tmpfs.c src/sbin/mount_udf: mount_udf.c Log Message: Add MOPT_{REL,NO}ATIME as supported by the underlying filesystems. To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/sbin/mount_ext2fs/mount_ext2fs.c cvs rdiff -u -r1.38 -r1.39 src/sbin/mount_lfs/mount_lfs.c cvs rdiff -u -r1.2 -r1.3 src/sbin/mount_nilfs/mount_nilfs.c cvs rdiff -u -r1.15 -r1.16 src/sbin/mount_ptyfs/mount_ptyfs.c cvs rdiff -u -r1.28 -r1.29 src/sbin/mount_tmpfs/mount_tmpfs.c cvs rdiff -u -r1.13 -r1.14 src/sbin/mount_udf/mount_udf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/mount_ext2fs/mount_ext2fs.c diff -u src/sbin/mount_ext2fs/mount_ext2fs.c:1.22 src/sbin/mount_ext2fs/mount_ext2fs.c:1.23 --- src/sbin/mount_ext2fs/mount_ext2fs.c:1.22 Mon Aug 29 10:35:00 2011 +++ src/sbin/mount_ext2fs/mount_ext2fs.c Sun Feb 21 17:51:29 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: mount_ext2fs.c,v 1.22 2011/08/29 14:35:00 joerg Exp $ */ +/* $NetBSD: mount_ext2fs.c,v 1.23 2016/02/21 22:51:29 christos Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1993, 19 #if 0 static char sccsid[] = "@(#)mount_ufs.c 8.4 (Berkeley) 4/26/95"; #else -__RCSID("$NetBSD: mount_ext2fs.c,v 1.22 2011/08/29 14:35:00 joerg Exp $"); +__RCSID("$NetBSD: mount_ext2fs.c,v 1.23 2016/02/21 22:51:29 christos Exp $"); #endif #endif /* not lint */ @@ -71,6 +71,8 @@ static const struct mntopt mopts[] = { MOPT_FORCE, MOPT_GETARGS, MOPT_NODEVMTIME, + MOPT_NOATIME, + MOPT_RELATIME, MOPT_NULL, }; Index: src/sbin/mount_lfs/mount_lfs.c diff -u src/sbin/mount_lfs/mount_lfs.c:1.38 src/sbin/mount_lfs/mount_lfs.c:1.39 --- src/sbin/mount_lfs/mount_lfs.c:1.38 Sun Aug 2 14:11:57 2015 +++ src/sbin/mount_lfs/mount_lfs.c Sun Feb 21 17:51:29 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: mount_lfs.c,v 1.38 2015/08/02 18:11:57 dholland Exp $ */ +/* $NetBSD: mount_lfs.c,v 1.39 2016/02/21 22:51:29 christos Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1993, 19 #if 0 static char sccsid[] = "@(#)mount_lfs.c 8.4 (Berkeley) 4/26/95"; #else -__RCSID("$NetBSD: mount_lfs.c,v 1.38 2015/08/02 18:11:57 dholland Exp $"); +__RCSID("$NetBSD: mount_lfs.c,v 1.39 2016/02/21 22:51:29 christos Exp $"); #endif #endif /* not lint */ @@ -68,6 +68,7 @@ static const struct mntopt mopts[] = { MOPT_UPDATE, MOPT_GETARGS, MOPT_NOATIME, + MOPT_RELATIME, MOPT_NULL, }; Index: src/sbin/mount_nilfs/mount_nilfs.c diff -u src/sbin/mount_nilfs/mount_nilfs.c:1.2 src/sbin/mount_nilfs/mount_nilfs.c:1.3 --- src/sbin/mount_nilfs/mount_nilfs.c:1.2 Fri Oct 18 21:09:59 2013 +++ src/sbin/mount_nilfs/mount_nilfs.c Sun Feb 21 17:51:29 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: mount_nilfs.c,v 1.2 2013/10/19 01:09:59 christos Exp $ */ +/* $NetBSD: mount_nilfs.c,v 1.3 2016/02/21 22:51:29 christos Exp $ */ /* * Copyright (c) 2008, 2009 Reinoud Zandijk @@ -36,7 +36,7 @@ #include #ifndef lint -__RCSID("$NetBSD: mount_nilfs.c,v 1.2 2013/10/19 01:09:59 christos Exp $"); +__RCSID("$NetBSD: mount_nilfs.c,v 1.3 2016/02/21 22:51:29 christos Exp $"); #endif /* not lint */ @@ -69,6 +69,7 @@ static const struct mntopt mopts[] = { MOPT_STDOPTS, /* `normal' options */ MOPT_ASYNC, /* default */ MOPT_NOATIME, /* dont update access times */ + MOPT_RELATIME, /* update access times on change*/ MOPT_UPDATE, /* not yet supported */ MOPT_GETARGS, /* printing */ MOPT_NULL, Index: src/sbin/mount_ptyfs/mount_ptyfs.c diff -u src/sbin/mount_ptyfs/mount_ptyfs.c:1.15 src/sbin/mount_ptyfs/mount_ptyfs.c:1.16 --- src/sbin/mount_ptyfs/mount_ptyfs.c:1.15 Thu Sep 20 14:56:05 2012 +++ src/sbin/mount_ptyfs/mount_ptyfs.c Sun Feb 21 17:51:29 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: mount_ptyfs.c,v 1.15 2012/09/20 18:56:05 christos Exp $ */ +/* $NetBSD: mount_ptyfs.c,v 1.16 2016/02/21 22:51:29 christos Exp $ */ /* * Copyright (c) 1992, 1993, 1994 @@ -77,7 +77,7 @@ __COPYRIGHT("@(#) Copyright (c) 1992, 19 #if 0 static char sccsid[] = "@(#)mount_ptyfs.c 8.3 (Berkeley) 5/4/95"; #else -__RCSID("$NetBSD: mount_ptyfs.c,v 1.15 2012/09/20 18:56:05 christos Exp $"); +__RCSID("$NetBSD: mount_ptyfs.c,v 1.16 2016/02/21 22:51:29 christos Exp $"); #endif #endif /* not lint */ @@ -105,6 +105,8 @@ __RCSID("$NetBSD: mount_ptyfs.c,v 1.15 2 static const struct mntopt mopts[] = { MOPT_STDOPTS, MOPT_GETARGS, + MOPT_NOATIME, + MOPT_RELATIME, { "group", 0, ALTF_GROUP, 1 }, { "mode", 0, ALTF_MODE, 1 }, { "chroot", 0, ALTF_CHROOT, 1 }, /* compat */ Index: src/sbin/mount_tmpfs/mount_tmpfs.c diff -u src/sbin/mount_tmpfs/mount_tmpfs
CVS commit: src/sbin
Module Name:src Committed By: dholland Date: Sun Aug 11 05:56:55 UTC 2013 Modified Files: src/sbin/modload: Makefile src/sbin/modstat: Makefile src/sbin/modunload: Makefile Log Message: WARNS=5 is the default in sbin, don't need to set it explicitly. To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/sbin/modload/Makefile cvs rdiff -u -r1.3 -r1.4 src/sbin/modstat/Makefile cvs rdiff -u -r1.15 -r1.16 src/sbin/modunload/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/modload/Makefile diff -u src/sbin/modload/Makefile:1.16 src/sbin/modload/Makefile:1.17 --- src/sbin/modload/Makefile:1.16 Wed Aug 22 07:47:18 2012 +++ src/sbin/modload/Makefile Sun Aug 11 05:56:55 2013 @@ -1,9 +1,7 @@ -# $NetBSD: Makefile,v 1.16 2012/08/22 07:47:18 jnemeth Exp $ +# $NetBSD: Makefile,v 1.17 2013/08/11 05:56:55 dholland Exp $ .include -WARNS= 5 - RUMPPRG=modload SRCS= main.c MAN= modload.8 Index: src/sbin/modstat/Makefile diff -u src/sbin/modstat/Makefile:1.3 src/sbin/modstat/Makefile:1.4 --- src/sbin/modstat/Makefile:1.3 Thu Aug 16 19:47:48 2012 +++ src/sbin/modstat/Makefile Sun Aug 11 05:56:55 2013 @@ -1,9 +1,7 @@ -# $NetBSD: Makefile,v 1.3 2012/08/16 19:47:48 jnemeth Exp $ +# $NetBSD: Makefile,v 1.4 2013/08/11 05:56:55 dholland Exp $ RUMPPRG=modstat SRCS= main.c MAN= modstat.8 -WARNS= 5 - .include Index: src/sbin/modunload/Makefile diff -u src/sbin/modunload/Makefile:1.15 src/sbin/modunload/Makefile:1.16 --- src/sbin/modunload/Makefile:1.15 Wed Aug 22 07:47:19 2012 +++ src/sbin/modunload/Makefile Sun Aug 11 05:56:55 2013 @@ -1,6 +1,4 @@ -# $NetBSD: Makefile,v 1.15 2012/08/22 07:47:19 jnemeth Exp $ - -WARNS= 5 +# $NetBSD: Makefile,v 1.16 2013/08/11 05:56:55 dholland Exp $ RUMPPRG=modunload SRCS= main.c
CVS commit: src/sbin
Module Name:src Committed By: dholland Date: Sun Aug 11 06:04:38 UTC 2013 Modified Files: src/sbin/devpubd: Makefile src/sbin/iscsictl: Makefile src/sbin/iscsid: Makefile src/sbin/mount_chfs: Makefile src/sbin/mount_nilfs: Makefile Log Message: These pass WARNS=5, so don't set WARNS=4 To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sbin/devpubd/Makefile cvs rdiff -u -r1.1 -r1.2 src/sbin/iscsictl/Makefile cvs rdiff -u -r1.4 -r1.5 src/sbin/iscsid/Makefile cvs rdiff -u -r1.1 -r1.2 src/sbin/mount_chfs/Makefile cvs rdiff -u -r1.1 -r1.2 src/sbin/mount_nilfs/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/devpubd/Makefile diff -u src/sbin/devpubd/Makefile:1.3 src/sbin/devpubd/Makefile:1.4 --- src/sbin/devpubd/Makefile:1.3 Fri Jan 11 23:49:23 2013 +++ src/sbin/devpubd/Makefile Sun Aug 11 06:04:38 2013 @@ -1,9 +1,8 @@ -# $NetBSD: Makefile,v 1.3 2013/01/11 23:49:23 mlelstv Exp $ +# $NetBSD: Makefile,v 1.4 2013/08/11 06:04:38 dholland Exp $ PROG= devpubd SRCS= devpubd.c MAN= devpubd.8 -WARNS= 4 BINDIR?= /sbin Index: src/sbin/iscsictl/Makefile diff -u src/sbin/iscsictl/Makefile:1.1 src/sbin/iscsictl/Makefile:1.2 --- src/sbin/iscsictl/Makefile:1.1 Sun Oct 23 21:11:23 2011 +++ src/sbin/iscsictl/Makefile Sun Aug 11 06:04:38 2013 @@ -11,7 +11,6 @@ CPPFLAGS+= -I${DESTDIR}/usr/include/dev/ CPPFLAGS+= -I${.CURDIR}/../../sys/dev/iscsi CPPFLAGS+= -I${.CURDIR}/../../sys CPPFLAGS+= -I${.CURDIR}/../iscsid -WARNS= 4 MAN= iscsictl.8 Index: src/sbin/iscsid/Makefile diff -u src/sbin/iscsid/Makefile:1.4 src/sbin/iscsid/Makefile:1.5 --- src/sbin/iscsid/Makefile:1.4 Mon May 28 00:13:19 2012 +++ src/sbin/iscsid/Makefile Sun Aug 11 06:04:38 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.4 2012/05/28 00:13:19 riz Exp $ +# $NetBSD: Makefile,v 1.5 2013/08/11 06:04:38 dholland Exp $ PROG= iscsid @@ -11,8 +11,6 @@ CPPFLAGS+= -D_THREAD_SAFE MAN= iscsid.8 -WARNS= 4 - LDADD = -lpthread -lisns INCSDIR= /usr/include Index: src/sbin/mount_chfs/Makefile diff -u src/sbin/mount_chfs/Makefile:1.1 src/sbin/mount_chfs/Makefile:1.2 --- src/sbin/mount_chfs/Makefile:1.1 Thu Nov 24 15:54:55 2011 +++ src/sbin/mount_chfs/Makefile Sun Aug 11 06:04:38 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.1 2011/11/24 15:54:55 ahoka Exp $ +# $NetBSD: Makefile,v 1.2 2013/08/11 06:04:38 dholland Exp $ # .include @@ -12,6 +12,5 @@ MOUNT= ${NETBSDSRCDIR}/sbin/mount CPPFLAGS+= -I${MOUNT} DPADD+= ${LIBUTIL} LDADD+= -lutil -WARNS= 4 .include Index: src/sbin/mount_nilfs/Makefile diff -u src/sbin/mount_nilfs/Makefile:1.1 src/sbin/mount_nilfs/Makefile:1.2 --- src/sbin/mount_nilfs/Makefile:1.1 Sat Jul 18 16:31:42 2009 +++ src/sbin/mount_nilfs/Makefile Sun Aug 11 06:04:38 2013 @@ -1,8 +1,7 @@ -# $NetBSD: Makefile,v 1.1 2009/07/18 16:31:42 reinoud Exp $ +# $NetBSD: Makefile,v 1.2 2013/08/11 06:04:38 dholland Exp $ .include -WARNS= 4 PROG= mount_nilfs SRCS= mount_nilfs.c fattr.c pathadj.c MAN= mount_nilfs.8
CVS commit: src/sbin
Module Name:src Committed By: matt Date: Tue Mar 20 18:50:31 UTC 2012 Modified Files: src/sbin/cgdconfig: utils.c src/sbin/fsck_ffs: quota2.c src/sbin/fsdb: fsdb.c src/sbin/init: init.c src/sbin/mount_portal: puffs_portal.c src/sbin/wsconsctl: display.c Log Message: Convert to C89 function definitions To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/sbin/cgdconfig/utils.c cvs rdiff -u -r1.4 -r1.5 src/sbin/fsck_ffs/quota2.c cvs rdiff -u -r1.43 -r1.44 src/sbin/fsdb/fsdb.c cvs rdiff -u -r1.102 -r1.103 src/sbin/init/init.c cvs rdiff -u -r1.5 -r1.6 src/sbin/mount_portal/puffs_portal.c cvs rdiff -u -r1.15 -r1.16 src/sbin/wsconsctl/display.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/cgdconfig/utils.c diff -u src/sbin/cgdconfig/utils.c:1.20 src/sbin/cgdconfig/utils.c:1.21 --- src/sbin/cgdconfig/utils.c:1.20 Sat Apr 11 07:40:37 2009 +++ src/sbin/cgdconfig/utils.c Tue Mar 20 18:50:30 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: utils.c,v 1.20 2009/04/11 07:40:37 lukem Exp $ */ +/* $NetBSD: utils.c,v 1.21 2012/03/20 18:50:30 matt Exp $ */ /*- * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include #ifndef lint -__RCSID("$NetBSD: utils.c,v 1.20 2009/04/11 07:40:37 lukem Exp $"); +__RCSID("$NetBSD: utils.c,v 1.21 2012/03/20 18:50:30 matt Exp $"); #endif #include @@ -139,7 +139,7 @@ struct string { }; string_t * -string_zero() +string_zero(void) { string_t *out; Index: src/sbin/fsck_ffs/quota2.c diff -u src/sbin/fsck_ffs/quota2.c:1.4 src/sbin/fsck_ffs/quota2.c:1.5 --- src/sbin/fsck_ffs/quota2.c:1.4 Sun Aug 14 12:32:01 2011 +++ src/sbin/fsck_ffs/quota2.c Tue Mar 20 18:50:31 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: quota2.c,v 1.4 2011/08/14 12:32:01 christos Exp $ */ +/* $NetBSD: quota2.c,v 1.5 2012/03/20 18:50:31 matt Exp $ */ /*- * Copyright (c) 2010 Manuel Bouyer * All rights reserved. @@ -514,7 +514,7 @@ quota2_check_usage(int type) * check if a quota check needs to be run, regardless of the clean flag */ int -quota2_check_doquota() +quota2_check_doquota(void) { int retval = 1; Index: src/sbin/fsdb/fsdb.c diff -u src/sbin/fsdb/fsdb.c:1.43 src/sbin/fsdb/fsdb.c:1.44 --- src/sbin/fsdb/fsdb.c:1.43 Mon Aug 29 14:34:59 2011 +++ src/sbin/fsdb/fsdb.c Tue Mar 20 18:50:31 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: fsdb.c,v 1.43 2011/08/29 14:34:59 joerg Exp $ */ +/* $NetBSD: fsdb.c,v 1.44 2012/03/20 18:50:31 matt Exp $ */ /*- * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include #ifndef lint -__RCSID("$NetBSD: fsdb.c,v 1.43 2011/08/29 14:34:59 joerg Exp $"); +__RCSID("$NetBSD: fsdb.c,v 1.44 2012/03/20 18:50:31 matt Exp $"); #endif /* not lint */ #include @@ -147,9 +147,6 @@ main(int argc, char *argv[]) } #define CMDFUNC(func) static int func (int argc, char *argv[]) -#define CMDFUNCSTART(func) static int func(argc, argv) \ -int argc; \ -char *argv[]; CMDFUNC(helpfn); CMDFUNC(focus); /* focus on inode */ @@ -326,7 +323,7 @@ static ino_t ocurrent; /* * Focus on given inode number */ -CMDFUNCSTART(focus) +CMDFUNC(focus) { ino_t inum; char *cp; @@ -339,7 +336,7 @@ CMDFUNCSTART(focus) return 0; } -CMDFUNCSTART(back) +CMDFUNC(back) { curinum = ocurrent; curinode = ginode(curinum); @@ -347,7 +344,7 @@ CMDFUNCSTART(back) return 0; } -CMDFUNCSTART(zapi) +CMDFUNC(zapi) { ino_t inum; union dinode *dp; @@ -362,18 +359,18 @@ CMDFUNCSTART(zapi) return 0; } -CMDFUNCSTART(active) +CMDFUNC(active) { printactive(); return 0; } -CMDFUNCSTART(quit) +CMDFUNC(quit) { return -1; } -CMDFUNCSTART(uplink) +CMDFUNC(uplink) { int16_t nlink; @@ -388,7 +385,7 @@ CMDFUNCSTART(uplink) return 0; } -CMDFUNCSTART(downlink) +CMDFUNC(downlink) { int16_t nlink; @@ -435,7 +432,7 @@ scannames(struct inodesc *idesc) return (KEEPON); } -CMDFUNCSTART(ls) +CMDFUNC(ls) { struct inodesc idesc; checkactivedir(); /* let it go on anyway */ @@ -451,7 +448,7 @@ CMDFUNCSTART(ls) return 0; } -CMDFUNCSTART(blks) +CMDFUNC(blks) { uint64_t blkno = 0; int i, type; @@ -492,7 +489,7 @@ CMDFUNCSTART(blks) static int findblk_numtofind; static int wantedblksize; -CMDFUNCSTART(findblk) +CMDFUNC(findblk) { ino_t inum, inosused; uint32_t *wantedblk32 = NULL; @@ -874,7 +871,7 @@ dolookup(char *name) } } -CMDFUNCSTART(focusname) +CMDFUNC(focusname) { char *p, *val; @@ -904,7 +901,7 @@ CMDFUNCSTART(focusname) return 0; } -CMDFUNCSTART(ln) +CMDFUNC(ln) { ino_t inum; int rval; @@ -924,7 +921,7 @@ CMDFUNCSTART(ln) return rval; } -CMDFUNCSTART(rm) +CMDFUNC(rm) { int rval; @@ -954,7 +951,7 @@ chinumfunc(struct inodesc *idesc) return KEEPON; } -CMDFUNCSTART(chinum) +CMDFUNC(chinum) { char *cp; ino_t inum; @@ -1004,7 +1001,7 @@ chnamefunc(struct inodesc *idesc)
CVS commit: src/sbin
Module Name:src Committed By: christos Date: Sat Apr 7 04:52:21 UTC 2012 Modified Files: src/sbin/dump: Makefile main.c optr.c src/sbin/dump_lfs: Makefile src/sbin/fsck: fsck.c fsutil.c preen.c src/sbin/swapctl: swapctl.c src/sbin/tunefs: tunefs.c Log Message: use getfsspecname() To generate a diff of this commit: cvs rdiff -u -r1.37 -r1.38 src/sbin/dump/Makefile cvs rdiff -u -r1.67 -r1.68 src/sbin/dump/main.c cvs rdiff -u -r1.36 -r1.37 src/sbin/dump/optr.c cvs rdiff -u -r1.13 -r1.14 src/sbin/dump_lfs/Makefile cvs rdiff -u -r1.50 -r1.51 src/sbin/fsck/fsck.c cvs rdiff -u -r1.20 -r1.21 src/sbin/fsck/fsutil.c cvs rdiff -u -r1.30 -r1.31 src/sbin/fsck/preen.c cvs rdiff -u -r1.36 -r1.37 src/sbin/swapctl/swapctl.c cvs rdiff -u -r1.44 -r1.45 src/sbin/tunefs/tunefs.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/dump/Makefile diff -u src/sbin/dump/Makefile:1.37 src/sbin/dump/Makefile:1.38 --- src/sbin/dump/Makefile:1.37 Mon Jun 20 03:43:59 2011 +++ src/sbin/dump/Makefile Sat Apr 7 00:52:20 2012 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.37 2011/06/20 07:43:59 mrg Exp $ +# $NetBSD: Makefile,v 1.38 2012/04/07 04:52:20 christos Exp $ # @(#)Makefile 8.1 (Berkeley) 6/5/93 # dump.h header file @@ -32,6 +32,8 @@ SRCS= itime.c main.c optr.c dumprmt.c rc traverse.c unctime.c ffs_inode.c ffs_bswap.c MAN= dump.8 MLINKS+=dump.8 rdump.8 +DPADD+= ${LIBUTIL} +LDADD+= -lutil .PATH: ${NETBSDSRCDIR}/sys/ufs/ffs Index: src/sbin/dump/main.c diff -u src/sbin/dump/main.c:1.67 src/sbin/dump/main.c:1.68 --- src/sbin/dump/main.c:1.67 Sun Feb 19 14:49:20 2012 +++ src/sbin/dump/main.c Sat Apr 7 00:52:20 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.67 2012/02/19 19:49:20 christos Exp $ */ +/* $NetBSD: main.c,v 1.68 2012/04/07 04:52:20 christos Exp $ */ /*- * Copyright (c) 1980, 1991, 1993, 1994 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19 #if 0 static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 5/1/95"; #else -__RCSID("$NetBSD: main.c,v 1.67 2012/02/19 19:49:20 christos Exp $"); +__RCSID("$NetBSD: main.c,v 1.68 2012/04/07 04:52:20 christos Exp $"); #endif #endif /* not lint */ @@ -65,6 +65,7 @@ __RCSID("$NetBSD: main.c,v 1.67 2012/02/ #include #include #include +#include #include "dump.h" #include "pathnames.h" @@ -85,7 +86,6 @@ int readblksize = 32 * 1024; /* read blo chardefault_time_string[] = "%T %Z"; /* default timestamp string */ char*time_string = default_time_string; /* timestamp string */ -int main(int, char *[]); static long numarg(const char *, long, long); static void obsolete(int *, char **[]); static void usage(void); @@ -108,6 +108,7 @@ main(int argc, char *argv[]) char *mountpoint; int just_estimate = 0; char labelstr[LBLSIZE]; + char buf[MAXPATHLEN]; char *new_time_format; char *snap_backup = NULL; @@ -294,7 +295,10 @@ main(int argc, char *argv[]) break; } if ((dt = fstabsearch(argv[i])) != NULL) { - disk = dt->fs_spec; + if (getfsspecname(buf, sizeof(buf), dt->fs_spec) + == NULL) +quit("%s (%s)", buf, strerror(errno)); + disk = buf; mountpoint = xstrdup(dt->fs_file); goto multicheck; } @@ -402,7 +406,9 @@ main(int argc, char *argv[]) mountpoint = NULL; mntinfo = mntinfosearch(disk); if ((dt = fstabsearch(disk)) != NULL) { - disk = rawname(dt->fs_spec); + if (getfsspecname(buf, sizeof(buf), dt->fs_spec) == NULL) + quit("%s (%s)", buf, strerror(errno)); + disk = rawname(buf); mountpoint = dt->fs_file; msg("Found %s on %s in %s\n", disk, mountpoint, _PATH_FSTAB); } else if (mntinfo != NULL) { Index: src/sbin/dump/optr.c diff -u src/sbin/dump/optr.c:1.36 src/sbin/dump/optr.c:1.37 --- src/sbin/dump/optr.c:1.36 Mon Dec 18 15:07:32 2006 +++ src/sbin/dump/optr.c Sat Apr 7 00:52:20 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: optr.c,v 1.36 2006/12/18 20:07:32 christos Exp $ */ +/* $NetBSD: optr.c,v 1.37 2012/04/07 04:52:20 christos Exp $ */ /*- * Copyright (c) 1980, 1988, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)optr.c 8.2 (Berkeley) 1/6/94"; #else -__RCSID("$NetBSD: optr.c,v 1.36 2006/12/18 20:07:32 christos Exp $"); +__RCSID("$NetBSD: optr.c,v 1.37 2012/04/07 04:52:20 christos Exp $"); #endif #endif /* not lint */ @@ -56,6 +56,7 @@ __RCSID("$NetBSD: optr.c,v 1.36 2006/12/ #include #include #include +#include #include @@ -321,11 +322,15 @@ struct fstab * allocfsent(struct fstab *fs) { struct fstab *new; + char buf[MAXPATHLEN]; - new = (struct fstab *)xmalloc(sizeof (*fs)); + new = xmalloc(sizeof (*fs)); new->fs_file = xstrdup(fs->fs_file); new->fs_type = xstrdup(fs->fs_type); - new->fs_spec = xstrdup(fs->fs_spec); + + if (getfsspecname(buf, sizeof(buf), fs->fs_spec) == NULL) + msg("%s (%s)", buf, strerror(errno)); + new->fs_spec = xstrdup(buf); new->fs_passno = fs->fs_passno; new->fs_freq = fs->
CVS commit: src/sbin
Module Name:src Committed By: christos Date: Sat Apr 7 16:44:10 UTC 2012 Modified Files: src/sbin/dump: main.c optr.c src/sbin/fsck: fsutil.c fsutil.h src/sbin/savecore: savecore.c Log Message: factor out rawname() from dump, fsck, savecore. To generate a diff of this commit: cvs rdiff -u -r1.68 -r1.69 src/sbin/dump/main.c cvs rdiff -u -r1.37 -r1.38 src/sbin/dump/optr.c cvs rdiff -u -r1.21 -r1.22 src/sbin/fsck/fsutil.c cvs rdiff -u -r1.18 -r1.19 src/sbin/fsck/fsutil.h cvs rdiff -u -r1.84 -r1.85 src/sbin/savecore/savecore.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/dump/main.c diff -u src/sbin/dump/main.c:1.68 src/sbin/dump/main.c:1.69 --- src/sbin/dump/main.c:1.68 Sat Apr 7 00:52:20 2012 +++ src/sbin/dump/main.c Sat Apr 7 12:44:10 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.68 2012/04/07 04:52:20 christos Exp $ */ +/* $NetBSD: main.c,v 1.69 2012/04/07 16:44:10 christos Exp $ */ /*- * Copyright (c) 1980, 1991, 1993, 1994 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19 #if 0 static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 5/1/95"; #else -__RCSID("$NetBSD: main.c,v 1.68 2012/04/07 04:52:20 christos Exp $"); +__RCSID("$NetBSD: main.c,v 1.69 2012/04/07 16:44:10 christos Exp $"); #endif #endif /* not lint */ @@ -108,7 +108,7 @@ main(int argc, char *argv[]) char *mountpoint; int just_estimate = 0; char labelstr[LBLSIZE]; - char buf[MAXPATHLEN]; + char buf[MAXPATHLEN], rbuf[MAXPATHLEN]; char *new_time_format; char *snap_backup = NULL; @@ -408,11 +408,17 @@ main(int argc, char *argv[]) if ((dt = fstabsearch(disk)) != NULL) { if (getfsspecname(buf, sizeof(buf), dt->fs_spec) == NULL) quit("%s (%s)", buf, strerror(errno)); - disk = rawname(buf); + if (getdiskrawname(rbuf, sizeof(rbuf), buf) == NULL) + quit("Can't get disk raw name for `%s' (%s)", + buf, strerror(errno)); + disk = rbuf; mountpoint = dt->fs_file; msg("Found %s on %s in %s\n", disk, mountpoint, _PATH_FSTAB); } else if (mntinfo != NULL) { - disk = rawname(mntinfo->f_mntfromname); + if (getdiskrawname(rbuf, sizeof(rbuf), mntinfo->f_mntfromname) + == NULL) + quit("Can't get disk raw name for `%s' (%s)", + mntinfo->f_mntfromname, strerror(errno)); mountpoint = mntinfo->f_mntonname; msg("Found %s on %s in mount table\n", disk, mountpoint); } @@ -721,20 +727,6 @@ sig(int signo) } } -char * -rawname(char *cp) -{ - static char rawbuf[MAXPATHLEN]; - char *dp = strrchr(cp, '/'); - - if (dp == NULL) - return (NULL); - *dp = '\0'; - (void)snprintf(rawbuf, sizeof rawbuf, "%s/r%s", cp, dp + 1); - *dp = '/'; - return (rawbuf); -} - /* * obsolete -- * Change set of key letters and ordered arguments into something Index: src/sbin/dump/optr.c diff -u src/sbin/dump/optr.c:1.37 src/sbin/dump/optr.c:1.38 --- src/sbin/dump/optr.c:1.37 Sat Apr 7 00:52:20 2012 +++ src/sbin/dump/optr.c Sat Apr 7 12:44:10 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: optr.c,v 1.37 2012/04/07 04:52:20 christos Exp $ */ +/* $NetBSD: optr.c,v 1.38 2012/04/07 16:44:10 christos Exp $ */ /*- * Copyright (c) 1980, 1988, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)optr.c 8.2 (Berkeley) 1/6/94"; #else -__RCSID("$NetBSD: optr.c,v 1.37 2012/04/07 04:52:20 christos Exp $"); +__RCSID("$NetBSD: optr.c,v 1.38 2012/04/07 16:44:10 christos Exp $"); #endif #endif /* not lint */ @@ -391,14 +391,15 @@ fstabsearch(const char *key) { struct pfstab *pf; struct fstab *fs; - char *rn; + const char *rn; + char buf[MAXPATHLEN]; SLIST_FOREACH(pf, &table, pf_list) { fs = pf->pf_fstab; if (strcmp(fs->fs_file, key) == 0 || strcmp(fs->fs_spec, key) == 0) return (fs); - rn = rawname(fs->fs_spec); + rn = getdiskrawname(buf, sizeof(buf), fs->fs_spec); if (rn != NULL && strcmp(rn, key) == 0) return (fs); if (key[0] != '/') { @@ -427,7 +428,8 @@ mntinfosearch(const char *key) { int i, mntbufc; struct statvfs *mntbuf, *fs; - char *rn; + const char *rn; + char buf[MAXPATHLEN]; if ((mntbufc = getmntinfo(&mntbuf, MNT_NOWAIT)) == 0) quit("Can't get mount list: %s", strerror(errno)); @@ -443,7 +445,7 @@ mntinfosearch(const char *key) if (strcmp(fs->f_mntonname, key) == 0 || strcmp(fs->f_mntfromname, key) == 0) return (fs); - rn = rawname(fs->f_mntfromname); + rn = getdiskrawname(buf, sizeof(buf), fs->f_mntfromname); if (rn != NULL && strcmp(rn, key) == 0) return (fs); } Index: src/sbin/fsck/fsutil.c diff -u src/sbin/fsck/fsutil.c:1.21 src/sbin/fsck/fsutil.c:1.22 --- src/sbin/fsck/fsutil.c:1.21 Sat Apr 7 00:52:20 2012 +++ src/sbin/fsck/fsutil.c Sat Apr 7 12:44:10 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: fsutil.c,v 1.21 2012/04/07 04:52:20 christos Exp $ */ +/* $NetBSD: fsutil.c,v 1.22 2012/04/07 16:44:10 christos Exp $ */ /* * Copyright (c) 1990, 1993 @@ -31,7 +31,7 @@ #include #ifndef lint -__RCSI
CVS commit: src/sbin
Module Name:src Committed By: jnemeth Date: Wed Aug 22 07:47:20 UTC 2012 Modified Files: src/sbin/modload: Makefile src/sbin/modunload: Makefile Log Message: Set WARNS=5. No warnings/errors were found with a test compile. To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/sbin/modload/Makefile cvs rdiff -u -r1.14 -r1.15 src/sbin/modunload/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/modload/Makefile diff -u src/sbin/modload/Makefile:1.15 src/sbin/modload/Makefile:1.16 --- src/sbin/modload/Makefile:1.15 Mon Dec 13 20:48:44 2010 +++ src/sbin/modload/Makefile Wed Aug 22 07:47:18 2012 @@ -1,7 +1,9 @@ -# $NetBSD: Makefile,v 1.15 2010/12/13 20:48:44 pooka Exp $ +# $NetBSD: Makefile,v 1.16 2012/08/22 07:47:18 jnemeth Exp $ .include +WARNS= 5 + RUMPPRG=modload SRCS= main.c MAN= modload.8 Index: src/sbin/modunload/Makefile diff -u src/sbin/modunload/Makefile:1.14 src/sbin/modunload/Makefile:1.15 --- src/sbin/modunload/Makefile:1.14 Mon Dec 13 20:48:45 2010 +++ src/sbin/modunload/Makefile Wed Aug 22 07:47:19 2012 @@ -1,4 +1,6 @@ -# $NetBSD: Makefile,v 1.14 2010/12/13 20:48:45 pooka Exp $ +# $NetBSD: Makefile,v 1.15 2012/08/22 07:47:19 jnemeth Exp $ + +WARNS= 5 RUMPPRG=modunload SRCS= main.c
CVS commit: src/sbin
Module Name:src Committed By: christos Date: Sat Oct 19 01:09:59 UTC 2013 Modified Files: src/sbin/apmlabel: apmlabel.c src/sbin/dmctl: dmctl.c src/sbin/fsck_ffs: pass1.c utilities.c src/sbin/fsck_lfs: bufcache.c lfs.c pass6.c segwrite.c src/sbin/fsirand: fsirand.c src/sbin/mount_lfs: mount_lfs.c src/sbin/mount_nilfs: mount_nilfs.c src/sbin/mount_portal: pt_file.c src/sbin/newfs_ext2fs: newfs_ext2fs.c src/sbin/newfs_lfs: make_lfs.c src/sbin/newfs_msdos: mkfs_msdos.c src/sbin/newfs_udf: udf_create.c src/sbin/raidctl: raidctl.c src/sbin/rcorder: rcorder.c Log Message: fix unused variable warnings. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sbin/apmlabel/apmlabel.c cvs rdiff -u -r1.3 -r1.4 src/sbin/dmctl/dmctl.c cvs rdiff -u -r1.55 -r1.56 src/sbin/fsck_ffs/pass1.c cvs rdiff -u -r1.63 -r1.64 src/sbin/fsck_ffs/utilities.c cvs rdiff -u -r1.13 -r1.14 src/sbin/fsck_lfs/bufcache.c cvs rdiff -u -r1.40 -r1.41 src/sbin/fsck_lfs/lfs.c cvs rdiff -u -r1.31 -r1.32 src/sbin/fsck_lfs/pass6.c cvs rdiff -u -r1.26 -r1.27 src/sbin/fsck_lfs/segwrite.c cvs rdiff -u -r1.31 -r1.32 src/sbin/fsirand/fsirand.c cvs rdiff -u -r1.34 -r1.35 src/sbin/mount_lfs/mount_lfs.c cvs rdiff -u -r1.1 -r1.2 src/sbin/mount_nilfs/mount_nilfs.c cvs rdiff -u -r1.17 -r1.18 src/sbin/mount_portal/pt_file.c cvs rdiff -u -r1.8 -r1.9 src/sbin/newfs_ext2fs/newfs_ext2fs.c cvs rdiff -u -r1.28 -r1.29 src/sbin/newfs_lfs/make_lfs.c cvs rdiff -u -r1.7 -r1.8 src/sbin/newfs_msdos/mkfs_msdos.c cvs rdiff -u -r1.23 -r1.24 src/sbin/newfs_udf/udf_create.c cvs rdiff -u -r1.55 -r1.56 src/sbin/raidctl/raidctl.c cvs rdiff -u -r1.16 -r1.17 src/sbin/rcorder/rcorder.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/apmlabel/apmlabel.c diff -u src/sbin/apmlabel/apmlabel.c:1.2 src/sbin/apmlabel/apmlabel.c:1.3 --- src/sbin/apmlabel/apmlabel.c:1.2 Sat Aug 27 12:10:51 2011 +++ src/sbin/apmlabel/apmlabel.c Fri Oct 18 21:09:58 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: apmlabel.c,v 1.2 2011/08/27 16:10:51 joerg Exp $ */ +/* $NetBSD: apmlabel.c,v 1.3 2013/10/19 01:09:58 christos Exp $ */ /* * Copyright (C) 1998 Wolfgang Solfrank. @@ -33,7 +33,7 @@ #include #ifndef lint -__RCSID("$NetBSD: apmlabel.c,v 1.2 2011/08/27 16:10:51 joerg Exp $"); +__RCSID("$NetBSD: apmlabel.c,v 1.3 2013/10/19 01:09:58 christos Exp $"); #endif /* not lint */ #include @@ -104,7 +104,7 @@ getparts(int sd, int verbose) struct apple_drvr_map *drvr; struct apple_part_map_entry *part; struct partition npe; - uint16_t blksize, blkcnt, partcnt; + uint16_t blksize, partcnt; int i, j, unused, changed; uint64_t temp; @@ -123,7 +123,6 @@ getparts(int sd, int verbose) if (drvr->sbSig != APPLE_DRVR_MAP_MAGIC) return (changed); blksize = drvr->sbBlockSize; - blkcnt = drvr->sbBlkCount; partcnt = 1; Index: src/sbin/dmctl/dmctl.c diff -u src/sbin/dmctl/dmctl.c:1.3 src/sbin/dmctl/dmctl.c:1.4 --- src/sbin/dmctl/dmctl.c:1.3 Sat Aug 27 13:07:28 2011 +++ src/sbin/dmctl/dmctl.c Fri Oct 18 21:09:58 2013 @@ -213,16 +213,16 @@ main(int argc, char *argv[]) static int dmctl_get_version(int argc __unused, char *argv[] __unused, libdm_task_t task) { - uint32_t ver[3], size; + uint32_t ver[3]; - size = libdm_task_get_cmd_version(task, ver, sizeof(ver)); + (void)libdm_task_get_cmd_version(task, ver, sizeof(ver)); printf("Library protocol version %d:%d:%d\n", ver[0], ver[1], ver[2]); if (libdm_task_run(task) != 0) err(EXIT_FAILURE, "dmctl_get_version: libdm_task_run failed."); - size = libdm_task_get_cmd_version(task, ver, 3); + (void)libdm_task_get_cmd_version(task, ver, 3); printf("Kernel protocol version %d:%d:%d\n",ver[0], ver[1], ver[2]); libdm_task_destroy(task); Index: src/sbin/fsck_ffs/pass1.c diff -u src/sbin/fsck_ffs/pass1.c:1.55 src/sbin/fsck_ffs/pass1.c:1.56 --- src/sbin/fsck_ffs/pass1.c:1.55 Sun Jun 23 03:28:36 2013 +++ src/sbin/fsck_ffs/pass1.c Fri Oct 18 21:09:58 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: pass1.c,v 1.55 2013/06/23 07:28:36 dholland Exp $ */ +/* $NetBSD: pass1.c,v 1.56 2013/10/19 01:09:58 christos Exp $ */ /* * Copyright (c) 1980, 1986, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)pass1.c 8.6 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: pass1.c,v 1.55 2013/06/23 07:28:36 dholland Exp $"); +__RCSID("$NetBSD: pass1.c,v 1.56 2013/10/19 01:09:58 christos Exp $"); #endif #endif /* not lint */ @@ -235,15 +235,11 @@ checkinode(ino_t inumber, struct inodesc int64_t blocks; char symbuf[MAXBSIZE]; struct inostat *info; - uid_t uid; - gid_t gid; dp = getnextinode(inumber); info = inoinfo(inumber); mode = iswap16(DIP(dp, mode)) & IFMT; size = iswap64(DIP(dp, size)); - uid = iswap32(DIP(dp, uid)); - gid = iswap32(DIP(dp, gid)); if (mode == 0) { if ((is_ufs2 && (memcmp(dp->dp2.d
CVS commit: src/sbin
Module Name:src Committed By: christos Date: Sat Oct 19 15:50:26 UTC 2013 Modified Files: src/sbin/ifconfig: af_inet6.c tunnel.c src/sbin/route: route.c Log Message: use symbolic flags To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/sbin/ifconfig/af_inet6.c cvs rdiff -u -r1.18 -r1.19 src/sbin/ifconfig/tunnel.c cvs rdiff -u -r1.142 -r1.143 src/sbin/route/route.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/ifconfig/af_inet6.c diff -u src/sbin/ifconfig/af_inet6.c:1.28 src/sbin/ifconfig/af_inet6.c:1.29 --- src/sbin/ifconfig/af_inet6.c:1.28 Fri Oct 18 20:35:30 2013 +++ src/sbin/ifconfig/af_inet6.c Sat Oct 19 11:50:26 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: af_inet6.c,v 1.28 2013/10/19 00:35:30 christos Exp $ */ +/* $NetBSD: af_inet6.c,v 1.29 2013/10/19 15:50:26 christos Exp $ */ /* * Copyright (c) 1983, 1993 @@ -31,7 +31,7 @@ #include #ifndef lint -__RCSID("$NetBSD: af_inet6.c,v 1.28 2013/10/19 00:35:30 christos Exp $"); +__RCSID("$NetBSD: af_inet6.c,v 1.29 2013/10/19 15:50:26 christos Exp $"); #endif /* not lint */ #include @@ -278,7 +278,7 @@ in6_alias(const char *ifname, prop_dicti sin6 = &creq->ifr_addr; - inet6_getscopeid(sin6, 1); + inet6_getscopeid(sin6, INET6_IS_ADDR_LINKLOCAL); scopeid = sin6->sin6_scope_id; if (getnameinfo((const struct sockaddr *)sin6, sin6->sin6_len, hbuf, sizeof(hbuf), NULL, 0, niflag)) @@ -298,7 +298,7 @@ in6_alias(const char *ifname, prop_dicti ifr6.ifr_addr.sin6_len = sizeof(struct sockaddr_in6); } sin6 = &ifr6.ifr_addr; - inet6_getscopeid(sin6, 1); + inet6_getscopeid(sin6, INET6_IS_ADDR_LINKLOCAL); hbuf[0] = '\0'; if (getnameinfo((struct sockaddr *)sin6, sin6->sin6_len, hbuf, sizeof(hbuf), NULL, 0, niflag)) @@ -406,8 +406,8 @@ in6_pre_aifaddr(prop_dictionary_t env, c setia6vltime_impl(env, ifra); setia6pltime_impl(env, ifra); setia6flags_impl(env, ifra); - inet6_putscopeid(&ifra->ifra_addr, 1); - inet6_putscopeid(&ifra->ifra_dstaddr, 1); + inet6_putscopeid(&ifra->ifra_addr, INET6_IS_ADDR_LINKLOCAL); + inet6_putscopeid(&ifra->ifra_dstaddr, INET6_IS_ADDR_LINKLOCAL); return 0; } Index: src/sbin/ifconfig/tunnel.c diff -u src/sbin/ifconfig/tunnel.c:1.18 src/sbin/ifconfig/tunnel.c:1.19 --- src/sbin/ifconfig/tunnel.c:1.18 Fri Oct 18 20:35:30 2013 +++ src/sbin/ifconfig/tunnel.c Sat Oct 19 11:50:26 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: tunnel.c,v 1.18 2013/10/19 00:35:30 christos Exp $ */ +/* $NetBSD: tunnel.c,v 1.19 2013/10/19 15:50:26 christos Exp $ */ /* * Copyright (c) 1983, 1993 @@ -31,7 +31,7 @@ #include #ifndef lint -__RCSID("$NetBSD: tunnel.c,v 1.18 2013/10/19 00:35:30 christos Exp $"); +__RCSID("$NetBSD: tunnel.c,v 1.19 2013/10/19 15:50:26 christos Exp $"); #endif /* not lint */ #include @@ -125,8 +125,8 @@ settunnel(prop_dictionary_t env, prop_di IN6_IS_ADDR_MULTICAST(&s6->sin6_addr)) errx(EXIT_FAILURE, "tunnel src/dst is multicast"); /* embed scopeid */ - inet6_putscopeid(s6, 1); - inet6_getscopeid(d, 1); + inet6_putscopeid(s6, INET6_IS_ADDR_LINKLOCAL); + inet6_getscopeid(d, INET6_IS_ADDR_LINKLOCAL); } #endif /* INET6 */ @@ -162,7 +162,8 @@ tunnel_status(prop_dictionary_t env, pro afp = lookup_af_bynum(req.addr.ss_family); #ifdef INET6 if (req.addr.ss_family == AF_INET6) - inet6_getscopeid((struct sockaddr_in6 *)&req.addr, 1); + inet6_getscopeid((struct sockaddr_in6 *)&req.addr, + INET6_IS_ADDR_LINKLOCAL); #endif /* INET6 */ getnameinfo((struct sockaddr *)&req.addr, req.addr.ss_len, psrcaddr, sizeof(psrcaddr), &srcserv[1], sizeof(srcserv) - 1, @@ -170,7 +171,8 @@ tunnel_status(prop_dictionary_t env, pro #ifdef INET6 if (req.dstaddr.ss_family == AF_INET6) - inet6_getscopeid((struct sockaddr_in6 *)&req.dstaddr, 1); + inet6_getscopeid((struct sockaddr_in6 *)&req.dstaddr, + INET6_IS_ADDR_LINKLOCAL); #endif getnameinfo((struct sockaddr *)&req.dstaddr, req.dstaddr.ss_len, pdstaddr, sizeof(pdstaddr), &dstserv[1], sizeof(dstserv) - 1, Index: src/sbin/route/route.c diff -u src/sbin/route/route.c:1.142 src/sbin/route/route.c:1.143 --- src/sbin/route/route.c:1.142 Fri Oct 18 20:39:39 2013 +++ src/sbin/route/route.c Sat Oct 19 11:50:26 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: route.c,v 1.142 2013/10/19 00:39:39 christos Exp $ */ +/* $NetBSD: route.c,v 1.143 2013/10/19 15:50:26 christos Exp $ */ /* * Copyright (c) 1983, 1989, 1991, 1993 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19 #if 0 static char sccsid[] = "@(#)route.c 8.6 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: route.c,v 1.142 2013/10/19 00:39:39 christos Exp $"); +__RCSID("$NetBSD: route.c,v 1.143 2013/10/19 15:50:26 christos Exp $"); #endif #endif /* not lint */ @@ -538,7 +538,8 @@ routename(const struct sockaddr *sa, str memcpy(&sin6, sa, sa->sa_len); sin6.sin6_len = sizeof(struct sockaddr_in6); sin6.sin6_famil
CVS commit: src/sbin
Module Name:src Committed By: christos Date: Sat Oct 19 15:59:15 UTC 2013 Modified Files: src/sbin/ifconfig: tunnel.c src/sbin/route: route.c Log Message: use correct function To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/sbin/ifconfig/tunnel.c cvs rdiff -u -r1.143 -r1.144 src/sbin/route/route.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/ifconfig/tunnel.c diff -u src/sbin/ifconfig/tunnel.c:1.19 src/sbin/ifconfig/tunnel.c:1.20 --- src/sbin/ifconfig/tunnel.c:1.19 Sat Oct 19 11:50:26 2013 +++ src/sbin/ifconfig/tunnel.c Sat Oct 19 11:59:15 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: tunnel.c,v 1.19 2013/10/19 15:50:26 christos Exp $ */ +/* $NetBSD: tunnel.c,v 1.20 2013/10/19 15:59:15 christos Exp $ */ /* * Copyright (c) 1983, 1993 @@ -31,7 +31,7 @@ #include #ifndef lint -__RCSID("$NetBSD: tunnel.c,v 1.19 2013/10/19 15:50:26 christos Exp $"); +__RCSID("$NetBSD: tunnel.c,v 1.20 2013/10/19 15:59:15 christos Exp $"); #endif /* not lint */ #include @@ -126,7 +126,7 @@ settunnel(prop_dictionary_t env, prop_di errx(EXIT_FAILURE, "tunnel src/dst is multicast"); /* embed scopeid */ inet6_putscopeid(s6, INET6_IS_ADDR_LINKLOCAL); - inet6_getscopeid(d, INET6_IS_ADDR_LINKLOCAL); + inet6_putscopeid(d, INET6_IS_ADDR_LINKLOCAL); } #endif /* INET6 */ Index: src/sbin/route/route.c diff -u src/sbin/route/route.c:1.143 src/sbin/route/route.c:1.144 --- src/sbin/route/route.c:1.143 Sat Oct 19 11:50:26 2013 +++ src/sbin/route/route.c Sat Oct 19 11:59:15 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: route.c,v 1.143 2013/10/19 15:50:26 christos Exp $ */ +/* $NetBSD: route.c,v 1.144 2013/10/19 15:59:15 christos Exp $ */ /* * Copyright (c) 1983, 1989, 1991, 1993 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19 #if 0 static char sccsid[] = "@(#)route.c 8.6 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: route.c,v 1.143 2013/10/19 15:50:26 christos Exp $"); +__RCSID("$NetBSD: route.c,v 1.144 2013/10/19 15:59:15 christos Exp $"); #endif #endif /* not lint */ @@ -696,7 +696,7 @@ netname(const struct sockaddr *sa, struc memcpy(&sin6, sa, sa->sa_len); sin6.sin6_len = sizeof(struct sockaddr_in6); sin6.sin6_family = AF_INET6; - inet6_putscopeid(&sin6, INET6_IS_ADDR_LINKLOCAL| + inet6_getscopeid(&sin6, INET6_IS_ADDR_LINKLOCAL| INET6_IS_ADDR_MC_LINKLOCAL); nml = netmask_length(nm, AF_INET6); if (IN6_IS_ADDR_UNSPECIFIED(&sin6.sin6_addr)) { @@ -1237,7 +1237,7 @@ getaddr(int which, const char *s, struct } memcpy(&su->sin6, res->ai_addr, sizeof(su->sin6)); freeaddrinfo(res); - inet6_getscopeid(&su->sin6, INET6_IS_ADDR_LINKLOCAL| + inet6_putscopeid(&su->sin6, INET6_IS_ADDR_LINKLOCAL| INET6_IS_ADDR_MC_LINKLOCAL); if (hints.ai_flags == AI_NUMERICHOST) { if (slash)
CVS commit: src/sbin
Module Name:src Committed By: christos Date: Wed Dec 25 22:04:52 UTC 2013 Modified Files: src/sbin: Makefile Removed Files: src/sbin/mount_smbfs: Makefile Makefile.inc Log Message: moved to external To generate a diff of this commit: cvs rdiff -u -r1.125 -r1.126 src/sbin/Makefile cvs rdiff -u -r1.12 -r0 src/sbin/mount_smbfs/Makefile cvs rdiff -u -r1.5 -r0 src/sbin/mount_smbfs/Makefile.inc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/Makefile diff -u src/sbin/Makefile:1.125 src/sbin/Makefile:1.126 --- src/sbin/Makefile:1.125 Mon Oct 28 15:05:21 2013 +++ src/sbin/Makefile Wed Dec 25 17:04:52 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.125 2013/10/28 19:05:21 mbalmer Exp $ +# $NetBSD: Makefile,v 1.126 2013/12/25 22:04:52 christos Exp $ # @(#)Makefile 8.5 (Berkeley) 3/31/94 # Not ported: XNSrouted enpload scsiformat startslip @@ -44,7 +44,6 @@ SUBDIR+= mount_portal SUBDIR+= mount_procfs SUBDIR+= mount_ptyfs SUBDIR+= mount_puffs -SUBDIR+= mount_smbfs SUBDIR+= mount_sysvbfs SUBDIR+= mount_tmpfs SUBDIR+= mount_umap
CVS commit: src/sbin
Module Name:src Committed By: lukem Date: Sat Apr 11 07:58:13 UTC 2009 Modified Files: src/sbin: Makefile.inc src/sbin/bioctl: Makefile src/sbin/dump: Makefile src/sbin/dump_lfs: Makefile src/sbin/fsck_ffs: Makefile src/sbin/fsck_lfs: Makefile src/sbin/fsdb: Makefile src/sbin/gpt: Makefile src/sbin/ifconfig: Makefile src/sbin/init: Makefile src/sbin/mknod: Makefile src/sbin/mount_smbfs: Makefile src/sbin/mount_tmpfs: Makefile src/sbin/mount_udf: Makefile src/sbin/newfs_ext2fs: Makefile src/sbin/newfs_lfs: Makefile src/sbin/newfs_udf: Makefile src/sbin/resize_lfs: Makefile src/sbin/setkey: Makefile src/sbin/shutdown: Makefile Log Message: Enable WARNS=4 by default except for: dump dump_lfs fsck_ffs fsck_lfs fsdb mount_smbfs newfs_ext2fs newfs_lfs resize_lfs setkey To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/sbin/Makefile.inc cvs rdiff -u -r1.3 -r1.4 src/sbin/bioctl/Makefile cvs rdiff -u -r1.35 -r1.36 src/sbin/dump/Makefile cvs rdiff -u -r1.10 -r1.11 src/sbin/dump_lfs/Makefile cvs rdiff -u -r1.38 -r1.39 src/sbin/fsck_ffs/Makefile cvs rdiff -u -r1.15 -r1.16 src/sbin/fsck_lfs/Makefile cvs rdiff -u -r1.24 -r1.25 src/sbin/fsdb/Makefile cvs rdiff -u -r1.2 -r1.3 src/sbin/gpt/Makefile cvs rdiff -u -r1.40 -r1.41 src/sbin/ifconfig/Makefile cvs rdiff -u -r1.37 -r1.38 src/sbin/init/Makefile cvs rdiff -u -r1.12 -r1.13 src/sbin/mknod/Makefile cvs rdiff -u -r1.5 -r1.6 src/sbin/mount_smbfs/Makefile cvs rdiff -u -r1.4 -r1.5 src/sbin/mount_tmpfs/Makefile cvs rdiff -u -r1.2 -r1.3 src/sbin/mount_udf/Makefile cvs rdiff -u -r1.1 -r1.2 src/sbin/newfs_ext2fs/Makefile cvs rdiff -u -r1.6 -r1.7 src/sbin/newfs_lfs/Makefile cvs rdiff -u -r1.2 -r1.3 src/sbin/newfs_udf/Makefile cvs rdiff -u -r1.3 -r1.4 src/sbin/resize_lfs/Makefile cvs rdiff -u -r1.9 -r1.10 src/sbin/setkey/Makefile cvs rdiff -u -r1.10 -r1.11 src/sbin/shutdown/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/Makefile.inc diff -u src/sbin/Makefile.inc:1.20 src/sbin/Makefile.inc:1.21 --- src/sbin/Makefile.inc:1.20 Sun Oct 8 17:52:28 2006 +++ src/sbin/Makefile.inc Sat Apr 11 07:58:11 2009 @@ -1,9 +1,9 @@ -# $NetBSD: Makefile.inc,v 1.20 2006/10/08 17:52:28 peter Exp $ +# $NetBSD: Makefile.inc,v 1.21 2009/04/11 07:58:11 lukem Exp $ # @(#)Makefile.inc 8.1 (Berkeley) 6/8/93 .include # for MKDYNAMICROOT definition -WARNS?= 3 +WARNS?= 4 BINDIR?= /sbin .if (${MKDYNAMICROOT} == "no") Index: src/sbin/bioctl/Makefile diff -u src/sbin/bioctl/Makefile:1.3 src/sbin/bioctl/Makefile:1.4 --- src/sbin/bioctl/Makefile:1.3 Wed Jan 2 23:45:06 2008 +++ src/sbin/bioctl/Makefile Sat Apr 11 07:58:11 2009 @@ -1,9 +1,7 @@ -# $OpenBSD: Makefile,v 1.8 2006/11/26 11:31:08 deraadt Exp $ +# $NetBSD: Makefile,v 1.4 2009/04/11 07:58:11 lukem Exp $ PROG= bioctl SRCS= bioctl.c strtonum.c MAN= bioctl.8 -WARNS= 4 - .include Index: src/sbin/dump/Makefile diff -u src/sbin/dump/Makefile:1.35 src/sbin/dump/Makefile:1.36 --- src/sbin/dump/Makefile:1.35 Fri Aug 29 00:02:23 2008 +++ src/sbin/dump/Makefile Sat Apr 11 07:58:11 2009 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.35 2008/08/29 00:02:23 gmcgarry Exp $ +# $NetBSD: Makefile,v 1.36 2009/04/11 07:58:11 lukem Exp $ # @(#)Makefile 8.1 (Berkeley) 6/5/93 # dump.h header file @@ -20,6 +20,8 @@ # STATS read cache statistics # DIAGNOSTICS read cache diagnostic checks +WARNS?= 3 # XXX: sign-compare issues + .include PROG= dump Index: src/sbin/dump_lfs/Makefile diff -u src/sbin/dump_lfs/Makefile:1.10 src/sbin/dump_lfs/Makefile:1.11 --- src/sbin/dump_lfs/Makefile:1.10 Fri Feb 13 16:02:05 2009 +++ src/sbin/dump_lfs/Makefile Sat Apr 11 07:58:12 2009 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.10 2009/02/13 16:02:05 uebayasi Exp $ +# $NetBSD: Makefile,v 1.11 2009/04/11 07:58:12 lukem Exp $ # @(#)Makefile 8.1 (Berkeley) 6/5/93 # lfs_inode.c LFS filestore-specific routines @@ -6,6 +6,8 @@ # DEBUG use local directory to find ddate and dumpdates # TDEBUG trace out the process forking +WARNS?= 3 # XXX: sign-compare issues + .include PROG= dump_lfs Index: src/sbin/fsck_ffs/Makefile diff -u src/sbin/fsck_ffs/Makefile:1.38 src/sbin/fsck_ffs/Makefile:1.39 --- src/sbin/fsck_ffs/Makefile:1.38 Sat Aug 30 10:46:16 2008 +++ src/sbin/fsck_ffs/Makefile Sat Apr 11 07:58:12 2009 @@ -1,6 +1,8 @@ -# $NetBSD: Makefile,v 1.38 2008/08/30 10:46:16 bouyer Exp $ +# $NetBSD: Makefile,v 1.39 2009/04/11 07:58:12 lukem Exp $ # @(#)Makefile 8.2 (Berkeley) 4/27/95 +WARNS?= 3 # XXX: sign-compare issues + .include PROG= fsck_ffs Index: src/sbin/fsck_lfs/Makefile diff -u src/sbin/fsck_lfs/Makefile:1.15 src/sbin/fsck_lfs/Makefile:1.16 --- src/sbin/fsck_lfs/Makefile:1.15 Fri Dec 28 21:44:32 2007 +++ src/sbin/fsck_lfs/M
CVS commit: src/sbin
Module Name:src Committed By: christos Date: Thu Jun 9 19:57:53 UTC 2011 Modified Files: src/sbin/fsck: fsutil.c fsutil.h src/sbin/fsck_ext2fs: extern.h main.c utilities.c src/sbin/fsck_ffs: extern.h main.c pass1.c pass2.c setup.c utilities.c src/sbin/fsck_lfs: extern.h main.c utilities.c src/sbin/fsdb: fsdb.c Log Message: share more code. To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/sbin/fsck/fsutil.c cvs rdiff -u -r1.15 -r1.16 src/sbin/fsck/fsutil.h cvs rdiff -u -r1.6 -r1.7 src/sbin/fsck_ext2fs/extern.h cvs rdiff -u -r1.36 -r1.37 src/sbin/fsck_ext2fs/main.c cvs rdiff -u -r1.21 -r1.22 src/sbin/fsck_ext2fs/utilities.c cvs rdiff -u -r1.26 -r1.27 src/sbin/fsck_ffs/extern.h cvs rdiff -u -r1.78 -r1.79 src/sbin/fsck_ffs/main.c cvs rdiff -u -r1.47 -r1.48 src/sbin/fsck_ffs/pass1.c cvs rdiff -u -r1.46 -r1.47 src/sbin/fsck_ffs/pass2.c cvs rdiff -u -r1.92 -r1.93 src/sbin/fsck_ffs/setup.c cvs rdiff -u -r1.59 -r1.60 src/sbin/fsck_ffs/utilities.c cvs rdiff -u -r1.8 -r1.9 src/sbin/fsck_lfs/extern.h cvs rdiff -u -r1.42 -r1.43 src/sbin/fsck_lfs/main.c cvs rdiff -u -r1.30 -r1.31 src/sbin/fsck_lfs/utilities.c cvs rdiff -u -r1.39 -r1.40 src/sbin/fsdb/fsdb.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/fsck/fsutil.c diff -u src/sbin/fsck/fsutil.c:1.19 src/sbin/fsck/fsutil.c:1.20 --- src/sbin/fsck/fsutil.c:1.19 Thu Feb 4 18:55:42 2010 +++ src/sbin/fsck/fsutil.c Thu Jun 9 15:57:50 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: fsutil.c,v 1.19 2010/02/04 23:55:42 christos Exp $ */ +/* $NetBSD: fsutil.c,v 1.20 2011/06/09 19:57:50 christos Exp $ */ /* * Copyright (c) 1990, 1993 @@ -31,7 +31,7 @@ #include #ifndef lint -__RCSID("$NetBSD: fsutil.c,v 1.19 2010/02/04 23:55:42 christos Exp $"); +__RCSID("$NetBSD: fsutil.c,v 1.20 2011/06/09 19:57:50 christos Exp $"); #endif /* not lint */ #include @@ -42,6 +42,8 @@ #include #include #include +#include +#include #include #include @@ -256,3 +258,44 @@ (void)snprintf(b, sizeof(b), "%lld ", (long long)t); return b; } + + +void +catch(int n) +{ + if (ckfinish) (*ckfinish)(0); + _exit(FSCK_EXIT_SIGNALLED); +} + +/* + * When preening, allow a single quit to signal + * a special exit after filesystem checks complete + * so that reboot sequence may be interrupted. + */ +void +catchquit(int n) +{ + static const char msg[] = + "returning to single-user after filesystem check\n"; + int serrno = errno; + + (void)write(STDOUT_FILENO, msg, sizeof(msg) - 1); + returntosingle = 1; + (void)signal(SIGQUIT, SIG_DFL); + errno = serrno; +} + +/* + * Ignore a single quit signal; wait and flush just in case. + * Used by child processes in preen. + */ +void +voidquit(int n) +{ + int serrno = errno; + + sleep(1); + (void)signal(SIGQUIT, SIG_IGN); + (void)signal(SIGQUIT, SIG_DFL); + errno = serrno; +} Index: src/sbin/fsck/fsutil.h diff -u src/sbin/fsck/fsutil.h:1.15 src/sbin/fsck/fsutil.h:1.16 --- src/sbin/fsck/fsutil.h:1.15 Thu Feb 4 18:55:42 2010 +++ src/sbin/fsck/fsutil.h Thu Jun 9 15:57:50 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: fsutil.h,v 1.15 2010/02/04 23:55:42 christos Exp $ */ +/* $NetBSD: fsutil.h,v 1.16 2011/06/09 19:57:50 christos Exp $ */ /* * Copyright (c) 1996 Christos Zoulas. All rights reserved. @@ -56,3 +56,9 @@ struct fstab; int checkfstab(int, int, void *(*)(struct fstab *), int (*) (const char *, const char *, const char *, void *, pid_t *)); + +void (*ckfinish)(int); +volatile sig_atomic_t returntosingle; +void catch(int); +void catchquit(int); +void voidquit(int); Index: src/sbin/fsck_ext2fs/extern.h diff -u src/sbin/fsck_ext2fs/extern.h:1.6 src/sbin/fsck_ext2fs/extern.h:1.7 --- src/sbin/fsck_ext2fs/extern.h:1.6 Sun Jun 26 19:01:39 2005 +++ src/sbin/fsck_ext2fs/extern.h Thu Jun 9 15:57:50 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: extern.h,v 1.6 2005/06/26 23:01:39 christos Exp $ */ +/* $NetBSD: extern.h,v 1.7 2011/06/09 19:57:50 christos Exp $ */ /* * Copyright (c) 1997 Manuel Bouyer. @@ -71,6 +71,3 @@ void resetinodebuf(void); int setup(const char *); struct ext2fs_dinode * getnextinode(ino_t); -void catch(int); -void catchquit(int); -void voidquit(int); Index: src/sbin/fsck_ext2fs/main.c diff -u src/sbin/fsck_ext2fs/main.c:1.36 src/sbin/fsck_ext2fs/main.c:1.37 --- src/sbin/fsck_ext2fs/main.c:1.36 Wed Jan 6 20:39:56 2010 +++ src/sbin/fsck_ext2fs/main.c Thu Jun 9 15:57:51 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.36 2010/01/07 01:39:56 christos Exp $ */ +/* $NetBSD: main.c,v 1.37 2011/06/09 19:57:51 christos Exp $ */ /* * Copyright (c) 1980, 1986, 1993 @@ -63,7 +63,7 @@ #if 0 static char sccsid[] = "@(#)main.c 8.2 (Berkeley) 1/23/94"; #else -__RCSID("$NetBSD: main.c,v 1.36 2010/01/07 01:39:56 christos Exp $"); +__RCSID("$NetBSD: main.c,v 1.37 2011/06/09 19:57:51 christos Exp $"); #endif #endif /* not lint */ @@ -100,6 +100,7 @@ int ch; int ret = FSCK
CVS commit: src/sbin
Module Name:src Committed By: christos Date: Thu Jun 9 21:23:30 UTC 2011 Modified Files: src/sbin/fsck: fsutil.h src/sbin/fsck_msdos: main.c src/sbin/fsdb: fsdb.c Log Message: fix compilation. To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/sbin/fsck/fsutil.h cvs rdiff -u -r1.22 -r1.23 src/sbin/fsck_msdos/main.c cvs rdiff -u -r1.40 -r1.41 src/sbin/fsdb/fsdb.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/fsck/fsutil.h diff -u src/sbin/fsck/fsutil.h:1.16 src/sbin/fsck/fsutil.h:1.17 --- src/sbin/fsck/fsutil.h:1.16 Thu Jun 9 15:57:50 2011 +++ src/sbin/fsck/fsutil.h Thu Jun 9 17:23:29 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: fsutil.h,v 1.16 2011/06/09 19:57:50 christos Exp $ */ +/* $NetBSD: fsutil.h,v 1.17 2011/06/09 21:23:29 christos Exp $ */ /* * Copyright (c) 1996 Christos Zoulas. All rights reserved. @@ -25,6 +25,7 @@ */ #include +#include void errexit(const char *, ...) __attribute__((__noreturn__,__format__(__printf__,1,2))); Index: src/sbin/fsck_msdos/main.c diff -u src/sbin/fsck_msdos/main.c:1.22 src/sbin/fsck_msdos/main.c:1.23 --- src/sbin/fsck_msdos/main.c:1.22 Sun Apr 11 04:23:52 2010 +++ src/sbin/fsck_msdos/main.c Thu Jun 9 17:23:29 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.22 2010/04/11 08:23:52 hannken Exp $ */ +/* $NetBSD: main.c,v 1.23 2011/06/09 21:23:29 christos Exp $ */ /* * Copyright (C) 1995 Wolfgang Solfrank @@ -28,7 +28,7 @@ #include #ifndef lint -__RCSID("$NetBSD: main.c,v 1.22 2010/04/11 08:23:52 hannken Exp $"); +__RCSID("$NetBSD: main.c,v 1.23 2011/06/09 21:23:29 christos Exp $"); #endif /* not lint */ #include @@ -61,12 +61,6 @@ exit(FSCK_EXIT_USAGE); } -static void -catch(int n) -{ - exit(FSCK_EXIT_SIGNALLED); -} - int main(int argc, char **argv) { Index: src/sbin/fsdb/fsdb.c diff -u src/sbin/fsdb/fsdb.c:1.40 src/sbin/fsdb/fsdb.c:1.41 --- src/sbin/fsdb/fsdb.c:1.40 Thu Jun 9 15:57:53 2011 +++ src/sbin/fsdb/fsdb.c Thu Jun 9 17:23:30 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: fsdb.c,v 1.40 2011/06/09 19:57:53 christos Exp $ */ +/* $NetBSD: fsdb.c,v 1.41 2011/06/09 21:23:30 christos Exp $ */ /*- * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include #ifndef lint -__RCSID("$NetBSD: fsdb.c,v 1.40 2011/06/09 19:57:53 christos Exp $"); +__RCSID("$NetBSD: fsdb.c,v 1.41 2011/06/09 21:23:30 christos Exp $"); #endif /* not lint */ #include @@ -139,7 +139,7 @@ sblock->fs_clean = 0; /* mark it dirty */ sbdirty(); markclean = 0; - ckfini(); + ckfini(1); printf("*** FILE SYSTEM MARKED DIRTY\n"); printf("*** BE SURE TO RUN FSCK TO CLEAN UP ANY DAMAGE\n"); printf("*** IF IT WAS MOUNTED, RE-MOUNT WITH -u -o reload\n");
CVS commit: src/sbin
Module Name:src Committed By: wiz Date: Mon Jun 27 13:50:32 UTC 2011 Modified Files: src/sbin/fsck_v7fs: fsck_v7fs.8 src/sbin/mount_v7fs: mount_v7fs.8 src/sbin/newfs_v7fs: newfs_v7fs.8 Log Message: Various improvements. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sbin/fsck_v7fs/fsck_v7fs.8 cvs rdiff -u -r1.1 -r1.2 src/sbin/mount_v7fs/mount_v7fs.8 cvs rdiff -u -r1.1 -r1.2 src/sbin/newfs_v7fs/newfs_v7fs.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/fsck_v7fs/fsck_v7fs.8 diff -u src/sbin/fsck_v7fs/fsck_v7fs.8:1.1 src/sbin/fsck_v7fs/fsck_v7fs.8:1.2 --- src/sbin/fsck_v7fs/fsck_v7fs.8:1.1 Mon Jun 27 11:52:58 2011 +++ src/sbin/fsck_v7fs/fsck_v7fs.8 Mon Jun 27 13:50:31 2011 @@ -1,4 +1,4 @@ -.\" $NetBSD: fsck_v7fs.8,v 1.1 2011/06/27 11:52:58 uch Exp $ +.\" $NetBSD: fsck_v7fs.8,v 1.2 2011/06/27 13:50:31 wiz Exp $ .\" .\" Copyright (c) 2011 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -35,17 +35,16 @@ .Nd 7th Edition(V7) filesystem consistency checker .Sh SYNOPSIS .Nm -.Op Fl o Ar options +.Op Fl FnPpy .Op Fl B Ar byteorder -.Op Fl nypP -.Op Fl F +.Op Fl o Ar options .Ar filesystem ... .Sh DESCRIPTION The .Nm utility verifies and repairs .Tn Version 7 -filesystems +file systems. .Pp The following flags are interpreted by .Nm . @@ -55,23 +54,14 @@ .Ar byteorder byte order if needed. Valid byte orders are -.Dq be -and -.Dq le +.Dq be , +.Dq le , and .Dq pdp . .It Fl F -Check file system to a regular file. +Check file system inside a regular file. .It Fl n Don't correct file system. -.It Fl y -Causes -.Nm -to assume yes as the answer to all operator questions. -.It Fl p -preen mode. See fsck(8) -.It Fl P -Display a progress meter for the file system check. .It Fl o Options are specified with a .Fl o @@ -79,11 +69,20 @@ The following options are available: .Bl -tag -width data .It Cm data -.Tn Check data block duplication. +Check data block duplication. .It Cm free -.Tn Check free block duplication. +Check free block duplication. .El - +.It Fl P +Display a progress meter for the file system check. +.It Fl p +Preen mode. +See +.Xr fsck 8 . +.It Fl y +Causes +.Nm +to assume yes as the answer to all operator questions. .El .Sh SEE ALSO .Xr fsck 8 , Index: src/sbin/mount_v7fs/mount_v7fs.8 diff -u src/sbin/mount_v7fs/mount_v7fs.8:1.1 src/sbin/mount_v7fs/mount_v7fs.8:1.2 --- src/sbin/mount_v7fs/mount_v7fs.8:1.1 Mon Jun 27 11:52:58 2011 +++ src/sbin/mount_v7fs/mount_v7fs.8 Mon Jun 27 13:50:31 2011 @@ -1,4 +1,4 @@ -.\" $NetBSD: mount_v7fs.8,v 1.1 2011/06/27 11:52:58 uch Exp $ +.\" $NetBSD: mount_v7fs.8,v 1.2 2011/06/27 13:50:31 wiz Exp $ .\" .\" Copyright (c) 2011 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -84,13 +84,12 @@ .Xr mount 8 at boot time. The options are as follows: -.Bl -tag -width Fl +.Bl -tag -width XBXbyteorderXX .It Fl B Ar byte-order Specify the metadata byte order of the file system. Valid byte orders are -.Sq be -and -.Sq le +.Sq be , +.Sq le , and .Sq pdp . If no byte order is specified, the file system is mounted in host Index: src/sbin/newfs_v7fs/newfs_v7fs.8 diff -u src/sbin/newfs_v7fs/newfs_v7fs.8:1.1 src/sbin/newfs_v7fs/newfs_v7fs.8:1.2 --- src/sbin/newfs_v7fs/newfs_v7fs.8:1.1 Mon Jun 27 11:52:58 2011 +++ src/sbin/newfs_v7fs/newfs_v7fs.8 Mon Jun 27 13:50:31 2011 @@ -1,4 +1,4 @@ -.\" $NetBSD: newfs_v7fs.8,v 1.1 2011/06/27 11:52:58 uch Exp $ +.\" $NetBSD: newfs_v7fs.8,v 1.2 2011/06/27 13:50:31 wiz Exp $ .\" .\" Copyright (c) 2011 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -64,14 +64,15 @@ .Nd construct a new 7th Edition(V7) File System .Sh SYNOPSIS .Nm +.Op Fl FPvZ .Op Fl B Ar byte-order -.Op Fl FZvP -.Op Fl s Ar sectors .Op Fl n Ar inodes +.Op Fl s Ar sectors .Ar special .Sh DESCRIPTION .Nm -builds a 7th Edition(V7) file system on the specified special. +builds a 7th Edition(V7) file system on the specified +.Ar special . If it is a device, the size information will be taken from the disk label and before running .Nm @@ -80,34 +81,35 @@ the proper fstype is .Dq Version 7 . Otherwise, the size must be specified on the command line. -V7 filesystem's block size and sector size are 512byte. -disk address limits are 24bit. +V7 filesystem's block size and sector size are 512 byte. +Disk address limits are 24 bit. .Pp The following arguments are supported: -.Bl -tag -width Fl -.It Fl P -Display a progress meter for the file system construct. -.It Fl v -verbose. -.It Fl F -Create file system to a regular file.(needs -s option) -.It Fl s Ar sectors -Create file system with specified number of disk sectors. -.It Fl Z -Fill file with zeroes instead of creating a sparse file. +.Bl -tag -width XBXbyteXorderXX .It Fl B Ar byte-order Specify the metadata byte order of the file system to be created. Valid byte orders are -.Sq be -and -.Sq le +.Sq be , +
CVS commit: src/sbin
Module Name:src Committed By: dholland Date: Sat May 14 19:46:10 UTC 2011 Modified Files: src/sbin/fsck_ffs: fsck_ffs.8 src/sbin/newfs: newfs.8 Log Message: Improve documentation of FFS formats and format levels from PR 32100. Prompted also by recent discussion on tech-kern. Bump date. To generate a diff of this commit: cvs rdiff -u -r1.47 -r1.48 src/sbin/fsck_ffs/fsck_ffs.8 cvs rdiff -u -r1.81 -r1.82 src/sbin/newfs/newfs.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/fsck_ffs/fsck_ffs.8 diff -u src/sbin/fsck_ffs/fsck_ffs.8:1.47 src/sbin/fsck_ffs/fsck_ffs.8:1.48 --- src/sbin/fsck_ffs/fsck_ffs.8:1.47 Fri Apr 29 10:34:52 2011 +++ src/sbin/fsck_ffs/fsck_ffs.8 Sat May 14 19:46:10 2011 @@ -1,4 +1,4 @@ -.\" $NetBSD: fsck_ffs.8,v 1.47 2011/04/29 10:34:52 wiz Exp $ +.\" $NetBSD: fsck_ffs.8,v 1.48 2011/05/14 19:46:10 dholland Exp $ .\" .\" Copyright (c) 1980, 1989, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" @(#)fsck.8 8.3 (Berkeley) 11/29/94 .\" -.Dd April 29, 2011 +.Dd May 14, 2011 .Dt FSCK_FFS 8 .Os .Sh NAME @@ -173,20 +173,34 @@ The file system is in the old (static table) format. .It 1 The file system is in the new (dynamic table) format. +Such file systems are made by using the +.Fl O Ar 0 +option to +.Xr newfs 8 . .It 2 The file system supports 32-bit UIDs and GIDs, short symbolic links are stored in the inode, and directories have an added field showing the file type. +This format was introduced in +.Bx 4.4 . .It 3 If maxcontig is greater than one, build the free segment maps to aid in finding contiguous sets of blocks. If maxcontig is equal to one, delete any existing segment maps. +This was the default before +.Nx 2.0 . .It 4 Rearrange the super block to the same layout as FFSv2; disable the rotational layout tables and per cylinder group block totals. +Such file systems are made by using the +.Fl O Ar 1 +option to +.Xr newfs 8 . .El .Pp +Note that FFSv2 file systems are always level 4. +.Pp In interactive mode, .Nm will list the conversion to be made Index: src/sbin/newfs/newfs.8 diff -u src/sbin/newfs/newfs.8:1.81 src/sbin/newfs/newfs.8:1.82 --- src/sbin/newfs/newfs.8:1.81 Sun Mar 6 17:20:28 2011 +++ src/sbin/newfs/newfs.8 Sat May 14 19:46:10 2011 @@ -1,4 +1,4 @@ -.\" $NetBSD: newfs.8,v 1.81 2011/03/06 17:20:28 wiz Exp $ +.\" $NetBSD: newfs.8,v 1.82 2011/05/14 19:46:10 dholland Exp $ .\" .\" Copyright (c) 1983, 1987, 1991, 1993, 1994 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" @(#)newfs.8 8.6 (Berkeley) 5/3/95 .\" -.Dd January 13, 2011 +.Dd May 14, 2011 .Dt NEWFS 8 .Os .Sh NAME @@ -212,19 +212,25 @@ .It 0 4.3BSD; This option is primarily used to build root file systems that can be understood by older boot ROMs. +This generates an FFSv1 file system with level 1 format. .It 1 -FFSv1; normal fast-filesystem (default). -This is also known as +FFSv1; normal Fast File System, level 4 format. +Also known as .Sq FFS , .Sq UFS , or .Sq UFS1 . +This is the default. .It 2 -FFSv2; enhanced fast-filesystem (suited for more than 1 Terabyte capacity, -access control lists). +FFSv2; enhanced Fast File System, suited for more than 1 Terabyte capacity. +.\" Supports access control lists. This is also known as .Sq UFS2 . .El +See +.Xr fsck_ffs 8 +for more information about format levels. +.Pp To create an LFS filesystem see .Xr newfs_lfs 8 . To create a Linux ext2 filesystem see
CVS commit: src/sbin
Module Name:src Committed By: joerg Date: Thu Nov 17 16:20:47 UTC 2011 Modified Files: src/sbin/iscsictl: iscsic_globals.h iscsic_main.c src/sbin/iscsid: iscsid_globals.h Log Message: Use __dead To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sbin/iscsictl/iscsic_globals.h \ src/sbin/iscsictl/iscsic_main.c cvs rdiff -u -r1.2 -r1.3 src/sbin/iscsid/iscsid_globals.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/iscsictl/iscsic_globals.h diff -u src/sbin/iscsictl/iscsic_globals.h:1.3 src/sbin/iscsictl/iscsic_globals.h:1.4 --- src/sbin/iscsictl/iscsic_globals.h:1.3 Sun Oct 30 18:40:06 2011 +++ src/sbin/iscsictl/iscsic_globals.h Thu Nov 17 16:20:47 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: iscsic_globals.h,v 1.3 2011/10/30 18:40:06 christos Exp $ */ +/* $NetBSD: iscsic_globals.h,v 1.4 2011/11/17 16:20:47 joerg Exp $ */ /*- * Copyright (c) 2005,2006,2011 The NetBSD Foundation, Inc. @@ -152,13 +152,13 @@ ntohq(uint64_t x) /* iscsic_main.c */ -void arg_error(char *, const char *, ...) __printflike(2, 3); -void arg_missing(const char *); -void io_error(const char *, ...) __printflike(1, 2); -void gen_error(const char *, ...) __printflike(1, 2); +void arg_error(char *, const char *, ...) __printflike(2, 3) __dead; +void arg_missing(const char *) __dead; +void io_error(const char *, ...) __printflike(1, 2) __dead; +void gen_error(const char *, ...) __printflike(1, 2) __dead; void check_extra_args(int, char **); -void status_error(unsigned); -void status_error_slist(unsigned); +void status_error(unsigned) __dead; +void status_error_slist(unsigned) __dead; void send_request(unsigned, size_t, void *); iscsid_response_t *get_response(int); Index: src/sbin/iscsictl/iscsic_main.c diff -u src/sbin/iscsictl/iscsic_main.c:1.3 src/sbin/iscsictl/iscsic_main.c:1.4 --- src/sbin/iscsictl/iscsic_main.c:1.3 Sun Oct 30 18:40:06 2011 +++ src/sbin/iscsictl/iscsic_main.c Thu Nov 17 16:20:47 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: iscsic_main.c,v 1.3 2011/10/30 18:40:06 christos Exp $ */ +/* $NetBSD: iscsic_main.c,v 1.4 2011/11/17 16:20:47 joerg Exp $ */ /*- * Copyright (c) 2005,2006,2011 The NetBSD Foundation, Inc. @@ -219,7 +219,7 @@ int debug_level = ISCSI_DEBUG; /* How *Cleanup and exit. Does not return. */ -static void +__dead static void bye(void) { close(sock); Index: src/sbin/iscsid/iscsid_globals.h diff -u src/sbin/iscsid/iscsid_globals.h:1.2 src/sbin/iscsid/iscsid_globals.h:1.3 --- src/sbin/iscsid/iscsid_globals.h:1.2 Sat Oct 29 16:54:49 2011 +++ src/sbin/iscsid/iscsid_globals.h Thu Nov 17 16:20:47 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: iscsid_globals.h,v 1.2 2011/10/29 16:54:49 christos Exp $ */ +/* $NetBSD: iscsid_globals.h,v 1.3 2011/11/17 16:20:47 joerg Exp $ */ /*- * Copyright (c) 2005,2006,2011 The NetBSD Foundation, Inc. @@ -418,7 +418,7 @@ int debug_level;/* How much info to /* iscsid_main.c */ iscsid_response_t *make_rsp(size_t, iscsid_response_t **, int *); -void exit_daemon(void); +void exit_daemon(void) __dead; /* iscsid_lists.c */
CVS commit: src/sbin
Module Name:src Committed By: ahoka Date: Thu Nov 24 15:54:56 UTC 2011 Modified Files: src/sbin: Makefile Added Files: src/sbin/mount_chfs: Makefile mount_chfs.8 mount_chfs.c mount_chfs.h Log Message: Import mount_chfs for CHFS. To generate a diff of this commit: cvs rdiff -u -r1.122 -r1.123 src/sbin/Makefile cvs rdiff -u -r0 -r1.1 src/sbin/mount_chfs/Makefile \ src/sbin/mount_chfs/mount_chfs.8 src/sbin/mount_chfs/mount_chfs.c \ src/sbin/mount_chfs/mount_chfs.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/Makefile diff -u src/sbin/Makefile:1.122 src/sbin/Makefile:1.123 --- src/sbin/Makefile:1.122 Tue Nov 15 16:50:43 2011 +++ src/sbin/Makefile Thu Nov 24 15:54:54 2011 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.122 2011/11/15 16:50:43 riz Exp $ +# $NetBSD: Makefile,v 1.123 2011/11/24 15:54:54 ahoka Exp $ # @(#)Makefile 8.5 (Berkeley) 3/31/94 # Not ported: XNSrouted enpload scsiformat startslip @@ -24,6 +24,7 @@ SUBDIR+= newfs_udf SUBDIR+= newfs_v7fs fsck_v7fs SUBDIR+= mount_ados SUBDIR+= mount_cd9660 +SUBDIR+= mount_chfs SUBDIR+= mount_efs SUBDIR+= mount_ext2fs SUBDIR+= mount_fdesc Added files: Index: src/sbin/mount_chfs/Makefile diff -u /dev/null src/sbin/mount_chfs/Makefile:1.1 --- /dev/null Thu Nov 24 15:54:56 2011 +++ src/sbin/mount_chfs/Makefile Thu Nov 24 15:54:55 2011 @@ -0,0 +1,17 @@ +# $NetBSD: Makefile,v 1.1 2011/11/24 15:54:55 ahoka Exp $ +# +.include + +PROG= mount_chfs +SRCS= mount_chfs.c fattr.c pathadj.c +MAN= mount_chfs.8 + +MOUNT= ${NETBSDSRCDIR}/sbin/mount +.PATH: ${MOUNT} + +CPPFLAGS+= -I${MOUNT} +DPADD+= ${LIBUTIL} +LDADD+= -lutil +WARNS= 4 + +.include Index: src/sbin/mount_chfs/mount_chfs.8 diff -u /dev/null src/sbin/mount_chfs/mount_chfs.8:1.1 --- /dev/null Thu Nov 24 15:54:56 2011 +++ src/sbin/mount_chfs/mount_chfs.8 Thu Nov 24 15:54:55 2011 @@ -0,0 +1,62 @@ +.\" Copyright (c) 2005, 2006 The NetBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to The NetBSD Foundation +.\" by Julio M. Merino Vidal, developed as part of Google's Summer of Code +.\" 2005 program. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\"notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\"notice, this list of conditions and the following disclaimer in the +.\"documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.Dd November 24, 2011 +.Dt MOUNT_CHFS 8 +.Os +.Sh NAME +.Nm mount_chfs +.Nd mount a CHFS flash file system +.Sh SYNOPSIS +.Nm +.Sh DESCRIPTION +Mounts a flash file system from a +.Xr flash 4 +device. +CHFS file systems can be only mounted from flash devices. +For regular block devices like SSD drives or USB drives, +please use a regular file system. +The file system will be created during the first mount. +CHFS stands for Chip File System. +.Sh EXAMPLES +mount_chfs /dev/flash0 /mnt +.Sh SEE ALSO +.Xr fstab 5 , +.Xr mount 8 , +.Xr flash 9 , +.Xr flash 4 +.Sh HISTORY +CHFS was originally called ChewieFS during development. +The name was changed to avoid legal issues and to have a more +neutral name. +.Sh BUGS +CHFS has a few known bugs as of 2011. +.Sh AUTHORS +CHFS was developed at the Department of Software Engineering, +University of Szeged, Hungary + Index: src/sbin/mount_chfs/mount_chfs.c diff -u /dev/null src/sbin/mount_chfs/mount_chfs.c:1.1 --- /dev/null Thu Nov 24 15:54:56 2011 +++ src/sbin/mount_chfs/mount_chfs.c Thu Nov 24 15:54:55 2011 @@ -0,0 +1,151 @@ +/* $NetBSD: mount_chfs.c,v 1.1 2011/11/24 15:54:55 ahoka Exp $ */ + +/*- + * Copyright (c) 2010 Department of Software Engineering, + * University of Szeged, Hungary + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by the Department of Software Engineering, Un
CVS commit: src/sbin
Module Name:src Committed By: dyoung Date: Wed Feb 16 17:53:31 UTC 2011 Modified Files: src/sbin/reboot: reboot.8 reboot.c src/sbin/shutdown: shutdown.8 shutdown.c Log Message: Add flags -v, -x, and -z for verbose, debug, and silent shutdowns, respectively, by passing flags AB_VERBOSE, AB_DEBUG, and/or AB_SILENT to reboot(2). To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/sbin/reboot/reboot.8 cvs rdiff -u -r1.36 -r1.37 src/sbin/reboot/reboot.c cvs rdiff -u -r1.28 -r1.29 src/sbin/shutdown/shutdown.8 cvs rdiff -u -r1.52 -r1.53 src/sbin/shutdown/shutdown.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/reboot/reboot.8 diff -u src/sbin/reboot/reboot.8:1.27 src/sbin/reboot/reboot.8:1.28 --- src/sbin/reboot/reboot.8:1.27 Sun Dec 12 11:38:42 2010 +++ src/sbin/reboot/reboot.8 Wed Feb 16 17:53:31 2011 @@ -1,4 +1,4 @@ -.\" $NetBSD: reboot.8,v 1.27 2010/12/12 11:38:42 pooka Exp $ +.\" $NetBSD: reboot.8,v 1.28 2011/02/16 17:53:31 dyoung Exp $ .\" .\" Copyright (c) 1990, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" @(#)reboot.8 8.1 (Berkeley) 6/9/93 .\" -.Dd October 21, 2008 +.Dd February 16, 2011 .Dt REBOOT 8 .Os .Sh NAME @@ -81,6 +81,27 @@ software powerdown, the system will halt. This option is only valid for .Nm halt . +.It Fl v +To enable verbose messages on the console, pass the +.Xr boothowto 9 +flag +.Dv AB_VERBOSE +to +.Xr reboot 2 . +.It Fl x +To enable debugging messages on the console, pass the +.Xr boothowto 9 +flag +.Dv AB_DEBUG +to +.Xr reboot 2 . +.It Fl z +To silence some shutdown messages on the console, pass the +.Xr boothowto 9 +flag +.Dv AB_SILENT +to +.Xr reboot 2 . .It Fl q Do not give processes a chance to shut down before halting or restarting. This option should not normally be used. Index: src/sbin/reboot/reboot.c diff -u src/sbin/reboot/reboot.c:1.36 src/sbin/reboot/reboot.c:1.37 --- src/sbin/reboot/reboot.c:1.36 Sun Jul 20 01:20:23 2008 +++ src/sbin/reboot/reboot.c Wed Feb 16 17:53:31 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: reboot.c,v 1.36 2008/07/20 01:20:23 lukem Exp $ */ +/* $NetBSD: reboot.c,v 1.37 2011/02/16 17:53:31 dyoung Exp $ */ /* * Copyright (c) 1980, 1986, 1993 @@ -40,7 +40,7 @@ #if 0 static char sccsid[] = "@(#)reboot.c 8.1 (Berkeley) 6/5/93"; #else -__RCSID("$NetBSD: reboot.c,v 1.36 2008/07/20 01:20:23 lukem Exp $"); +__RCSID("$NetBSD: reboot.c,v 1.37 2011/02/16 17:53:31 dyoung Exp $"); #endif #endif /* not lint */ @@ -85,7 +85,7 @@ } else howto = 0; lflag = nflag = qflag = 0; - while ((ch = getopt(argc, argv, "dlnpq")) != -1) + while ((ch = getopt(argc, argv, "dlnpqvxz")) != -1) switch(ch) { case 'd': howto |= RB_DUMP; @@ -105,6 +105,15 @@ case 'q': qflag = 1; break; + case 'v': + howto |= AB_VERBOSE; + break; + case 'x': + howto |= AB_DEBUG; + break; + case 'z': + howto |= AB_SILENT; + break; case '?': default: usage(); Index: src/sbin/shutdown/shutdown.8 diff -u src/sbin/shutdown/shutdown.8:1.28 src/sbin/shutdown/shutdown.8:1.29 --- src/sbin/shutdown/shutdown.8:1.28 Tue Oct 21 02:35:51 2008 +++ src/sbin/shutdown/shutdown.8 Wed Feb 16 17:53:31 2011 @@ -1,4 +1,4 @@ -.\" $NetBSD: shutdown.8,v 1.28 2008/10/21 02:35:51 lukem Exp $ +.\" $NetBSD: shutdown.8,v 1.29 2011/02/16 17:53:31 dyoung Exp $ .\" .\" Copyright (c) 1988, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" @(#)shutdown.8 8.2 (Berkeley) 4/27/95 .\" -.Dd October 21, 2008 +.Dd February 16, 2011 .Dt SHUTDOWN 8 .Os .Sh NAME @@ -110,6 +110,27 @@ .Ar time , using .Xr reboot 8 . +.It Fl v +To enable verbose messages on the console, pass +.Fl v +to +.Xr reboot 8 +or +.Xr halt 8 . +.It Fl x +To enable debugging messages on the console, pass +.Fl x +to +.Xr reboot 8 +or +.Xr halt 8 . +.It Fl z +To silence some shutdown messages on the console, pass +.Fl z +to +.Xr reboot 8 +or +.Xr halt 8 . .It Fl D Prevents .Nm Index: src/sbin/shutdown/shutdown.c diff -u src/sbin/shutdown/shutdown.c:1.52 src/sbin/shutdown/shutdown.c:1.53 --- src/sbin/shutdown/shutdown.c:1.52 Wed Jun 9 04:51:53 2010 +++ src/sbin/shutdown/shutdown.c Wed Feb 16 17:53:31 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: shutdown.c,v 1.52 2010/06/09 04:51:53 riz Exp $ */ +/* $NetBSD: shutdown.c,v 1.53 2011/02/16 17:53:31 dyoung Exp $ */ /* * Copyright (c) 1988, 1990, 1993 @@ -39,7 +39,7 @@ #if 0 static char sccsid[] = "@(#)shutdown.c 8.4 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: shutdown.c,v 1.52 2010/06/09 04:51:53 riz Exp $"); +__RCSID("$NetBSD: shutdown.c,v 1.53 2011/02/16 17:53:31 dyoung Exp $"); #endif #endif /* not lint */ @@ -91,6 +91,7 @@ static int dofast, dohalt, doreboot, killflg, nofork, nosync, dodump; static size_t mbuflen; static int dopowerdown; +static int dodebug, dosilent, do
CVS commit: src/sbin
Module Name:src Committed By: christos Date: Wed Jan 6 18:12:37 UTC 2010 Modified Files: src/sbin/fsck_ext2fs: main.c utilities.c src/sbin/fsck_ffs: main.c utilities.c src/sbin/fsck_lfs: main.c utilities.c Log Message: PR/42568: Pedro F. Giffuni: Better signal handling from OpenBSD, but simplified. To generate a diff of this commit: cvs rdiff -u -r1.34 -r1.35 src/sbin/fsck_ext2fs/main.c cvs rdiff -u -r1.19 -r1.20 src/sbin/fsck_ext2fs/utilities.c cvs rdiff -u -r1.73 -r1.74 src/sbin/fsck_ffs/main.c cvs rdiff -u -r1.56 -r1.57 src/sbin/fsck_ffs/utilities.c cvs rdiff -u -r1.40 -r1.41 src/sbin/fsck_lfs/main.c cvs rdiff -u -r1.27 -r1.28 src/sbin/fsck_lfs/utilities.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/fsck_ext2fs/main.c diff -u src/sbin/fsck_ext2fs/main.c:1.34 src/sbin/fsck_ext2fs/main.c:1.35 --- src/sbin/fsck_ext2fs/main.c:1.34 Mon Oct 19 14:41:08 2009 +++ src/sbin/fsck_ext2fs/main.c Wed Jan 6 13:12:37 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.34 2009/10/19 18:41:08 bouyer Exp $ */ +/* $NetBSD: main.c,v 1.35 2010/01/06 18:12:37 christos Exp $ */ /* * Copyright (c) 1980, 1986, 1993 @@ -63,7 +63,7 @@ #if 0 static char sccsid[] = "@(#)main.c 8.2 (Berkeley) 1/23/94"; #else -__RCSID("$NetBSD: main.c,v 1.34 2009/10/19 18:41:08 bouyer Exp $"); +__RCSID("$NetBSD: main.c,v 1.35 2010/01/06 18:12:37 christos Exp $"); #endif #endif /* not lint */ @@ -87,7 +87,7 @@ #include "fsutil.h" #include "exitvalues.h" -int returntosingle = 0; +volatilel sigatomic_t returntosingle = 0; static int argtoi(int, const char *, const char *, int); Index: src/sbin/fsck_ext2fs/utilities.c diff -u src/sbin/fsck_ext2fs/utilities.c:1.19 src/sbin/fsck_ext2fs/utilities.c:1.20 --- src/sbin/fsck_ext2fs/utilities.c:1.19 Mon Oct 19 14:41:08 2009 +++ src/sbin/fsck_ext2fs/utilities.c Wed Jan 6 13:12:37 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: utilities.c,v 1.19 2009/10/19 18:41:08 bouyer Exp $ */ +/* $NetBSD: utilities.c,v 1.20 2010/01/06 18:12:37 christos Exp $ */ /* * Copyright (c) 1980, 1986, 1993 @@ -58,7 +58,7 @@ #if 0 static char sccsid[] = "@(#)utilities.c 8.1 (Berkeley) 6/5/93"; #else -__RCSID("$NetBSD: utilities.c,v 1.19 2009/10/19 18:41:08 bouyer Exp $"); +__RCSID("$NetBSD: utilities.c,v 1.20 2010/01/06 18:12:37 christos Exp $"); #endif #endif /* not lint */ @@ -84,7 +84,7 @@ static void rwerror(const char *, daddr_t); -extern int returntosingle; +extern volatile sigatomic_t returntosingle; int ftypeok(struct ext2fs_dinode *dp) @@ -156,9 +156,11 @@ if (bufcnt < MINBUFS) bufcnt = MINBUFS; for (i = 0; i < bufcnt; i++) { - bp = malloc(sizeof(struct bufarea)); - bufp = malloc((unsigned int)sblock.e2fs_bsize); + bp = size_t(sizeof(struct bufarea)); + bufp = malloc((size_t)sblock.e2fs_bsize); if (bp == NULL || bufp == NULL) { + free(bp); + free(bufp); if (i >= MINBUFS) break; errexit("cannot allocate buffer pool"); @@ -462,7 +464,7 @@ catch(int n) { ckfini(0); - exit(FSCK_EXIT_SIGNALLED); + _exit(FSCK_EXIT_SIGNALLED); } /* @@ -473,9 +475,14 @@ void catchquit(int n) { - printf("returning to single-user after filesystem check\n"); + static const char msg[] = + "returning to single-user after filesystem check\n"; + int serrno = errno; + + (void)write(STDOUT_FILENO, msg, sizeof(msg) - 1); returntosingle = 1; (void)signal(SIGQUIT, SIG_DFL); + errno = serrno; } /* @@ -485,10 +492,12 @@ void voidquit(int n) { + int serrno = errno; sleep(1); (void)signal(SIGQUIT, SIG_IGN); (void)signal(SIGQUIT, SIG_DFL); + errno = serrno; } /* Index: src/sbin/fsck_ffs/main.c diff -u src/sbin/fsck_ffs/main.c:1.73 src/sbin/fsck_ffs/main.c:1.74 --- src/sbin/fsck_ffs/main.c:1.73 Sun Oct 12 16:49:43 2008 +++ src/sbin/fsck_ffs/main.c Wed Jan 6 13:12:37 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.73 2008/10/12 20:49:43 wiz Exp $ */ +/* $NetBSD: main.c,v 1.74 2010/01/06 18:12:37 christos Exp $ */ /* * Copyright (c) 1980, 1986, 1993 @@ -39,7 +39,7 @@ #if 0 static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 5/14/95"; #else -__RCSID("$NetBSD: main.c,v 1.73 2008/10/12 20:49:43 wiz Exp $"); +__RCSID("$NetBSD: main.c,v 1.74 2010/01/06 18:12:37 christos Exp $"); #endif #endif /* not lint */ @@ -71,7 +71,7 @@ #include "snapshot.h" int progress = 0; -int returntosingle = 0; +volatile sigatomic_t returntosingle = 0; static int argtoi(int, const char *, const char *, int); static int checkfilesys(const char *, const char *, int); Index: src/sbin/fsck_ffs/utilities.c diff -u src/sbin/fsck_ffs/utilities.c:1.56 src/sbin/fsck_ffs/utilities.c:1.57 --- src/sbin/fsck_ffs/utilities.c:1.56 Thu Jul 31 01:38:04 2008 +++ src/sbin/fsck_ffs/utilities.c Wed Jan 6 13:12:37 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: utilities.c,v 1.56 2008/07/31 05:38:04 simonb Exp $ */ +/* $NetBSD: utilities.c,v 1.57 2010/01/06 18:12:37 christos Exp $
CVS commit: src/sbin
Module Name:src Committed By: christos Date: Thu Jan 7 01:39:56 UTC 2010 Modified Files: src/sbin/fsck_ext2fs: main.c utilities.c src/sbin/fsck_ffs: main.c utilities.c src/sbin/fsck_lfs: main.c utilities.c Log Message: make this compile again. To generate a diff of this commit: cvs rdiff -u -r1.35 -r1.36 src/sbin/fsck_ext2fs/main.c cvs rdiff -u -r1.20 -r1.21 src/sbin/fsck_ext2fs/utilities.c cvs rdiff -u -r1.74 -r1.75 src/sbin/fsck_ffs/main.c cvs rdiff -u -r1.57 -r1.58 src/sbin/fsck_ffs/utilities.c cvs rdiff -u -r1.41 -r1.42 src/sbin/fsck_lfs/main.c cvs rdiff -u -r1.28 -r1.29 src/sbin/fsck_lfs/utilities.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/fsck_ext2fs/main.c diff -u src/sbin/fsck_ext2fs/main.c:1.35 src/sbin/fsck_ext2fs/main.c:1.36 --- src/sbin/fsck_ext2fs/main.c:1.35 Wed Jan 6 13:12:37 2010 +++ src/sbin/fsck_ext2fs/main.c Wed Jan 6 20:39:56 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.35 2010/01/06 18:12:37 christos Exp $ */ +/* $NetBSD: main.c,v 1.36 2010/01/07 01:39:56 christos Exp $ */ /* * Copyright (c) 1980, 1986, 1993 @@ -63,7 +63,7 @@ #if 0 static char sccsid[] = "@(#)main.c 8.2 (Berkeley) 1/23/94"; #else -__RCSID("$NetBSD: main.c,v 1.35 2010/01/06 18:12:37 christos Exp $"); +__RCSID("$NetBSD: main.c,v 1.36 2010/01/07 01:39:56 christos Exp $"); #endif #endif /* not lint */ @@ -87,7 +87,7 @@ #include "fsutil.h" #include "exitvalues.h" -volatilel sigatomic_t returntosingle = 0; +volatile sig_atomic_t returntosingle = 0; static int argtoi(int, const char *, const char *, int); Index: src/sbin/fsck_ext2fs/utilities.c diff -u src/sbin/fsck_ext2fs/utilities.c:1.20 src/sbin/fsck_ext2fs/utilities.c:1.21 --- src/sbin/fsck_ext2fs/utilities.c:1.20 Wed Jan 6 13:12:37 2010 +++ src/sbin/fsck_ext2fs/utilities.c Wed Jan 6 20:39:56 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: utilities.c,v 1.20 2010/01/06 18:12:37 christos Exp $ */ +/* $NetBSD: utilities.c,v 1.21 2010/01/07 01:39:56 christos Exp $ */ /* * Copyright (c) 1980, 1986, 1993 @@ -58,7 +58,7 @@ #if 0 static char sccsid[] = "@(#)utilities.c 8.1 (Berkeley) 6/5/93"; #else -__RCSID("$NetBSD: utilities.c,v 1.20 2010/01/06 18:12:37 christos Exp $"); +__RCSID("$NetBSD: utilities.c,v 1.21 2010/01/07 01:39:56 christos Exp $"); #endif #endif /* not lint */ @@ -70,6 +70,7 @@ #include /* for IFMT & friends */ #include #include +#include #include #include #include @@ -84,7 +85,7 @@ static void rwerror(const char *, daddr_t); -extern volatile sigatomic_t returntosingle; +extern volatile sig_atomic_t returntosingle; int ftypeok(struct ext2fs_dinode *dp) @@ -156,7 +157,7 @@ if (bufcnt < MINBUFS) bufcnt = MINBUFS; for (i = 0; i < bufcnt; i++) { - bp = size_t(sizeof(struct bufarea)); + bp = malloc(sizeof(struct bufarea)); bufp = malloc((size_t)sblock.e2fs_bsize); if (bp == NULL || bufp == NULL) { free(bp); Index: src/sbin/fsck_ffs/main.c diff -u src/sbin/fsck_ffs/main.c:1.74 src/sbin/fsck_ffs/main.c:1.75 --- src/sbin/fsck_ffs/main.c:1.74 Wed Jan 6 13:12:37 2010 +++ src/sbin/fsck_ffs/main.c Wed Jan 6 20:39:56 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.74 2010/01/06 18:12:37 christos Exp $ */ +/* $NetBSD: main.c,v 1.75 2010/01/07 01:39:56 christos Exp $ */ /* * Copyright (c) 1980, 1986, 1993 @@ -39,7 +39,7 @@ #if 0 static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 5/14/95"; #else -__RCSID("$NetBSD: main.c,v 1.74 2010/01/06 18:12:37 christos Exp $"); +__RCSID("$NetBSD: main.c,v 1.75 2010/01/07 01:39:56 christos Exp $"); #endif #endif /* not lint */ @@ -71,7 +71,7 @@ #include "snapshot.h" int progress = 0; -volatile sigatomic_t returntosingle = 0; +volatile sig_atomic_t returntosingle = 0; static int argtoi(int, const char *, const char *, int); static int checkfilesys(const char *, const char *, int); Index: src/sbin/fsck_ffs/utilities.c diff -u src/sbin/fsck_ffs/utilities.c:1.57 src/sbin/fsck_ffs/utilities.c:1.58 --- src/sbin/fsck_ffs/utilities.c:1.57 Wed Jan 6 13:12:37 2010 +++ src/sbin/fsck_ffs/utilities.c Wed Jan 6 20:39:56 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: utilities.c,v 1.57 2010/01/06 18:12:37 christos Exp $ */ +/* $NetBSD: utilities.c,v 1.58 2010/01/07 01:39:56 christos Exp $ */ /* * Copyright (c) 1980, 1986, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)utilities.c 8.6 (Berkeley) 5/19/95"; #else -__RCSID("$NetBSD: utilities.c,v 1.57 2010/01/06 18:12:37 christos Exp $"); +__RCSID("$NetBSD: utilities.c,v 1.58 2010/01/07 01:39:56 christos Exp $"); #endif #endif /* not lint */ @@ -65,7 +65,7 @@ static void rwerror(const char *, daddr_t); -extern volatile sigatomic_t returntosingle; +extern volatile sig_atomic_t returntosingle; int ftypeok(union dinode *dp) Index: src/sbin/fsck_lfs/main.c diff -u src/sbin/fsck_lfs/main.c:1.41 src/sbin/fsck_lfs/main.c:1.42 --- src/sbin/fsck_lfs/main.c:1.41 Wed Jan
CVS commit: src/sbin
Module Name:src Committed By: pooka Date: Thu Jan 14 21:29:26 UTC 2010 Modified Files: src/sbin: Makefile Log Message: Descend into mount_puffs. To generate a diff of this commit: cvs rdiff -u -r1.114 -r1.115 src/sbin/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/Makefile diff -u src/sbin/Makefile:1.114 src/sbin/Makefile:1.115 --- src/sbin/Makefile:1.114 Sat Jul 18 16:31:41 2009 +++ src/sbin/Makefile Thu Jan 14 21:29:26 2010 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.114 2009/07/18 16:31:41 reinoud Exp $ +# $NetBSD: Makefile,v 1.115 2010/01/14 21:29:26 pooka Exp $ # @(#)Makefile 8.5 (Berkeley) 3/31/94 # Not ported: XNSrouted enpload scsiformat startslip @@ -41,6 +41,7 @@ SUBDIR+= mount_portal SUBDIR+= mount_procfs SUBDIR+= mount_ptyfs +SUBDIR+= mount_puffs SUBDIR+= mount_smbfs SUBDIR+= mount_sysvbfs SUBDIR+= mount_tmpfs
CVS commit: src/sbin
Module Name:src Committed By: mlelstv Date: Sun Jan 31 16:04:35 UTC 2010 Modified Files: src/sbin/fsck_ffs: setup.c src/sbin/newfs: mkfs.c Log Message: Skip handling of APPLEUFS_LABEL if it is smaller than a device block. In particular: - newfs will not try to erase the label - fsck_ffs will not try to validate the label This lets newfs and fsck work on 2048-byte-per-sector media. Does Apple UFS support such media and how? To generate a diff of this commit: cvs rdiff -u -r1.89 -r1.90 src/sbin/fsck_ffs/setup.c cvs rdiff -u -r1.106 -r1.107 src/sbin/newfs/mkfs.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/fsck_ffs/setup.c diff -u src/sbin/fsck_ffs/setup.c:1.89 src/sbin/fsck_ffs/setup.c:1.90 --- src/sbin/fsck_ffs/setup.c:1.89 Sun Sep 27 17:13:37 2009 +++ src/sbin/fsck_ffs/setup.c Sun Jan 31 16:04:35 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: setup.c,v 1.89 2009/09/27 17:13:37 bouyer Exp $ */ +/* $NetBSD: setup.c,v 1.90 2010/01/31 16:04:35 mlelstv Exp $ */ /* * Copyright (c) 1980, 1986, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)setup.c 8.10 (Berkeley) 5/9/95"; #else -__RCSID("$NetBSD: setup.c,v 1.89 2009/09/27 17:13:37 bouyer Exp $"); +__RCSID("$NetBSD: setup.c,v 1.90 2010/01/31 16:04:35 mlelstv Exp $"); #endif #endif /* not lint */ @@ -554,6 +554,8 @@ /* XXX do we have to deal with APPLEUFS_LABEL_OFFSET not * being block aligned (CD's?) */ + if (APPLEUFS_LABEL_SIZE % dev_bsize != 0) + return 0; if (bread(fsreadfd, (char *)appleufsblk.b_un.b_fs, label, (long)APPLEUFS_LABEL_SIZE) != 0) return 0; Index: src/sbin/newfs/mkfs.c diff -u src/sbin/newfs/mkfs.c:1.106 src/sbin/newfs/mkfs.c:1.107 --- src/sbin/newfs/mkfs.c:1.106 Thu May 7 06:56:56 2009 +++ src/sbin/newfs/mkfs.c Sun Jan 31 16:04:34 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: mkfs.c,v 1.106 2009/05/07 06:56:56 lukem Exp $ */ +/* $NetBSD: mkfs.c,v 1.107 2010/01/31 16:04:34 mlelstv Exp $ */ /* * Copyright (c) 1980, 1989, 1993 @@ -73,7 +73,7 @@ #if 0 static char sccsid[] = "@(#)mkfs.c 8.11 (Berkeley) 5/3/95"; #else -__RCSID("$NetBSD: mkfs.c,v 1.106 2009/05/07 06:56:56 lukem Exp $"); +__RCSID("$NetBSD: mkfs.c,v 1.107 2010/01/31 16:04:34 mlelstv Exp $"); #endif #endif /* not lint */ @@ -603,7 +603,7 @@ tv.tv_sec, 0); wtfs(APPLEUFS_LABEL_OFFSET/sectorsize, APPLEUFS_LABEL_SIZE, &appleufs); - } else { + } else if (APPLEUFS_LABEL_SIZE % sectorsize == 0) { struct appleufslabel appleufs; /* Look for & zap any existing valid apple ufs labels */ rdfs(APPLEUFS_LABEL_OFFSET/sectorsize,
CVS commit: src/sbin
Module Name:src Committed By: christos Date: Thu Feb 4 23:55:43 UTC 2010 Modified Files: src/sbin/fsck: fsutil.c fsutil.h src/sbin/fsck_ext2fs: inode.c pass1.c src/sbin/fsck_ffs: inode.c src/sbin/fsck_lfs: inode.c Log Message: Centralize time printing and deal with ctime possibly returning NULL. To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/sbin/fsck/fsutil.c cvs rdiff -u -r1.14 -r1.15 src/sbin/fsck/fsutil.h cvs rdiff -u -r1.30 -r1.31 src/sbin/fsck_ext2fs/inode.c cvs rdiff -u -r1.20 -r1.21 src/sbin/fsck_ext2fs/pass1.c cvs rdiff -u -r1.62 -r1.63 src/sbin/fsck_ffs/inode.c cvs rdiff -u -r1.40 -r1.41 src/sbin/fsck_lfs/inode.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/fsck/fsutil.c diff -u src/sbin/fsck/fsutil.c:1.18 src/sbin/fsck/fsutil.c:1.19 --- src/sbin/fsck/fsutil.c:1.18 Sun Mar 16 19:17:55 2008 +++ src/sbin/fsck/fsutil.c Thu Feb 4 18:55:42 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: fsutil.c,v 1.18 2008/03/16 23:17:55 lukem Exp $ */ +/* $NetBSD: fsutil.c,v 1.19 2010/02/04 23:55:42 christos Exp $ */ /* * Copyright (c) 1990, 1993 @@ -31,7 +31,7 @@ #include #ifndef lint -__RCSID("$NetBSD: fsutil.c,v 1.18 2008/03/16 23:17:55 lukem Exp $"); +__RCSID("$NetBSD: fsutil.c,v 1.19 2010/02/04 23:55:42 christos Exp $"); #endif /* not lint */ #include @@ -244,3 +244,15 @@ */ return (origname); } + +const char * +print_mtime(time_t t) +{ + static char b[128]; + char *p = ctime(&t); + if (p != NULL) + (void)snprintf(b, sizeof(b), "%12.12s %4.4s ", &p[4], &p[20]); + else + (void)snprintf(b, sizeof(b), "%lld ", (long long)t); + return b; +} Index: src/sbin/fsck/fsutil.h diff -u src/sbin/fsck/fsutil.h:1.14 src/sbin/fsck/fsutil.h:1.15 --- src/sbin/fsck/fsutil.h:1.14 Tue Oct 20 21:07:46 2009 +++ src/sbin/fsck/fsutil.h Thu Feb 4 18:55:42 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: fsutil.h,v 1.14 2009/10/21 01:07:46 snj Exp $ */ +/* $NetBSD: fsutil.h,v 1.15 2010/02/04 23:55:42 christos Exp $ */ /* * Copyright (c) 1996 Christos Zoulas. All rights reserved. @@ -44,6 +44,7 @@ const char *cdevname(void); void setcdevname(const char *, int); int hotroot(void); +const char *print_mtime(time_t); #define CHECK_PREEN 1 #define CHECK_VERBOSE 2 Index: src/sbin/fsck_ext2fs/inode.c diff -u src/sbin/fsck_ext2fs/inode.c:1.30 src/sbin/fsck_ext2fs/inode.c:1.31 --- src/sbin/fsck_ext2fs/inode.c:1.30 Mon Oct 19 14:41:08 2009 +++ src/sbin/fsck_ext2fs/inode.c Thu Feb 4 18:55:42 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: inode.c,v 1.30 2009/10/19 18:41:08 bouyer Exp $ */ +/* $NetBSD: inode.c,v 1.31 2010/02/04 23:55:42 christos Exp $ */ /* * Copyright (c) 1980, 1986, 1993 @@ -58,7 +58,7 @@ #if 0 static char sccsid[] = "@(#)inode.c 8.5 (Berkeley) 2/8/95"; #else -__RCSID("$NetBSD: inode.c,v 1.30 2009/10/19 18:41:08 bouyer Exp $"); +__RCSID("$NetBSD: inode.c,v 1.31 2010/02/04 23:55:42 christos Exp $"); #endif #endif /* not lint */ @@ -612,9 +612,7 @@ pinode(ino_t ino) { struct ext2fs_dinode *dp; - char *p; struct passwd *pw; - time_t t; uid_t uid; printf(" I=%llu ", (unsigned long long)ino); @@ -635,9 +633,7 @@ if (preen) printf("%s: ", cdevname()); printf("SIZE=%llu ", (long long)inosize(dp)); - t = fs2h32(dp->e2di_mtime); - p = ctime(&t); - printf("MTIME=%12.12s %4.4s ", &p[4], &p[20]); + printf("MTIME=%s ", print_mtime(fs2h32(dp->e2di_mtime))); } void Index: src/sbin/fsck_ext2fs/pass1.c diff -u src/sbin/fsck_ext2fs/pass1.c:1.20 src/sbin/fsck_ext2fs/pass1.c:1.21 --- src/sbin/fsck_ext2fs/pass1.c:1.20 Mon Oct 19 14:41:08 2009 +++ src/sbin/fsck_ext2fs/pass1.c Thu Feb 4 18:55:42 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: pass1.c,v 1.20 2009/10/19 18:41:08 bouyer Exp $ */ +/* $NetBSD: pass1.c,v 1.21 2010/02/04 23:55:42 christos Exp $ */ /* * Copyright (c) 1980, 1986, 1993 @@ -58,7 +58,7 @@ #if 0 static char sccsid[] = "@(#)pass1.c 8.1 (Berkeley) 6/5/93"; #else -__RCSID("$NetBSD: pass1.c,v 1.20 2009/10/19 18:41:08 bouyer Exp $"); +__RCSID("$NetBSD: pass1.c,v 1.21 2010/02/04 23:55:42 christos Exp $"); #endif #endif /* not lint */ @@ -201,10 +201,9 @@ } lastino = inumber; if (dp->e2di_dtime != 0) { - time_t t = fs2h32(dp->e2di_dtime); - char *p = ctime(&t); - pwarn("INODE I=%llu HAS DTIME=%12.12s %4.4s", - (unsigned long long)inumber, &p[4], &p[20]); + pwarn("INODE I=%llu HAS DTIME=%s", + (unsigned long long)inumber, + print_mtime(fs2h32(dp->e2di_dtime))); if (preen) { printf(" (CORRECTED)\n"); } Index: src/sbin/fsck_ffs/inode.c diff -u src/sbin/fsck_ffs/inode.c:1.62 src/sbin/fsck_ffs/inode.c:1.63 --- src/sbin/fsck_ffs/inode.c:1.62 Sat Apr 11 03:32:42 2009 +++ src/sbin/fsck_ffs/inode.c Thu Feb 4 18:55:43 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: inode.c,v 1.62 2009/04/11 07:32:42 lukem Exp $ */ +/* $NetBSD: inode.c,v 1.63 2010/02/04 23:55:43 christos Exp $ */ /* * Copyright (c) 1980, 1986, 1993 @@ -3
CVS commit: src/sbin
Module Name:src Committed By: christos Date: Sun Aug 14 11:34:12 UTC 2011 Modified Files: src/sbin/mount_portal: Makefile src/sbin/routed: Makefile Log Message: document non-literal strings To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/sbin/mount_portal/Makefile cvs rdiff -u -r1.23 -r1.24 src/sbin/routed/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/mount_portal/Makefile diff -u src/sbin/mount_portal/Makefile:1.24 src/sbin/mount_portal/Makefile:1.25 --- src/sbin/mount_portal/Makefile:1.24 Sat Dec 5 15:11:02 2009 +++ src/sbin/mount_portal/Makefile Sun Aug 14 07:34:11 2011 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.24 2009/12/05 20:11:02 pooka Exp $ +# $NetBSD: Makefile,v 1.25 2011/08/14 11:34:11 christos Exp $ # @(#)Makefile 8.3 (Berkeley) 3/27/94 .include @@ -13,5 +13,7 @@ DPADD+=${LIBUTIL} ${LIBPUFFS} LDADD+=-lutil -lpuffs +COPTS.pt_filter.c = -Wno-format-nonliteral + .include .include Index: src/sbin/routed/Makefile diff -u src/sbin/routed/Makefile:1.23 src/sbin/routed/Makefile:1.24 --- src/sbin/routed/Makefile:1.23 Mon May 28 08:06:23 2007 +++ src/sbin/routed/Makefile Sun Aug 14 07:34:11 2011 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.23 2007/05/28 12:06:23 tls Exp $ +# $NetBSD: Makefile,v 1.24 2011/08/14 11:34:11 christos Exp $ # from: @(#)Makefile 8.1 (Berkeley) 6/19/93 USE_FORT?= yes # network client/server @@ -14,5 +14,7 @@ MLINKS= routed.8 rdisc.8 #COPTS+=-g -DDEBUG -Wall +COPTS.trace.c = -Wno-format-nonliteral + .include .include
CVS commit: src/sbin
Module Name:src Committed By: joerg Date: Mon Aug 29 14:35:04 UTC 2011 Modified Files: src/sbin/bioctl: bioctl.c src/sbin/cgdconfig: cgdconfig.c src/sbin/chown: chown.c src/sbin/disklabel: main.c src/sbin/dmesg: dmesg.c src/sbin/drvctl: drvctl.c src/sbin/dump: dumprmt.c src/sbin/fsck_ffs: main.c src/sbin/fsdb: fsdb.c src/sbin/ifconfig: ifconfig.c media.c src/sbin/mount: mount.c src/sbin/mount_ados: mount_ados.c src/sbin/mount_cd9660: mount_cd9660.c src/sbin/mount_efs: mount_efs.c src/sbin/mount_ext2fs: mount_ext2fs.c src/sbin/mount_fdesc: mount_fdesc.c src/sbin/mount_ffs: mount_ffs.c src/sbin/mount_filecore: mount_filecore.c src/sbin/mount_hfs: mount_hfs.c src/sbin/mount_kernfs: mount_kernfs.c src/sbin/mount_lfs: mount_lfs.c src/sbin/mount_nfs: mount_nfs.c src/sbin/mount_null: mount_null.c src/sbin/mount_overlay: mount_overlay.c src/sbin/mount_portal: puffs_portal.c src/sbin/mount_procfs: mount_procfs.c src/sbin/mount_ptyfs: mount_ptyfs.c src/sbin/mount_puffs: mount_puffs.c src/sbin/mount_sysvbfs: mount_sysvbfs.c src/sbin/mount_umap: mount_umap.c src/sbin/mount_union: mount_union.c src/sbin/newfs_msdos: newfs_msdos.c src/sbin/newfs_sysvbfs: newfs_sysvbfs.c src/sbin/raidctl: raidctl.c src/sbin/restore: main.c tape.c src/sbin/route: route.c src/sbin/routed: defs.h src/sbin/routed/rtquery: rtquery.c src/sbin/scsictl: scsictl.c src/sbin/sysctl: sysctl.c src/sbin/tunefs: tunefs.c src/sbin/veriexecctl: veriexecctl.c Log Message: Use __dead To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/sbin/bioctl/bioctl.c cvs rdiff -u -r1.32 -r1.33 src/sbin/cgdconfig/cgdconfig.c cvs rdiff -u -r1.4 -r1.5 src/sbin/chown/chown.c cvs rdiff -u -r1.24 -r1.25 src/sbin/disklabel/main.c cvs rdiff -u -r1.26 -r1.27 src/sbin/dmesg/dmesg.c cvs rdiff -u -r1.12 -r1.13 src/sbin/drvctl/drvctl.c cvs rdiff -u -r1.33 -r1.34 src/sbin/dump/dumprmt.c cvs rdiff -u -r1.79 -r1.80 src/sbin/fsck_ffs/main.c cvs rdiff -u -r1.42 -r1.43 src/sbin/fsdb/fsdb.c cvs rdiff -u -r1.225 -r1.226 src/sbin/ifconfig/ifconfig.c cvs rdiff -u -r1.5 -r1.6 src/sbin/ifconfig/media.c cvs rdiff -u -r1.92 -r1.93 src/sbin/mount/mount.c cvs rdiff -u -r1.28 -r1.29 src/sbin/mount_ados/mount_ados.c cvs rdiff -u -r1.31 -r1.32 src/sbin/mount_cd9660/mount_cd9660.c cvs rdiff -u -r1.4 -r1.5 src/sbin/mount_efs/mount_efs.c cvs rdiff -u -r1.21 -r1.22 src/sbin/mount_ext2fs/mount_ext2fs.c cvs rdiff -u -r1.25 -r1.26 src/sbin/mount_fdesc/mount_fdesc.c cvs rdiff -u -r1.26 -r1.27 src/sbin/mount_ffs/mount_ffs.c cvs rdiff -u -r1.19 -r1.20 src/sbin/mount_filecore/mount_filecore.c cvs rdiff -u -r1.8 -r1.9 src/sbin/mount_hfs/mount_hfs.c cvs rdiff -u -r1.24 -r1.25 src/sbin/mount_kernfs/mount_kernfs.c cvs rdiff -u -r1.33 -r1.34 src/sbin/mount_lfs/mount_lfs.c cvs rdiff -u -r1.68 -r1.69 src/sbin/mount_nfs/mount_nfs.c cvs rdiff -u -r1.18 -r1.19 src/sbin/mount_null/mount_null.c cvs rdiff -u -r1.12 -r1.13 src/sbin/mount_overlay/mount_overlay.c cvs rdiff -u -r1.3 -r1.4 src/sbin/mount_portal/puffs_portal.c cvs rdiff -u -r1.23 -r1.24 src/sbin/mount_procfs/mount_procfs.c cvs rdiff -u -r1.11 -r1.12 src/sbin/mount_ptyfs/mount_ptyfs.c cvs rdiff -u -r1.3 -r1.4 src/sbin/mount_puffs/mount_puffs.c cvs rdiff -u -r1.7 -r1.8 src/sbin/mount_sysvbfs/mount_sysvbfs.c cvs rdiff -u -r1.22 -r1.23 src/sbin/mount_umap/mount_umap.c cvs rdiff -u -r1.21 -r1.22 src/sbin/mount_union/mount_union.c cvs rdiff -u -r1.35 -r1.36 src/sbin/newfs_msdos/newfs_msdos.c cvs rdiff -u -r1.7 -r1.8 src/sbin/newfs_sysvbfs/newfs_sysvbfs.c cvs rdiff -u -r1.52 -r1.53 src/sbin/raidctl/raidctl.c cvs rdiff -u -r1.33 -r1.34 src/sbin/restore/main.c cvs rdiff -u -r1.65 -r1.66 src/sbin/restore/tape.c cvs rdiff -u -r1.131 -r1.132 src/sbin/route/route.c cvs rdiff -u -r1.25 -r1.26 src/sbin/routed/defs.h cvs rdiff -u -r1.22 -r1.23 src/sbin/routed/rtquery/rtquery.c cvs rdiff -u -r1.32 -r1.33 src/sbin/scsictl/scsictl.c cvs rdiff -u -r1.137 -r1.138 src/sbin/sysctl/sysctl.c cvs rdiff -u -r1.43 -r1.44 src/sbin/tunefs/tunefs.c cvs rdiff -u -r1.34 -r1.35 src/sbin/veriexecctl/veriexecctl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/bioctl/bioctl.c diff -u src/sbin/bioctl/bioctl.c:1.14 src/sbin/bioctl/bioctl.c:1.15 --- src/sbin/bioctl/bioctl.c:1.14 Wed May 25 15:34:19 2011 +++ src/sbin/bioctl/bioctl.c Mon Aug 29 14:34:58 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: bioctl.c,v 1.14 2011/05/25 15:34:19 joerg Exp $ */ +/* $NetBSD: bioctl.c,v 1.15 2011/08/29 14:34:58 joerg Exp $ */ /* $OpenBSD: bioctl.c,v 1.52 2007/03/20 15:26:06 jmc Exp $ */ /* @@ -31,7 +31,7 @@ #include #ifndef lint -__RCSID("$NetBSD: bioctl.c,v 1
CVS commit: src/sbin
Module Name:src Committed By: pooka Date: Mon Dec 13 20:48:45 UTC 2010 Modified Files: src/sbin/modload: Makefile main.c src/sbin/modstat: Makefile main.c src/sbin/modunload: Makefile main.c Added Files: src/sbin/modload: modload_hostops.c modload_rumpops.c prog_ops.h src/sbin/modstat: modstat_hostops.c modstat_rumpops.c prog_ops.h src/sbin/modunload: modunload_hostops.c modunload_rumpops.c prog_ops.h Log Message: Add rump client support for module utilities. It should be noted that while modstat and modunload and builtin modules work exactly the same as in the host case, modload loads file system kernel modules from the rump kernel namespace. By default, archs which have rump support for the kernel kernel ABI have the host module directory mapped into the rump kernel namespace at the same location (/stand/...). Therefore, if the *host* module directory is populated, "rump.modload foo" will work as expected. Otherwise, RUMP_MODULEBASE can be used to point to the module directory. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/sbin/modload/Makefile cvs rdiff -u -r1.13 -r1.14 src/sbin/modload/main.c cvs rdiff -u -r0 -r1.1 src/sbin/modload/modload_hostops.c \ src/sbin/modload/modload_rumpops.c src/sbin/modload/prog_ops.h cvs rdiff -u -r1.1 -r1.2 src/sbin/modstat/Makefile cvs rdiff -u -r1.10 -r1.11 src/sbin/modstat/main.c cvs rdiff -u -r0 -r1.1 src/sbin/modstat/modstat_hostops.c \ src/sbin/modstat/modstat_rumpops.c src/sbin/modstat/prog_ops.h cvs rdiff -u -r1.13 -r1.14 src/sbin/modunload/Makefile cvs rdiff -u -r1.3 -r1.4 src/sbin/modunload/main.c cvs rdiff -u -r0 -r1.1 src/sbin/modunload/modunload_hostops.c \ src/sbin/modunload/modunload_rumpops.c src/sbin/modunload/prog_ops.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/modload/Makefile diff -u src/sbin/modload/Makefile:1.14 src/sbin/modload/Makefile:1.15 --- src/sbin/modload/Makefile:1.14 Wed Nov 12 12:35:53 2008 +++ src/sbin/modload/Makefile Mon Dec 13 20:48:44 2010 @@ -1,8 +1,8 @@ -# $NetBSD: Makefile,v 1.14 2008/11/12 12:35:53 ad Exp $ +# $NetBSD: Makefile,v 1.15 2010/12/13 20:48:44 pooka Exp $ .include -PROG= modload +RUMPPRG=modload SRCS= main.c MAN= modload.8 LDADD= -lprop Index: src/sbin/modload/main.c diff -u src/sbin/modload/main.c:1.13 src/sbin/modload/main.c:1.14 --- src/sbin/modload/main.c:1.13 Thu Jun 11 08:12:00 2009 +++ src/sbin/modload/main.c Mon Dec 13 20:48:44 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.13 2009/06/11 08:12:00 wiz Exp $ */ +/* $NetBSD: main.c,v 1.14 2010/12/13 20:48:44 pooka Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -28,7 +28,7 @@ #include #ifndef lint -__RCSID("$NetBSD: main.c,v 1.13 2009/06/11 08:12:00 wiz Exp $"); +__RCSID("$NetBSD: main.c,v 1.14 2010/12/13 20:48:44 pooka Exp $"); #endif /* !lint */ #include @@ -44,6 +44,8 @@ #include +#include "prog_ops.h" + int main(int, char **); static void parse_bool_param(prop_dictionary_t, const char *, const char *); @@ -160,12 +162,14 @@ } else { if (argc != 1) usage(); + if (prog_init && prog_init() == -1) + err(1, "prog init failed"); cmdargs.ml_filename = argv[0]; cmdargs.ml_flags = flags; cmdargs.ml_props = propsstr; cmdargs.ml_propslen = strlen(propsstr); - if (modctl(MODCTL_LOAD, &cmdargs)) { + if (prog_modctl(MODCTL_LOAD, &cmdargs)) { err(EXIT_FAILURE, NULL); } } Index: src/sbin/modstat/Makefile diff -u src/sbin/modstat/Makefile:1.1 src/sbin/modstat/Makefile:1.2 --- src/sbin/modstat/Makefile:1.1 Wed Jan 16 12:34:57 2008 +++ src/sbin/modstat/Makefile Mon Dec 13 20:48:45 2010 @@ -1,6 +1,6 @@ -# $NetBSD: Makefile,v 1.1 2008/01/16 12:34:57 ad Exp $ +# $NetBSD: Makefile,v 1.2 2010/12/13 20:48:45 pooka Exp $ -PROG= modstat +RUMPPRG=modstat SRCS= main.c MAN= modstat.8 Index: src/sbin/modstat/main.c diff -u src/sbin/modstat/main.c:1.10 src/sbin/modstat/main.c:1.11 --- src/sbin/modstat/main.c:1.10 Fri Mar 19 16:25:33 2010 +++ src/sbin/modstat/main.c Mon Dec 13 20:48:45 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.10 2010/03/19 16:25:33 pooka Exp $ */ +/* $NetBSD: main.c,v 1.11 2010/12/13 20:48:45 pooka Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -28,7 +28,7 @@ #include #ifndef lint -__RCSID("$NetBSD: main.c,v 1.10 2010/03/19 16:25:33 pooka Exp $"); +__RCSID("$NetBSD: main.c,v 1.11 2010/12/13 20:48:45 pooka Exp $"); #endif /* !lint */ #include @@ -39,6 +39,8 @@ #include #include +#include "prog_ops.h" + int main(int, char **); static void usage(void) __dead; static int modstatcmp(const void *, const void *); @@ -88,10 +90,13 @@ if (argc != 0) usage(); + if (prog_init && prog_init() == -1) + err(1, "prog init failed"); + for (len = 8192;;) { iov.iov_base = malloc(len); iov.iov_len = len; - if (modctl(MODCTL_STAT, &i
CVS commit: src/sbin
Module Name:src Committed By: pooka Date: Mon Dec 13 21:48:01 UTC 2010 Modified Files: src/sbin/ifconfig: prog_ops.h src/sbin/modload: prog_ops.h src/sbin/modstat: prog_ops.h src/sbin/modunload: prog_ops.h src/sbin/sysctl: prog_ops.h Log Message: use crunchops for crunchables To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sbin/ifconfig/prog_ops.h cvs rdiff -u -r1.1 -r1.2 src/sbin/modload/prog_ops.h cvs rdiff -u -r1.1 -r1.2 src/sbin/modstat/prog_ops.h cvs rdiff -u -r1.1 -r1.2 src/sbin/modunload/prog_ops.h cvs rdiff -u -r1.1 -r1.2 src/sbin/sysctl/prog_ops.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/ifconfig/prog_ops.h diff -u src/sbin/ifconfig/prog_ops.h:1.2 src/sbin/ifconfig/prog_ops.h:1.3 --- src/sbin/ifconfig/prog_ops.h:1.2 Mon Dec 13 19:17:20 2010 +++ src/sbin/ifconfig/prog_ops.h Mon Dec 13 21:48:01 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: prog_ops.h,v 1.2 2010/12/13 19:17:20 njoly Exp $ */ +/* $NetBSD: prog_ops.h,v 1.3 2010/12/13 21:48:01 pooka Exp $ */ /* * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #include /* ifconfig is compiled outside of src/sbin/ifconfig too */ -#ifdef RUMP_ACTION +#ifndef CRUNCHOPS struct prog_ops { int (*op_init)(void); Index: src/sbin/modload/prog_ops.h diff -u src/sbin/modload/prog_ops.h:1.1 src/sbin/modload/prog_ops.h:1.2 --- src/sbin/modload/prog_ops.h:1.1 Mon Dec 13 20:48:44 2010 +++ src/sbin/modload/prog_ops.h Mon Dec 13 21:48:01 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: prog_ops.h,v 1.1 2010/12/13 20:48:44 pooka Exp $ */ +/* $NetBSD: prog_ops.h,v 1.2 2010/12/13 21:48:01 pooka Exp $ */ /* * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -31,6 +31,7 @@ #include +#ifndef CRUNCHOPS struct prog_ops { int (*op_init)(void); @@ -40,5 +41,9 @@ #define prog_init prog_ops.op_init #define prog_modctl prog_ops.op_modctl +#else +#define prog_init ((int (*)(void))NULL) +#define prog_modctl modctl +#endif #endif /* _PROG_OPS_H_ */ Index: src/sbin/modstat/prog_ops.h diff -u src/sbin/modstat/prog_ops.h:1.1 src/sbin/modstat/prog_ops.h:1.2 --- src/sbin/modstat/prog_ops.h:1.1 Mon Dec 13 20:48:45 2010 +++ src/sbin/modstat/prog_ops.h Mon Dec 13 21:48:01 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: prog_ops.h,v 1.1 2010/12/13 20:48:45 pooka Exp $ */ +/* $NetBSD: prog_ops.h,v 1.2 2010/12/13 21:48:01 pooka Exp $ */ /* * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -31,6 +31,7 @@ #include +#ifndef CRUNCHOPS struct prog_ops { int (*op_init)(void); @@ -40,5 +41,9 @@ #define prog_init prog_ops.op_init #define prog_modctl prog_ops.op_modctl +#else +#define prog_init ((int (*)(void))NULL) +#define prog_modctl modctl +#endif #endif /* _PROG_OPS_H_ */ Index: src/sbin/modunload/prog_ops.h diff -u src/sbin/modunload/prog_ops.h:1.1 src/sbin/modunload/prog_ops.h:1.2 --- src/sbin/modunload/prog_ops.h:1.1 Mon Dec 13 20:48:45 2010 +++ src/sbin/modunload/prog_ops.h Mon Dec 13 21:48:01 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: prog_ops.h,v 1.1 2010/12/13 20:48:45 pooka Exp $ */ +/* $NetBSD: prog_ops.h,v 1.2 2010/12/13 21:48:01 pooka Exp $ */ /* * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -31,6 +31,7 @@ #include +#ifndef CRUNCHOPS struct prog_ops { int (*op_init)(void); @@ -40,5 +41,9 @@ #define prog_init prog_ops.op_init #define prog_modctl prog_ops.op_modctl +#else +#define prog_init ((int (*)(void))NULL) +#define prog_modctl modctl +#endif #endif /* _PROG_OPS_H_ */ Index: src/sbin/sysctl/prog_ops.h diff -u src/sbin/sysctl/prog_ops.h:1.1 src/sbin/sysctl/prog_ops.h:1.2 --- src/sbin/sysctl/prog_ops.h:1.1 Mon Dec 13 17:47:40 2010 +++ src/sbin/sysctl/prog_ops.h Mon Dec 13 21:48:01 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: prog_ops.h,v 1.1 2010/12/13 17:47:40 pooka Exp $ */ +/* $NetBSD: prog_ops.h,v 1.2 2010/12/13 21:48:01 pooka Exp $ */ /* * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -31,6 +31,7 @@ #include +#ifndef CRUNCHOPS struct prog_ops { int (*op_init)(void); @@ -41,5 +42,9 @@ #define prog_init prog_ops.op_init #define prog_sysctl prog_ops.op_sysctl +#else +#define prog_init ((int (*)(void))NULL) +#define prog_sysctl sysctl +#endif #endif /* _PROG_OPS_H_ */
CVS commit: src/sbin
Module Name:src Committed By: justin Date: Sat Apr 5 12:32:27 UTC 2014 Modified Files: src/sbin/fsck_ffs: inode.c src/sbin/newfs: mkfs.c Log Message: Iterate over fields of struct seperately to avoid warnings from pedantic compilers To generate a diff of this commit: cvs rdiff -u -r1.70 -r1.71 src/sbin/fsck_ffs/inode.c cvs rdiff -u -r1.120 -r1.121 src/sbin/newfs/mkfs.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/fsck_ffs/inode.c diff -u src/sbin/fsck_ffs/inode.c:1.70 src/sbin/fsck_ffs/inode.c:1.71 --- src/sbin/fsck_ffs/inode.c:1.70 Mon Dec 2 18:46:52 2013 +++ src/sbin/fsck_ffs/inode.c Sat Apr 5 12:32:27 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: inode.c,v 1.70 2013/12/02 18:46:52 bouyer Exp $ */ +/* $NetBSD: inode.c,v 1.71 2014/04/05 12:32:27 justin Exp $ */ /* * Copyright (c) 1980, 1986, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)inode.c 8.8 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: inode.c,v 1.70 2013/12/02 18:46:52 bouyer Exp $"); +__RCSID("$NetBSD: inode.c,v 1.71 2014/04/05 12:32:27 justin Exp $"); #endif #endif /* not lint */ @@ -358,8 +358,10 @@ swap_dinode1(union dinode *dp, int n) doinglevel2 || (maxsymlinklen < 0) || (iswap64(dp1->di_size) > (uint64_t)maxsymlinklen)) { - for (j = 0; j < (UFS_NDADDR + UFS_NIADDR); j++) + for (j = 0; j < UFS_NDADDR; j++) dp1->di_db[j] = bswap32(dp1->di_db[j]); + for (j = 0; j < UFS_NIADDR; j++) + dp1->di_ib[j] = bswap32(dp1->di_ib[j]); } } } @@ -374,8 +376,12 @@ swap_dinode2(union dinode *dp, int n) for (i = 0; i < n; i++, dp2++) { ffs_dinode2_swap(dp2, dp2); if ((iswap16(dp2->di_mode) & IFMT) != IFLNK) { - for (j = 0; j < (UFS_NDADDR + UFS_NIADDR + UFS_NXADDR); j++) + for (j = 0; j < UFS_NXADDR; j++) dp2->di_extb[j] = bswap64(dp2->di_extb[j]); + for (j = 0; j < UFS_NDADDR; j++) +dp2->di_db[j] = bswap64(dp2->di_db[j]); + for (j = 0; j < UFS_NIADDR; j++) +dp2->di_ib[j] = bswap64(dp2->di_ib[j]); } } } Index: src/sbin/newfs/mkfs.c diff -u src/sbin/newfs/mkfs.c:1.120 src/sbin/newfs/mkfs.c:1.121 --- src/sbin/newfs/mkfs.c:1.120 Sun Jun 23 22:03:34 2013 +++ src/sbin/newfs/mkfs.c Sat Apr 5 12:32:27 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: mkfs.c,v 1.120 2013/06/23 22:03:34 dholland Exp $ */ +/* $NetBSD: mkfs.c,v 1.121 2014/04/05 12:32:27 justin Exp $ */ /* * Copyright (c) 1980, 1989, 1993 @@ -73,7 +73,7 @@ #if 0 static char sccsid[] = "@(#)mkfs.c 8.11 (Berkeley) 5/3/95"; #else -__RCSID("$NetBSD: mkfs.c,v 1.120 2013/06/23 22:03:34 dholland Exp $"); +__RCSID("$NetBSD: mkfs.c,v 1.121 2014/04/05 12:32:27 justin Exp $"); #endif #endif /* not lint */ @@ -1372,8 +1372,10 @@ iput(union dinode *ip, ino_t ino) if (needswap) { ffs_dinode1_swap(&ip->dp1, dp1); /* ffs_dinode1_swap() doesn't swap blocks addrs */ - for (i=0; idi_db[i] = bswap32(ip->dp1.di_db[i]); + for (i=0; idi_ib[i] = bswap32(ip->dp1.di_ib[i]); } else *dp1 = ip->dp1; dp1->di_gen = arc4random() & INT32_MAX; @@ -1382,8 +1384,10 @@ iput(union dinode *ip, ino_t ino) dp2 += ino_to_fsbo(&sblock, ino); if (needswap) { ffs_dinode2_swap(&ip->dp2, dp2); - for (i=0; idi_db[i] = bswap64(ip->dp2.di_db[i]); + for (i=0; idi_ib[i] = bswap64(ip->dp2.di_ib[i]); } else *dp2 = ip->dp2; dp2->di_gen = arc4random() & INT32_MAX;
CVS commit: src/sbin
Module Name:src Committed By: christos Date: Tue Jun 16 23:18:55 UTC 2015 Modified Files: src/sbin/cgdconfig: params.c src/sbin/dmctl: dmctl.c src/sbin/fdisk: fdisk.c src/sbin/fsck_ffs: main.c src/sbin/fsck_lfs: inode.c main.c pass2.c pass4.c segwrite.c utilities.c src/sbin/fsck_msdos: main.c src/sbin/gpt: restore.c src/sbin/init: init.c src/sbin/newfs: mkfs.c src/sbin/newfs_ext2fs: mke2fs.c src/sbin/newfs_udf: udf_create.c src/sbin/newfs_v7fs: newfs_v7fs.c src/sbin/veriexecctl: veriexecctl.c Log Message: fix error messages containing \n To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/sbin/cgdconfig/params.c cvs rdiff -u -r1.4 -r1.5 src/sbin/dmctl/dmctl.c cvs rdiff -u -r1.150 -r1.151 src/sbin/fdisk/fdisk.c cvs rdiff -u -r1.81 -r1.82 src/sbin/fsck_ffs/main.c cvs rdiff -u -r1.53 -r1.54 src/sbin/fsck_lfs/inode.c cvs rdiff -u -r1.48 -r1.49 src/sbin/fsck_lfs/main.c cvs rdiff -u -r1.23 -r1.24 src/sbin/fsck_lfs/pass2.c cvs rdiff -u -r1.22 -r1.23 src/sbin/fsck_lfs/pass4.c cvs rdiff -u -r1.29 -r1.30 src/sbin/fsck_lfs/segwrite.c cvs rdiff -u -r1.35 -r1.36 src/sbin/fsck_lfs/utilities.c cvs rdiff -u -r1.23 -r1.24 src/sbin/fsck_msdos/main.c cvs rdiff -u -r1.7 -r1.8 src/sbin/gpt/restore.c cvs rdiff -u -r1.105 -r1.106 src/sbin/init/init.c cvs rdiff -u -r1.124 -r1.125 src/sbin/newfs/mkfs.c cvs rdiff -u -r1.21 -r1.22 src/sbin/newfs_ext2fs/mke2fs.c cvs rdiff -u -r1.24 -r1.25 src/sbin/newfs_udf/udf_create.c cvs rdiff -u -r1.3 -r1.4 src/sbin/newfs_v7fs/newfs_v7fs.c cvs rdiff -u -r1.38 -r1.39 src/sbin/veriexecctl/veriexecctl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/cgdconfig/params.c diff -u src/sbin/cgdconfig/params.c:1.25 src/sbin/cgdconfig/params.c:1.26 --- src/sbin/cgdconfig/params.c:1.25 Sun Dec 14 07:31:39 2014 +++ src/sbin/cgdconfig/params.c Tue Jun 16 19:18:54 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: params.c,v 1.25 2014/12/14 12:31:39 mlelstv Exp $ */ +/* $NetBSD: params.c,v 1.26 2015/06/16 23:18:54 christos Exp $ */ /*- * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include #ifndef lint -__RCSID("$NetBSD: params.c,v 1.25 2014/12/14 12:31:39 mlelstv Exp $"); +__RCSID("$NetBSD: params.c,v 1.26 2015/06/16 23:18:54 christos Exp $"); #endif #include @@ -277,7 +277,7 @@ params_verify_method(string_t *in) if (p->verify_method == VERIFY_UNKNOWN) warnx("params_setverify_method: unrecognized " - "verify method \"%s\"\n", vm); + "verify method \"%s\"", vm); return p; } @@ -515,7 +515,7 @@ keygen_method(string_t *in) string_free(in); if (kg->kg_method == KEYGEN_UNKNOWN) - warnx("unrecognized key generation method \"%s\"\n", kgm); + warnx("unrecognized key generation method \"%s\"", kgm); return kg; } Index: src/sbin/dmctl/dmctl.c diff -u src/sbin/dmctl/dmctl.c:1.4 src/sbin/dmctl/dmctl.c:1.5 --- src/sbin/dmctl/dmctl.c:1.4 Fri Oct 18 21:09:58 2013 +++ src/sbin/dmctl/dmctl.c Tue Jun 16 19:18:54 2015 @@ -291,7 +291,7 @@ dmctl_get_device_info(int argc __unused, libdm_task_set_name(dvname, task); if (libdm_task_run(task) != 0) - err(EXIT_FAILURE, "dmctl_get_device_info: libdm_task_run failed.\n"); + err(EXIT_FAILURE, "%s: libdm_task_run failed", __func__); printf("Printing Device info for:\n"); printf("Device name: \t\t%s\n", libdm_task_get_name(task)); @@ -559,7 +559,7 @@ parse_stdin(char *file_path) if (file_path) { if ((fp = fopen(file_path, "r")) == NULL) - err(ENOENT, "Cannot open table file\n"); + err(ENOENT, "Cannot open table file"); } else fp = stdin; Index: src/sbin/fdisk/fdisk.c diff -u src/sbin/fdisk/fdisk.c:1.150 src/sbin/fdisk/fdisk.c:1.151 --- src/sbin/fdisk/fdisk.c:1.150 Fri Apr 4 12:15:30 2014 +++ src/sbin/fdisk/fdisk.c Tue Jun 16 19:18:54 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: fdisk.c,v 1.150 2014/04/04 16:15:30 christos Exp $ */ +/* $NetBSD: fdisk.c,v 1.151 2015/06/16 23:18:54 christos Exp $ */ /* * Mach Operating System @@ -39,7 +39,7 @@ #include #ifndef lint -__RCSID("$NetBSD: fdisk.c,v 1.150 2014/04/04 16:15:30 christos Exp $"); +__RCSID("$NetBSD: fdisk.c,v 1.151 2015/06/16 23:18:54 christos Exp $"); #endif /* not lint */ #define MBRPTYPENAMES @@ -2246,7 +2246,7 @@ change_part(int extended, int part, int errtext = check_overlap(part, sysid, start, size, 0); if (errtext != NULL && !I_flag) { if (f_flag) - errx(2, "%s\n", errtext); + errx(2, "%s", errtext); printf("%s\n", errtext); return 0; } @@ -2264,7 +2264,7 @@ change_part(int extended, int part, int else errtext = check_overlap(part, sysid, start, size, 1); if (errtext) - errx(1, "%s\n", errtext); + errx(1, "%s", errtext); } Index: src/sbin/fsck_ffs/main.c diff -u src/sbin/fsck_ffs/main.c:1.81 src/sbin/fsck_ffs/main.c:1.82 --- src/sbin/fsck_ffs/main.
CVS commit: src/sbin
Module Name:src Committed By: christos Date: Tue Jun 16 23:58:30 UTC 2015 Modified Files: src/sbin/fdisk: fdisk.c src/sbin/fsck_ffs: main.c src/sbin/fsck_lfs: pass2.c utilities.c Log Message: a few more \n's in errors To generate a diff of this commit: cvs rdiff -u -r1.151 -r1.152 src/sbin/fdisk/fdisk.c cvs rdiff -u -r1.82 -r1.83 src/sbin/fsck_ffs/main.c cvs rdiff -u -r1.24 -r1.25 src/sbin/fsck_lfs/pass2.c cvs rdiff -u -r1.36 -r1.37 src/sbin/fsck_lfs/utilities.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/fdisk/fdisk.c diff -u src/sbin/fdisk/fdisk.c:1.151 src/sbin/fdisk/fdisk.c:1.152 --- src/sbin/fdisk/fdisk.c:1.151 Tue Jun 16 19:18:54 2015 +++ src/sbin/fdisk/fdisk.c Tue Jun 16 19:58:30 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: fdisk.c,v 1.151 2015/06/16 23:18:54 christos Exp $ */ +/* $NetBSD: fdisk.c,v 1.152 2015/06/16 23:58:30 christos Exp $ */ /* * Mach Operating System @@ -39,7 +39,7 @@ #include #ifndef lint -__RCSID("$NetBSD: fdisk.c,v 1.151 2015/06/16 23:18:54 christos Exp $"); +__RCSID("$NetBSD: fdisk.c,v 1.152 2015/06/16 23:58:30 christos Exp $"); #endif /* not lint */ #define MBRPTYPENAMES @@ -1200,7 +1200,7 @@ get_extended_ptn(void) break; } - warnx("Extended partition table is corrupt\n"); + warnx("Extended partition table is corrupt"); ext.is_corrupt = 1; ext.num_ptn = 0; } Index: src/sbin/fsck_ffs/main.c diff -u src/sbin/fsck_ffs/main.c:1.82 src/sbin/fsck_ffs/main.c:1.83 --- src/sbin/fsck_ffs/main.c:1.82 Tue Jun 16 19:18:55 2015 +++ src/sbin/fsck_ffs/main.c Tue Jun 16 19:58:30 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.82 2015/06/16 23:18:55 christos Exp $ */ +/* $NetBSD: main.c,v 1.83 2015/06/16 23:58:30 christos Exp $ */ /* * Copyright (c) 1980, 1986, 1993 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19 #if 0 static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 5/14/95"; #else -__RCSID("$NetBSD: main.c,v 1.82 2015/06/16 23:18:55 christos Exp $"); +__RCSID("$NetBSD: main.c,v 1.83 2015/06/16 23:58:30 christos Exp $"); #endif #endif /* not lint */ @@ -123,7 +123,7 @@ main(int argc, char *argv[]) cvtlevel = argtoi('c', "conversion level", optarg, 10); if (cvtlevel > 4) { cvtlevel = 4; -warnx("Using maximum conversion level of %d\n", +warnx("Using maximum conversion level of %d", cvtlevel); } break; Index: src/sbin/fsck_lfs/pass2.c diff -u src/sbin/fsck_lfs/pass2.c:1.24 src/sbin/fsck_lfs/pass2.c:1.25 --- src/sbin/fsck_lfs/pass2.c:1.24 Tue Jun 16 19:18:55 2015 +++ src/sbin/fsck_lfs/pass2.c Tue Jun 16 19:58:30 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: pass2.c,v 1.24 2015/06/16 23:18:55 christos Exp $ */ +/* $NetBSD: pass2.c,v 1.25 2015/06/16 23:58:30 christos Exp $ */ /* * Copyright (c) 1980, 1986, 1993 @@ -74,7 +74,7 @@ pass2(void) if (reply("ALLOCATE") == 0) err(EEXIT, "%s", ""); if (allocdir(ULFS_ROOTINO, ULFS_ROOTINO, 0755) != ULFS_ROOTINO) - err(EEXIT, "CANNOT ALLOCATE ROOT INODE\n"); + err(EEXIT, "CANNOT ALLOCATE ROOT INODE"); break; case DCLEAR: Index: src/sbin/fsck_lfs/utilities.c diff -u src/sbin/fsck_lfs/utilities.c:1.36 src/sbin/fsck_lfs/utilities.c:1.37 --- src/sbin/fsck_lfs/utilities.c:1.36 Tue Jun 16 19:18:55 2015 +++ src/sbin/fsck_lfs/utilities.c Tue Jun 16 19:58:30 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: utilities.c,v 1.36 2015/06/16 23:18:55 christos Exp $ */ +/* $NetBSD: utilities.c,v 1.37 2015/06/16 23:58:30 christos Exp $ */ /* * Copyright (c) 1980, 1986, 1993 @@ -274,7 +274,7 @@ dofix(struct inodesc * idesc, const char return (0); default: - err(EEXIT, "UNKNOWN INODESC FIX MODE %d\n", idesc->id_fix); + err(EEXIT, "UNKNOWN INODESC FIX MODE %d", idesc->id_fix); } /* NOTREACHED */ }
CVS commit: src/sbin
Module Name:src Committed By: christos Date: Sat Mar 23 15:43:38 UTC 2013 Modified Files: src/sbin: Makefile Removed Files: src/sbin/pdisk: Makefile Log Message: pdisk has moved To generate a diff of this commit: cvs rdiff -u -r1.123 -r1.124 src/sbin/Makefile cvs rdiff -u -r1.5 -r0 src/sbin/pdisk/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/Makefile diff -u src/sbin/Makefile:1.123 src/sbin/Makefile:1.124 --- src/sbin/Makefile:1.123 Thu Nov 24 10:54:54 2011 +++ src/sbin/Makefile Sat Mar 23 11:43:37 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.123 2011/11/24 15:54:54 ahoka Exp $ +# $NetBSD: Makefile,v 1.124 2013/03/23 15:43:37 christos Exp $ # @(#)Makefile 8.5 (Berkeley) 3/31/94 # Not ported: XNSrouted enpload scsiformat startslip @@ -10,7 +10,7 @@ SUBDIR= amrctl apmlabel atactl badsect b chown devpubd disklabel dkctl dkscan_bsdlabel dmesg dmctl \ drvctl fastboot fdisk fsck fsirand gpt ifconfig init ldconfig \ mbrlabel mknod modload modstat modunload mount newbtconf nologin \ - pdisk ping pppoectl raidctl reboot rcorder rndctl route routed \ + ping pppoectl raidctl reboot rcorder rndctl route routed \ savecore scan_ffs scsictl shutdown slattach svhlabel swapctl sysctl \ ttyflags umount veriexecctl wdogctl wsconsctl
CVS commit: src/sbin
Module Name:src Committed By: wiz Date: Wed May 29 14:56:19 UTC 2013 Modified Files: src/sbin/mount_efs: mount_efs.8 src/sbin/mount_ext2fs: mount_ext2fs.8 Log Message: De-capitalize `.Nd' macro argument. >From Bug Hunting. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sbin/mount_efs/mount_efs.8 cvs rdiff -u -r1.15 -r1.16 src/sbin/mount_ext2fs/mount_ext2fs.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/mount_efs/mount_efs.8 diff -u src/sbin/mount_efs/mount_efs.8:1.3 src/sbin/mount_efs/mount_efs.8:1.4 --- src/sbin/mount_efs/mount_efs.8:1.3 Mon Jan 5 16:36:04 2009 +++ src/sbin/mount_efs/mount_efs.8 Wed May 29 14:56:19 2013 @@ -1,4 +1,4 @@ -.\" $NetBSD: mount_efs.8,v 1.3 2009/01/05 16:36:04 pooka Exp $ +.\" $NetBSD: mount_efs.8,v 1.4 2013/05/29 14:56:19 wiz Exp $ .\" .\" Copyright (c) 1993, 1994 .\" The Regents of the University of California. All rights reserved. @@ -33,7 +33,7 @@ .Os .Sh NAME .Nm mount_efs -.Nd Mount an SGI EFS file system +.Nd mount an SGI EFS file system .Sh SYNOPSIS .Nm .Op Fl o Ar options Index: src/sbin/mount_ext2fs/mount_ext2fs.8 diff -u src/sbin/mount_ext2fs/mount_ext2fs.8:1.15 src/sbin/mount_ext2fs/mount_ext2fs.8:1.16 --- src/sbin/mount_ext2fs/mount_ext2fs.8:1.15 Mon Feb 22 09:45:02 2010 +++ src/sbin/mount_ext2fs/mount_ext2fs.8 Wed May 29 14:56:19 2013 @@ -1,4 +1,4 @@ -.\" $NetBSD: mount_ext2fs.8,v 1.15 2010/02/22 09:45:02 tsutsui Exp $ +.\" $NetBSD: mount_ext2fs.8,v 1.16 2013/05/29 14:56:19 wiz Exp $ .\" .\" Copyright (c) 1993, 1994 .\" The Regents of the University of California. All rights reserved. @@ -33,7 +33,7 @@ .Os .Sh NAME .Nm mount_ext2fs -.Nd Mount an ext2 file system +.Nd mount an ext2 file system .Sh SYNOPSIS .Nm .Op Fl o Ar options
CVS commit: src/sbin/pppoectl
Module Name:src Committed By: yamaguchi Date: Wed Nov 25 10:32:54 UTC 2020 Modified Files: src/sbin/pppoectl: pppoectl.c Log Message: add -dd option for reference of the parameter about control protocols reviewed by knakahara@n.o. To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/sbin/pppoectl/pppoectl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/pppoectl/pppoectl.c diff -u src/sbin/pppoectl/pppoectl.c:1.25 src/sbin/pppoectl/pppoectl.c:1.26 --- src/sbin/pppoectl/pppoectl.c:1.25 Sat Jan 23 15:41:47 2016 +++ src/sbin/pppoectl/pppoectl.c Wed Nov 25 10:32:54 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: pppoectl.c,v 1.25 2016/01/23 15:41:47 christos Exp $ */ +/* $NetBSD: pppoectl.c,v 1.26 2020/11/25 10:32:54 yamaguchi Exp $ */ /* * Copyright (c) 1997 Joerg Wunsch @@ -31,7 +31,7 @@ #include #ifndef lint -__RCSID("$NetBSD: pppoectl.c,v 1.25 2016/01/23 15:41:47 christos Exp $"); +__RCSID("$NetBSD: pppoectl.c,v 1.26 2020/11/25 10:32:54 yamaguchi Exp $"); #endif @@ -44,6 +44,7 @@ __RCSID("$NetBSD: pppoectl.c,v 1.25 2016 #include #include #include +#include #include #include #include @@ -56,11 +57,26 @@ __dead static void print_error(const cha static void print_vals(const char *ifname, int phase, struct spppauthcfg *sp, int lcp_timeout, time_t idle_timeout, int authfailures, int max_auth_failures, u_int maxalive, time_t max_noreceive); +static void print_dns(const char *ifname, int dns1, int dns2, int s, int tabs); +static void print_stats(const char *ifname, int s, int dump); static const char *phase_name(int phase); static const char *proto_name(int proto); static const char *authflags(int flags); +static const char *pppoe_state_name(int state); +static const char *ppp_state_name(int state); static void pppoectl_argument(char *arg); +#define ISSET(x, a) ((x) & (a)) +#define PPPOECTL_IOCTL(_ifname, _s, _cmd, _st) do { \ + int __e; \ + memset((_st), 0, sizeof(*(_st))); \ + strncpy((_st)->ifname, (_ifname), \ + sizeof((_st)->ifname)); \ + __e = ioctl((_s), (_cmd), (_st)); \ + if (__e != 0) \ + print_error((_ifname), __e, #_cmd); \ +} while (0) + static int hz = 0; static int set_auth, set_lcp, set_idle_to, set_auth_failure, set_dns, @@ -174,60 +190,14 @@ main(int argc, char **argv) } if (dns1 || dns2) { - /* print DNS addresses */ - int e; - struct spppdnsaddrs addrs; - memset(&addrs, 0, sizeof addrs); - strncpy(addrs.ifname, ifname, sizeof addrs.ifname); - e = ioctl(s, SPPPGETDNSADDRS, &addrs); - if (e) - print_error(ifname, e, "SPPPGETDNSADDRS"); - if (dns1) - printf("%d.%d.%d.%d\n", -(addrs.dns[0] >> 24) & 0xff, -(addrs.dns[0] >> 16) & 0xff, -(addrs.dns[0] >> 8) & 0xff, -addrs.dns[0] & 0xff); - if (dns2) - printf("%d.%d.%d.%d\n", -(addrs.dns[1] >> 24) & 0xff, -(addrs.dns[1] >> 16) & 0xff, -(addrs.dns[1] >> 8) & 0xff, -addrs.dns[1] & 0xff); + print_dns(ifname, dns1, dns2, s, 0); } if (dump) { - /* dump PPPoE session state */ - struct pppoeconnectionstate state; - int e; - - memset(&state, 0, sizeof state); - strncpy(state.ifname, ifname, sizeof state.ifname); - e = ioctl(s, PPPOEGETSESSION, &state); - if (e) - print_error(ifname, e, "PPPOEGETSESSION"); - - printf("%s:\tstate = ", ifname); - switch(state.state) { - case PPPOE_STATE_INITIAL: - printf("initial\n"); break; - case PPPOE_STATE_PADI_SENT: - printf("PADI sent\n"); break; - case PPPOE_STATE_PADR_SENT: - printf("PADR sent\n"); break; - case PPPOE_STATE_SESSION: - printf("session\n"); break; - case PPPOE_STATE_CLOSING: - printf("closing\n"); break; - } - printf("\tSession ID: 0x%x\n", state.session_id); - printf("\tPADI retries: %d\n", state.padi_retry_no); - printf("\tPADR retries: %d\n", state.padr_retry_no); - + print_stats(ifname, s, dump); return 0; } - memset(&spr, 0, sizeof spr); strncpy(spr.ifname, ifname, sizeof spr.ifname); memset(&lcp, 0, sizeof lcp); @@ -570,6 +540,110 @@ print_vals(const char *ifname, int phase #endif } +static void +print_dns(const char *ifname, int dns1, int dns2, int s, int tabs) +{ + int i; + struct spppdnsaddrs addrs; + + if (!dns1 && !dns2) + return; + + PPPOECTL_IOCTL(ifname, s, SPPPGETDNSADDRS, &addrs); + if (dns1) { + for (i = 0; i < tabs; i++) + printf("\t"); + if (tabs > 0) + printf("primary dns address "); + printf("%d.%d.%d.%d\n", + (addrs.dns[0] >> 24) & 0xff, + (addrs.dns[0] >> 16) & 0xff, + (addrs.dns[0] >> 8) & 0xff, + addrs.dns[0] & 0xff); + } + if (dns2) { + for (i = 0; i < tabs; i++) + printf("\t"); + if (tabs > 0) + printf("secondary dns address "); + printf("%d.%d.%d.%d\n", + (addrs.dns[1] >> 24) & 0xff, + (addrs.dns[1] >> 16) & 0xff, + (addrs.dns[1] >> 8) & 0xff, + addrs.dns[1] & 0xff); + } +} + +static void +print_stats(co
CVS commit: src/sbin/tunefs
Module Name:src Committed By: dholland Date: Thu Nov 26 02:06:01 UTC 2020 Modified Files: src/sbin/tunefs: tunefs.c Log Message: Add missing newlines to ACL prints in tunefs; from Jan Schaumann in PR 55824. To generate a diff of this commit: cvs rdiff -u -r1.53 -r1.54 src/sbin/tunefs/tunefs.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/tunefs/tunefs.c diff -u src/sbin/tunefs/tunefs.c:1.53 src/sbin/tunefs/tunefs.c:1.54 --- src/sbin/tunefs/tunefs.c:1.53 Sat Aug 8 11:44:55 2020 +++ src/sbin/tunefs/tunefs.c Thu Nov 26 02:06:01 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: tunefs.c,v 1.53 2020/08/08 11:44:55 christos Exp $ */ +/* $NetBSD: tunefs.c,v 1.54 2020/11/26 02:06:01 dholland Exp $ */ /* * Copyright (c) 1983, 1993 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19 #if 0 static char sccsid[] = "@(#)tunefs.c 8.3 (Berkeley) 5/3/95"; #else -__RCSID("$NetBSD: tunefs.c,v 1.53 2020/08/08 11:44:55 christos Exp $"); +__RCSID("$NetBSD: tunefs.c,v 1.54 2020/11/26 02:06:01 dholland Exp $"); #endif #endif /* not lint */ @@ -391,7 +391,7 @@ main(int argc, char *argv[]) "exclusive", name); } else { sblock.fs_flags |= FS_POSIX1EACLS; -printf("%s set", name); +printf("%s set\n", name); } } else if (strcmp(pvalue, "disable") == 0) { if ((~sblock.fs_flags & FS_POSIX1EACLS) == @@ -400,7 +400,7 @@ main(int argc, char *argv[]) name); } else { sblock.fs_flags &= ~FS_POSIX1EACLS; -printf("%s cleared", name); +printf("%s cleared\n", name); } } }
CVS commit: src/sbin/mount_null
Module Name:src Committed By: pgoyette Date: Tue Dec 1 02:43:18 UTC 2020 Modified Files: src/sbin/mount_null: mount_null.8 Log Message: Be consistent with mark-up of vop_reclaim To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/sbin/mount_null/mount_null.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/mount_null/mount_null.8 diff -u src/sbin/mount_null/mount_null.8:1.21 src/sbin/mount_null/mount_null.8:1.22 --- src/sbin/mount_null/mount_null.8:1.21 Mon Jan 31 05:19:19 2005 +++ src/sbin/mount_null/mount_null.8 Tue Dec 1 02:43:18 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: mount_null.8,v 1.21 2005/01/31 05:19:19 erh Exp $ +.\" $NetBSD: mount_null.8,v 1.22 2020/12/01 02:43:18 pgoyette Exp $ .\" .\" Copyright (c) 1992, 1993, 1994 .\" The Regents of the University of California. All rights reserved. @@ -33,7 +33,7 @@ .\" @(#)mount_null.8 8.6 (Berkeley) 5/1/95 .\" .\" -.Dd May 1, 1995 +.Dd November 30, 2020 .Dt MOUNT_NULL 8 .Os .Sh NAME @@ -140,7 +140,9 @@ are not bypassed. .Em vop_getattr must change the fsid being returned. .Em vop_inactive -and vop_reclaim are not bypassed so that +and +.Em vop_reclaim +are not bypassed so that they can handle freeing null-layer specific data. .Em vop_print is not bypassed to avoid excessive debugging
CVS commit: src/sbin/dump
Module Name:src Committed By: kre Date: Thu Dec 3 08:25:57 UTC 2020 Modified Files: src/sbin/dump: dump.h main.c Log Message: PR bin/55834 count blocks written in unsigned 64 bit counter rather than signed int which overflows after 2^31-1 blocks (2TiB) after which neither the 5 minute status updates or SIGINFO (^T) reports are issued until the negative numbers increase past 0 and wildly inaccurate reports would be written. To generate a diff of this commit: cvs rdiff -u -r1.58 -r1.59 src/sbin/dump/dump.h cvs rdiff -u -r1.77 -r1.78 src/sbin/dump/main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/dump/dump.h diff -u src/sbin/dump/dump.h:1.58 src/sbin/dump/dump.h:1.59 --- src/sbin/dump/dump.h:1.58 Sun Apr 5 15:25:39 2020 +++ src/sbin/dump/dump.h Thu Dec 3 08:25:57 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: dump.h,v 1.58 2020/04/05 15:25:39 joerg Exp $ */ +/* $NetBSD: dump.h,v 1.59 2020/12/03 08:25:57 kre Exp $ */ /*- * Copyright (c) 1980, 1993 @@ -134,7 +134,7 @@ extern int unlimited; /* if set, write t extern int density; /* density in 0.1" units */ extern int notify; /* notify operator flag */ extern int timestamp; /* timestamp messages */ -extern int blockswritten; /* number of blocks written on current tape */ +extern u_int64_t blockswritten; /* blocks written on current tape */ extern int tapeno; /* current tape number */ extern int is_ufs2; Index: src/sbin/dump/main.c diff -u src/sbin/dump/main.c:1.77 src/sbin/dump/main.c:1.78 --- src/sbin/dump/main.c:1.77 Sun Apr 5 15:25:39 2020 +++ src/sbin/dump/main.c Thu Dec 3 08:25:57 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.77 2020/04/05 15:25:39 joerg Exp $ */ +/* $NetBSD: main.c,v 1.78 2020/12/03 08:25:57 kre Exp $ */ /*- * Copyright (c) 1980, 1991, 1993, 1994 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19 #if 0 static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 5/1/95"; #else -__RCSID("$NetBSD: main.c,v 1.77 2020/04/05 15:25:39 joerg Exp $"); +__RCSID("$NetBSD: main.c,v 1.78 2020/12/03 08:25:57 kre Exp $"); #endif #endif /* not lint */ @@ -108,7 +108,7 @@ int needswap; int timestamp; /* print message timestamps */ int notify; /* notify operator flag */ -int blockswritten; /* number of blocks written on current tape */ +u_int64_t blockswritten; /* number of blocks written on current tape */ int tapeno; /* current tape number */ int density; /* density in bytes/0.1" */ int ntrec = NTREC; /* # tape blocks in each tape record */
CVS commit: src/sbin/atactl
Module Name:src Committed By: mrg Date: Mon Dec 7 10:36:19 UTC 2020 Modified Files: src/sbin/atactl: atactl.c Log Message: micron SMART 202 is percent lifetime used not remaining. almost gave myself a heart attack when my server said 7% remaining! To generate a diff of this commit: cvs rdiff -u -r1.83 -r1.84 src/sbin/atactl/atactl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/atactl/atactl.c diff -u src/sbin/atactl/atactl.c:1.83 src/sbin/atactl/atactl.c:1.84 --- src/sbin/atactl/atactl.c:1.83 Thu May 30 21:32:08 2019 +++ src/sbin/atactl/atactl.c Mon Dec 7 10:36:19 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: atactl.c,v 1.83 2019/05/30 21:32:08 mlelstv Exp $ */ +/* $NetBSD: atactl.c,v 1.84 2020/12/07 10:36:19 mrg Exp $ */ /*- * Copyright (c) 1998, 2019 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ #include #ifndef lint -__RCSID("$NetBSD: atactl.c,v 1.83 2019/05/30 21:32:08 mlelstv Exp $"); +__RCSID("$NetBSD: atactl.c,v 1.84 2020/12/07 10:36:19 mrg Exp $"); #endif @@ -418,7 +418,7 @@ static const struct attr_table micron_sm { 189, "Factory bad block count", NULL }, { 197, "Current pending ECC count", NULL }, { 198, "SMART offline scan uncorrectable error count", NULL }, - { 202, "Percent lifetime remaining", NULL }, + { 202, "Percent lifetime used", NULL }, { 206, "Write error rate", NULL }, { 247, "Number of NAND pages of data written by the host", NULL }, { 248, "Number of NAND pages written by the FTL", NULL },
CVS commit: src/sbin/newfs_msdos
Module Name:src Committed By: ryoon Date: Fri Dec 11 18:49:38 UTC 2020 Modified Files: src/sbin/newfs_msdos: newfs_msdos.8 Log Message: Describe after example like other examples To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/sbin/newfs_msdos/newfs_msdos.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/newfs_msdos/newfs_msdos.8 diff -u src/sbin/newfs_msdos/newfs_msdos.8:1.23 src/sbin/newfs_msdos/newfs_msdos.8:1.24 --- src/sbin/newfs_msdos/newfs_msdos.8:1.23 Fri Feb 17 09:29:35 2017 +++ src/sbin/newfs_msdos/newfs_msdos.8 Fri Dec 11 18:49:37 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: newfs_msdos.8,v 1.23 2017/02/17 09:29:35 wiz Exp $ +.\" $NetBSD: newfs_msdos.8,v 1.24 2020/12/11 18:49:37 ryoon Exp $ .\" .\" Copyright (c) 1998 Robert Nordier .\" All rights reserved. @@ -228,11 +228,12 @@ Create a standard 1.44M file system, wit .Ar foo , on .Pa /dev/rfd0a . -Create a 30MB image file, with the FAT partition starting -63 sectors within the image file: .Bd -literal -offset indent newfs_msdos -C 30M -@63s ./somefile .Ed +.Pp +Create a 30MB image file, with the FAT partition starting +63 sectors within the image file: .Sh DIAGNOSTICS Exit status is 0 on success and 1 on error. .Sh SEE ALSO
CVS commit: src/sbin/cgdconfig
Module Name:src Committed By: riastradh Date: Fri Dec 11 21:52:19 UTC 2020 Modified Files: src/sbin/cgdconfig: cgdconfig.8 Log Message: Touch up cgdconfig(8) man page. - Suggest adiantum first. - Remove references to Blowfish. - Clarify that ivmethod is relevant only for ancient compatibility. To generate a diff of this commit: cvs rdiff -u -r1.47 -r1.48 src/sbin/cgdconfig/cgdconfig.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/cgdconfig/cgdconfig.8 diff -u src/sbin/cgdconfig/cgdconfig.8:1.47 src/sbin/cgdconfig/cgdconfig.8:1.48 --- src/sbin/cgdconfig/cgdconfig.8:1.47 Tue Jun 23 14:08:01 2020 +++ src/sbin/cgdconfig/cgdconfig.8 Fri Dec 11 21:52:19 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: cgdconfig.8,v 1.47 2020/06/23 14:08:01 wiz Exp $ +.\" $NetBSD: cgdconfig.8,v 1.48 2020/12/11 21:52:19 riastradh Exp $ .\" .\" Copyright (c) 2002, The NetBSD Foundation, Inc. .\" All rights reserved. @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd June 23, 2020 +.Dd December 11, 2020 .Dt CGDCONFIG 8 .Os .Sh NAME @@ -104,6 +104,15 @@ This may need to obtain multiple passphr Generate a paramsfile (to stdout). .It Fl i Ar ivmeth Specify the IV method (default: encblkno1). +.Pp +Setting the IV method is needed only for compatibility with disks +written with a very old version of +.Xr cgd 4 +from before +.Nx 5.0 , +released in 2010; see +.Xr cgd 4 +for details. .It Fl k Ar kgmeth Specify the key generation method (default: pkcs5_pbkdf2/sha1). .It Fl l Op Ar cgd @@ -144,8 +153,8 @@ Be verbose. May be specified multiple times. .El .Pp -For more information about the cryptographic algorithms and IV methods -supported, please refer to +For more information about the cryptographic algorithms supported, +please refer to .Xr cgd 4 . .Ss Key Generation Methods To generate the key which it will use, @@ -318,6 +327,15 @@ The following statements are defined: Defines the cryptographic algorithm. .It iv-method Ar string Defines the IV generation method. +This should always be +.Sq encblkno1 +except when dealing with disks written with a very old version of +.Xr cgd 4 +from before +.Nx 5.0 , +released in 2010; see +.Xr cgd 4 +for details. .It keylength Ar integer Defines the length of the key. .It verify_method Ar string @@ -352,12 +370,10 @@ configuration directory, used to store p cgd configuration file. .El .Sh EXAMPLES -To set up and configure a cgd that uses AES with a 192 bit key -in CBC mode with the IV Method -.Sq encblkno1 -(encrypted block number): +To set up and configure a cgd that uses adiantum, which takes a 256-bit +key: .Bd -literal - # cgdconfig -g -o /etc/cgd/wd0e aes-cbc 192 + # cgdconfig -g -o /etc/cgd/wd0e adiantum 256 # cgdconfig cgd0 /dev/wd0e /dev/wd0e's passphrase: .Ed @@ -370,7 +386,7 @@ when we configure the first time to set Here is the sequence of commands that is recommended: .Bd -literal - # cgdconfig -g -o /etc/cgd/wd0e -V disklabel aes-cbc + # cgdconfig -g -o /etc/cgd/wd0e -V disklabel adiantum # cgdconfig -V re-enter cgd0 /dev/wd0e /dev/wd0e's passphrase: re-enter device's passphrase: @@ -382,7 +398,7 @@ sequence of commands that is recommended .Pp To scrub data from a disk before setting up a cgd: .Bd -literal - # cgdconfig -s cgd0 /dev/sd0e aes-cbc 256 < /dev/urandom + # cgdconfig -s cgd0 /dev/sd0e adiantum 256 < /dev/urandom # dd if=/dev/zero of=/dev/rcgd0d bs=32k progress=512 # cgdconfig -u cgd0 .Ed @@ -395,10 +411,10 @@ parameters file: new file's passphrase: .Ed .Pp -To configure a cgd that uses Blowfish with a 200 bit key that it +To configure a cgd that uses aes-cbc with a 192 bit key that it reads from stdin: .Bd -literal - # cgdconfig -s cgd0 /dev/sd0h blowfish-cbc 200 + # cgdconfig -s cgd0 /dev/sd0h aes-cbc 192 .Ed .Pp An example parameters file which uses PKCS#5 PBKDF2: @@ -416,7 +432,7 @@ An example parameters file which uses PK .Pp An example parameters file which stores its key locally: .Bd -literal - algorithm aes-cbc; + algorithm adiantum; iv-method encblkno1; keylength 256; verify_method none;
CVS commit: src/sbin/gpt
Module Name:src Committed By: jnemeth Date: Sun Dec 13 21:55:25 UTC 2020 Modified Files: src/sbin/gpt: recover.c Log Message: PR/55875 - Valentin -- "gpt recover -r" does nothing Delete do nothing undocumented option, that was there from initial import. No idea what it was intended to do and there is no longer an "upstream". To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/sbin/gpt/recover.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/gpt/recover.c diff -u src/sbin/gpt/recover.c:1.18 src/sbin/gpt/recover.c:1.19 --- src/sbin/gpt/recover.c:1.18 Tue Jul 3 03:41:24 2018 +++ src/sbin/gpt/recover.c Sun Dec 13 21:55:25 2020 @@ -33,7 +33,7 @@ __FBSDID("$FreeBSD: src/sbin/gpt/recover.c,v 1.8 2005/08/31 01:47:19 marcel Exp $"); #endif #ifdef __RCSID -__RCSID("$NetBSD: recover.c,v 1.18 2018/07/03 03:41:24 jnemeth Exp $"); +__RCSID("$NetBSD: recover.c,v 1.19 2020/12/13 21:55:25 jnemeth Exp $"); #endif #include @@ -149,7 +149,7 @@ recover_gpt_tbl(gpt_t gpt, int type, off } static int -recover(gpt_t gpt, int recoverable) +recover(gpt_t gpt) { off_t last = gpt_last(gpt); map_t map; @@ -233,13 +233,9 @@ static int cmd_recover(gpt_t gpt, int argc, char *argv[]) { int ch; - int recoverable = 0; while ((ch = getopt(argc, argv, "r")) != -1) { switch(ch) { - case 'r': - recoverable = 1; - break; default: return usage(); } @@ -248,5 +244,5 @@ cmd_recover(gpt_t gpt, int argc, char *a if (argc != optind) return usage(); - return recover(gpt, recoverable); + return recover(gpt); }
CVS commit: src/sbin/atactl
Module Name:src Committed By: jmcneill Date: Sun Dec 20 10:19:30 UTC 2020 Modified Files: src/sbin/atactl: atactl.c Log Message: Managment -> Management To generate a diff of this commit: cvs rdiff -u -r1.84 -r1.85 src/sbin/atactl/atactl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/atactl/atactl.c diff -u src/sbin/atactl/atactl.c:1.84 src/sbin/atactl/atactl.c:1.85 --- src/sbin/atactl/atactl.c:1.84 Mon Dec 7 10:36:19 2020 +++ src/sbin/atactl/atactl.c Sun Dec 20 10:19:30 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: atactl.c,v 1.84 2020/12/07 10:36:19 mrg Exp $ */ +/* $NetBSD: atactl.c,v 1.85 2020/12/20 10:19:30 jmcneill Exp $ */ /*- * Copyright (c) 1998, 2019 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ #include #ifndef lint -__RCSID("$NetBSD: atactl.c,v 1.84 2020/12/07 10:36:19 mrg Exp $"); +__RCSID("$NetBSD: atactl.c,v 1.85 2020/12/20 10:19:30 jmcneill Exp $"); #endif @@ -306,7 +306,7 @@ static const struct bitinfo ata_sata_cap static const struct bitinfo ata_sata_feat[] = { { SATA_NONZERO_OFFSETS, "Non-zero Offset DMA" }, { SATA_DMA_SETUP_AUTO, "DMA Setup Auto Activate" }, - { SATA_DRIVE_PWR_MGMT, "Device-Initiated Interface Power Managment" }, + { SATA_DRIVE_PWR_MGMT, "Device-Initiated Interface Power Management" }, { SATA_IN_ORDER_DATA, "In-order Data Delivery" }, { SATA_SW_STTNGS_PRS, "Software Settings Preservation" }, { 0, NULL },
CVS commit: src/sbin/route
Module Name:src Committed By: uwe Date: Sat Jan 2 19:50:42 UTC 2021 Modified Files: src/sbin/route: route.8 Log Message: route(8): don't split -blackhole and -noblackhole. To generate a diff of this commit: cvs rdiff -u -r1.62 -r1.63 src/sbin/route/route.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/route/route.8 diff -u src/sbin/route/route.8:1.62 src/sbin/route/route.8:1.63 --- src/sbin/route/route.8:1.62 Sat Aug 29 19:27:08 2020 +++ src/sbin/route/route.8 Sat Jan 2 19:50:42 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: route.8,v 1.62 2020/08/29 19:27:08 christos Exp $ +.\" $NetBSD: route.8,v 1.63 2021/01/02 19:50:42 uwe Exp $ .\" .\" Copyright (c) 1983, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -299,8 +299,8 @@ by indicating the following correspondin .It Li 1 Ta -proto1 Ta " RTF_PROTO1" Ta set protocol specific flag #1 .It Li 2 Ta -proto2 Ta " RTF_PROTO2" Ta set protocol specific flag #2 .It Li B Ta -blackhole Ta " RTF_BLACKHOLE" Ta discard pkts (during updates) -.It Li b Ta "" Ta " RTF_BROADCAST" Ta Route represents a broadcast address .It Li " " Ta -noblackhole Ta ~RTF_BLACKHOLE Ta clear blackhole flag +.It Li b Ta "" Ta " RTF_BROADCAST" Ta Route represents a broadcast address .It Li C Ta -cloning Ta " RTF_CLONING" Ta (deprecated) same as .Fl connected .It Li " " Ta -nocloning Ta ~RTF_CLONING Ta (deprecated) same as
CVS commit: src/sbin/route
Module Name:src Committed By: uwe Date: Sat Jan 2 20:36:02 UTC 2021 Modified Files: src/sbin/route: route.8 Log Message: route(8): be consistent about capitalization. To generate a diff of this commit: cvs rdiff -u -r1.63 -r1.64 src/sbin/route/route.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/route/route.8 diff -u src/sbin/route/route.8:1.63 src/sbin/route/route.8:1.64 --- src/sbin/route/route.8:1.63 Sat Jan 2 19:50:42 2021 +++ src/sbin/route/route.8 Sat Jan 2 20:36:02 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: route.8,v 1.63 2021/01/02 19:50:42 uwe Exp $ +.\" $NetBSD: route.8,v 1.64 2021/01/02 20:36:02 uwe Exp $ .\" .\" Copyright (c) 1983, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -300,7 +300,7 @@ by indicating the following correspondin .It Li 2 Ta -proto2 Ta " RTF_PROTO2" Ta set protocol specific flag #2 .It Li B Ta -blackhole Ta " RTF_BLACKHOLE" Ta discard pkts (during updates) .It Li " " Ta -noblackhole Ta ~RTF_BLACKHOLE Ta clear blackhole flag -.It Li b Ta "" Ta " RTF_BROADCAST" Ta Route represents a broadcast address +.It Li b Ta "" Ta " RTF_BROADCAST" Ta route represents a broadcast address .It Li C Ta -cloning Ta " RTF_CLONING" Ta (deprecated) same as .Fl connected .It Li " " Ta -nocloning Ta ~RTF_CLONING Ta (deprecated) same as @@ -311,7 +311,7 @@ by indicating the following correspondin .It Li G Ta "" Ta " RTF_GATEWAY" Ta forwarded to dest by intermediary .It Li H Ta "" Ta " RTF_HOST" Ta host entry (net otherwise) .It Li L Ta "" Ta " RTF_LLDATA" Ta local link, generated by ARP or NDP -.It Li l Ta "" Ta " RTF_LOCAL" Ta Route represents a local address +.It Li l Ta "" Ta " RTF_LOCAL" Ta route represents a local address .It Li M Ta "" Ta " RTF_MODIFIED" Ta modified dynamically (redirect) .It Li p Ta -proxy Ta " RTF_ANNOUNCE" Ta make entry a link level proxy .It Li R Ta -reject Ta " RTF_REJECT" Ta send ICMP unreachable on match
CVS commit: src/sbin/route
Module Name:src Committed By: uwe Date: Sat Jan 2 22:02:27 UTC 2021 Modified Files: src/sbin/route: route.8 Log Message: route(8): group RTF_GATEWAY and ~RTF_GATEWAY (-iface). While here, tweak RTF_GATEWAY description. Passive voice elsewhere in this table is used to talk about the routes themselves, while here it's about packets. To generate a diff of this commit: cvs rdiff -u -r1.64 -r1.65 src/sbin/route/route.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/route/route.8 diff -u src/sbin/route/route.8:1.64 src/sbin/route/route.8:1.65 --- src/sbin/route/route.8:1.64 Sat Jan 2 20:36:02 2021 +++ src/sbin/route/route.8 Sat Jan 2 22:02:27 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: route.8,v 1.64 2021/01/02 20:36:02 uwe Exp $ +.\" $NetBSD: route.8,v 1.65 2021/01/02 22:02:27 uwe Exp $ .\" .\" Copyright (c) 1983, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -295,7 +295,6 @@ display and may be set (or sometimes cle by indicating the following corresponding modifiers: .Bl -column "ID" "xnoblackhole" "xRTF_BLACKHOLE" "x" .It Sy "ID" Ta Sy "Modifier" Ta Sy " Flag Bit" Ta Sy "Description" -.It Li " " Ta -iface Ta ~RTF_GATEWAY Ta destination is directly reachable .It Li 1 Ta -proto1 Ta " RTF_PROTO1" Ta set protocol specific flag #1 .It Li 2 Ta -proto2 Ta " RTF_PROTO2" Ta set protocol specific flag #2 .It Li B Ta -blackhole Ta " RTF_BLACKHOLE" Ta discard pkts (during updates) @@ -308,7 +307,8 @@ by indicating the following correspondin .It Li C Ta -connected Ta " RTF_CONNECTED" Ta treat as a connected route .It Li " " Ta -noconnected Ta ~RTF_CONNECTED Ta stop treating a connected route .It Li D Ta "" Ta " RTF_DYNAMIC" Ta created dynamically (redirect) -.It Li G Ta "" Ta " RTF_GATEWAY" Ta forwarded to dest by intermediary +.It Li G Ta "" Ta " RTF_GATEWAY" Ta forward to dest by intermediary +.It Li " " Ta -iface Ta ~RTF_GATEWAY Ta destination is directly reachable .It Li H Ta "" Ta " RTF_HOST" Ta host entry (net otherwise) .It Li L Ta "" Ta " RTF_LLDATA" Ta local link, generated by ARP or NDP .It Li l Ta "" Ta " RTF_LOCAL" Ta route represents a local address
CVS commit: src/sbin/modload
Module Name:src Committed By: mrg Date: Sun Jan 17 00:17:40 UTC 2021 Modified Files: src/sbin/modload: modload.8 Log Message: call it "kernel object linker module framework" not just "module framework". the latter is generic enough to also mean the old ld(1) linked loadable kernel modules. To generate a diff of this commit: cvs rdiff -u -r1.48 -r1.49 src/sbin/modload/modload.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/modload/modload.8 diff -u src/sbin/modload/modload.8:1.48 src/sbin/modload/modload.8:1.49 --- src/sbin/modload/modload.8:1.48 Mon Jun 1 03:18:36 2020 +++ src/sbin/modload/modload.8 Sun Jan 17 00:17:40 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: modload.8,v 1.48 2020/06/01 03:18:36 uwe Exp $ +.\" $NetBSD: modload.8,v 1.49 2021/01/17 00:17:40 mrg Exp $ .\" .\" Copyright (c) 1993 Christopher G. Demetriou .\" All rights reserved. @@ -32,7 +32,7 @@ .\" .\" <> .\" -.Dd July 18, 2017 +.Dd November 13, 2020 .Dt MODLOAD 8 .Os .Sh NAME @@ -145,13 +145,15 @@ command was designed to be similar in fu to the corresponding command in .Tn "SunOS 4.1.3" . .Nm -was switched to the module framework for -.Nx 5.0 . +was switched to the kernel object linker module framework for +.Nx 5.0 , +derived from the same framework in +.Fx . .Sh AUTHORS .An -nosplit The original .Nx implementation was written by .An Terrence R. Lambert Aq Mt te...@cs.weber.edu . -The switch to the module framework was by +The switch to the kernel object linker module framework was by .An Andrew Doran Aq Mt a...@netbsd.org .
CVS commit: src/sbin/raidctl
Module Name:src Committed By: mlelstv Date: Sun Sep 13 06:04:53 UTC 2020 Modified Files: src/sbin/raidctl: raidctl.c Log Message: Allow components to be specified by wedge name. To generate a diff of this commit: cvs rdiff -u -r1.71 -r1.72 src/sbin/raidctl/raidctl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/raidctl/raidctl.c diff -u src/sbin/raidctl/raidctl.c:1.71 src/sbin/raidctl/raidctl.c:1.72 --- src/sbin/raidctl/raidctl.c:1.71 Thu Sep 26 10:47:30 2019 +++ src/sbin/raidctl/raidctl.c Sun Sep 13 06:04:53 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: raidctl.c,v 1.71 2019/09/26 10:47:30 mlelstv Exp $ */ +/* $NetBSD: raidctl.c,v 1.72 2020/09/13 06:04:53 mlelstv Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. @@ -39,7 +39,7 @@ #include #ifndef lint -__RCSID("$NetBSD: raidctl.c,v 1.71 2019/09/26 10:47:30 mlelstv Exp $"); +__RCSID("$NetBSD: raidctl.c,v 1.72 2020/09/13 06:04:53 mlelstv Exp $"); #endif @@ -92,6 +92,13 @@ int verbose; static const char *rootpart[] = { "No", "Force", "Soft", "*invalid*" }; +static void +get_comp(char *buf, char *arg, size_t bufsz) +{ + if (getfsspecname(buf, bufsz, arg) == NULL) + errx(1,"%s",buf); +} + int main(int argc,char *argv[]) { @@ -131,7 +138,7 @@ main(int argc,char *argv[]) switch(ch) { case 'a': action = RAIDFRAME_ADD_HOT_SPARE; - strlcpy(component, optarg, sizeof(component)); + get_comp(component, optarg, sizeof(component)); num_options++; break; case 'A': @@ -159,19 +166,19 @@ main(int argc,char *argv[]) break; case 'f': action = RAIDFRAME_FAIL_DISK; - strlcpy(component, optarg, sizeof(component)); + get_comp(component, optarg, sizeof(component)); do_recon = 0; num_options++; break; case 'F': action = RAIDFRAME_FAIL_DISK; - strlcpy(component, optarg, sizeof(component)); + get_comp(component, optarg, sizeof(component)); do_recon = 1; num_options++; break; case 'g': action = RAIDFRAME_GET_COMPONENT_LABEL; - strlcpy(component, optarg, sizeof(component)); + get_comp(component, optarg, sizeof(component)); openmode = O_RDONLY; num_options++; break; @@ -209,16 +216,16 @@ main(int argc,char *argv[]) break; case 'l': action = RAIDFRAME_SET_COMPONENT_LABEL; - strlcpy(component, optarg, sizeof(component)); + get_comp(component, optarg, sizeof(component)); num_options++; break; case 'r': action = RAIDFRAME_REMOVE_HOT_SPARE; - strlcpy(component, optarg, sizeof(component)); + get_comp(component, optarg, sizeof(component)); num_options++; break; case 'R': - strlcpy(component, optarg, sizeof(component)); + get_comp(component, optarg, sizeof(component)); action = RAIDFRAME_REBUILD_IN_PLACE; num_options++; break;
CVS commit: src/sbin/ifconfig
Module Name:src Committed By: roy Date: Wed Sep 23 02:09:18 UTC 2020 Modified Files: src/sbin/ifconfig: ifconfig.8 ifconfig.c Log Message: ifconfig: teach carrier test about ifi_link_state from SIOCGIFDATA Because not all interfaces support media. To generate a diff of this commit: cvs rdiff -u -r1.119 -r1.120 src/sbin/ifconfig/ifconfig.8 cvs rdiff -u -r1.243 -r1.244 src/sbin/ifconfig/ifconfig.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/ifconfig/ifconfig.8 diff -u src/sbin/ifconfig/ifconfig.8:1.119 src/sbin/ifconfig/ifconfig.8:1.120 --- src/sbin/ifconfig/ifconfig.8:1.119 Mon Jul 8 03:04:15 2019 +++ src/sbin/ifconfig/ifconfig.8 Wed Sep 23 02:09:18 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: ifconfig.8,v 1.119 2019/07/08 03:04:15 msaitoh Exp $ +.\" $NetBSD: ifconfig.8,v 1.120 2020/09/23 02:09:18 roy Exp $ .\" .\" Copyright (c) 1983, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" @(#)ifconfig.8 8.4 (Berkeley) 6/1/94 .\" -.Dd July 8, 2019 +.Dd September 23, 2020 .Dt IFCONFIG 8 .Os .Sh NAME @@ -757,12 +757,17 @@ not appear to be connected to a network, .Nm will exit with status of 1 .Pq false ; -otherwise, it will exit with a -zero +otherwise, it will exit with a zero +.Pq true +exit status. +For interface drivers that do not support media status reporting. +then if the link state is not reported to be up, +.Nm +will exit with a status of 1 +.Pq false ; +otherwise, it will exit with a zero .Pq true exit status. -Not all interface drivers support media -status reporting. .Pp If the .Fl m Index: src/sbin/ifconfig/ifconfig.c diff -u src/sbin/ifconfig/ifconfig.c:1.243 src/sbin/ifconfig/ifconfig.c:1.244 --- src/sbin/ifconfig/ifconfig.c:1.243 Tue Sep 22 14:14:17 2020 +++ src/sbin/ifconfig/ifconfig.c Wed Sep 23 02:09:18 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: ifconfig.c,v 1.243 2020/09/22 14:14:17 roy Exp $ */ +/* $NetBSD: ifconfig.c,v 1.244 2020/09/23 02:09:18 roy Exp $ */ /*- * Copyright (c) 1997, 1998, 2000 The NetBSD Foundation, Inc. @@ -63,7 +63,7 @@ #ifndef lint __COPYRIGHT("@(#) Copyright (c) 1983, 1993\ The Regents of the University of California. All rights reserved."); -__RCSID("$NetBSD: ifconfig.c,v 1.243 2020/09/22 14:14:17 roy Exp $"); +__RCSID("$NetBSD: ifconfig.c,v 1.244 2020/09/23 02:09:18 roy Exp $"); #endif /* not lint */ #include @@ -1213,16 +1213,21 @@ setifmtu(prop_dictionary_t env, prop_dic static int carrier(prop_dictionary_t env) { - struct ifmediareq ifmr; - - memset(&ifmr, 0, sizeof(ifmr)); + struct ifmediareq ifmr = { .ifm_status = 0 }; if (direct_ioctl(env, SIOCGIFMEDIA, &ifmr) == -1) { /* * Interface doesn't support SIOC{G,S}IFMEDIA; - * assume ok. + * check link state. */ - return EXIT_SUCCESS; + struct ifdatareq ifdr = { .ifdr_data.ifi_link_state = 0 }; + + if (direct_ioctl(env, SIOCGIFDATA, &ifdr) == -1) + return EXIT_FAILURE; + if (ifdr.ifdr_data.ifi_link_state == LINK_STATE_UP) + return EXIT_SUCCESS; + else + return EXIT_FAILURE; } if ((ifmr.ifm_status & IFM_AVALID) == 0) { /*
CVS commit: src/sbin/ifconfig
Module Name:src Committed By: roy Date: Wed Sep 23 10:48:12 UTC 2020 Modified Files: src/sbin/ifconfig: ifconfig.c Log Message: ifconfig: test cases want LINK_STATE_UNKNOWN to be treated as up. To generate a diff of this commit: cvs rdiff -u -r1.244 -r1.245 src/sbin/ifconfig/ifconfig.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/ifconfig/ifconfig.c diff -u src/sbin/ifconfig/ifconfig.c:1.244 src/sbin/ifconfig/ifconfig.c:1.245 --- src/sbin/ifconfig/ifconfig.c:1.244 Wed Sep 23 02:09:18 2020 +++ src/sbin/ifconfig/ifconfig.c Wed Sep 23 10:48:12 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: ifconfig.c,v 1.244 2020/09/23 02:09:18 roy Exp $ */ +/* $NetBSD: ifconfig.c,v 1.245 2020/09/23 10:48:12 roy Exp $ */ /*- * Copyright (c) 1997, 1998, 2000 The NetBSD Foundation, Inc. @@ -63,7 +63,7 @@ #ifndef lint __COPYRIGHT("@(#) Copyright (c) 1983, 1993\ The Regents of the University of California. All rights reserved."); -__RCSID("$NetBSD: ifconfig.c,v 1.244 2020/09/23 02:09:18 roy Exp $"); +__RCSID("$NetBSD: ifconfig.c,v 1.245 2020/09/23 10:48:12 roy Exp $"); #endif /* not lint */ #include @@ -1224,10 +1224,10 @@ carrier(prop_dictionary_t env) if (direct_ioctl(env, SIOCGIFDATA, &ifdr) == -1) return EXIT_FAILURE; - if (ifdr.ifdr_data.ifi_link_state == LINK_STATE_UP) - return EXIT_SUCCESS; - else + if (ifdr.ifdr_data.ifi_link_state == LINK_STATE_DOWN) return EXIT_FAILURE; + else + return EXIT_SUCCESS; } if ((ifmr.ifm_status & IFM_AVALID) == 0) { /*
CVS commit: src/sbin/ifconfig
Module Name:src Committed By: roy Date: Sat Sep 26 23:43:26 UTC 2020 Modified Files: src/sbin/ifconfig: ifconfig.c Log Message: ifconfig: We already have struct if_data in ifa_data. So let's not bother with an ioctl we don't need. To generate a diff of this commit: cvs rdiff -u -r1.245 -r1.246 src/sbin/ifconfig/ifconfig.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/ifconfig/ifconfig.c diff -u src/sbin/ifconfig/ifconfig.c:1.245 src/sbin/ifconfig/ifconfig.c:1.246 --- src/sbin/ifconfig/ifconfig.c:1.245 Wed Sep 23 10:48:12 2020 +++ src/sbin/ifconfig/ifconfig.c Sat Sep 26 23:43:26 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: ifconfig.c,v 1.245 2020/09/23 10:48:12 roy Exp $ */ +/* $NetBSD: ifconfig.c,v 1.246 2020/09/26 23:43:26 roy Exp $ */ /*- * Copyright (c) 1997, 1998, 2000 The NetBSD Foundation, Inc. @@ -63,7 +63,7 @@ #ifndef lint __COPYRIGHT("@(#) Copyright (c) 1983, 1993\ The Regents of the University of California. All rights reserved."); -__RCSID("$NetBSD: ifconfig.c,v 1.245 2020/09/23 10:48:12 roy Exp $"); +__RCSID("$NetBSD: ifconfig.c,v 1.246 2020/09/26 23:43:26 roy Exp $"); #endif /* not lint */ #include @@ -135,8 +135,8 @@ static int setlinkstr(prop_dictionary_t, static int unsetlinkstr(prop_dictionary_t, prop_dictionary_t); static int setifdescr(prop_dictionary_t, prop_dictionary_t); static int unsetifdescr(prop_dictionary_t, prop_dictionary_t); -static void status(const struct sockaddr_dl *, prop_dictionary_t, -prop_dictionary_t); +static void status(const struct sockaddr_dl *, const void *, +prop_dictionary_t, prop_dictionary_t); __dead static void usage(void); static const struct kwinst ifflagskw[] = { @@ -908,7 +908,7 @@ printall(const char *ifname, prop_dictio continue; } - status(sdl, env, oenv); + status(sdl, ifa->ifa_data, env, oenv); sdl = NULL; } if (lflag) @@ -1270,10 +1270,10 @@ print_human_bytes(bool humanize, uint64_ #define MAX_PRINT_LEN 58 /* XXX need a better way to determine this! */ void -status(const struct sockaddr_dl *sdl, prop_dictionary_t env, -prop_dictionary_t oenv) +status(const struct sockaddr_dl *sdl, const void *ifa_data, +prop_dictionary_t env, prop_dictionary_t oenv) { - const struct if_data *ifi; + const struct if_data *ifi = ifa_data; status_func_t *status_f; statistics_func_t *statistics_f; struct ifdatareq ifdr; @@ -1365,18 +1365,19 @@ status(const struct sockaddr_dl *sdl, pr free(p); } - estrlcpy(ifdr.ifdr_name, ifname, sizeof(ifdr.ifdr_name)); - - if (prog_ioctl(s, zflag ? SIOCZIFDATA : SIOCGIFDATA, &ifdr) == -1) - err(EXIT_FAILURE, zflag ? "SIOCZIFDATA" : "SIOCGIFDATA"); - - ifi = &ifdr.ifdr_data; - media_status(sdl->sdl_type, ifi->ifi_link_state, env, oenv); if (!vflag && !zflag) goto proto_status; + /* We already have if_data from SIOCGIFDATA in ifa_data. */ + if (zflag) { + estrlcpy(ifdr.ifdr_name, ifname, sizeof(ifdr.ifdr_name)); + if (prog_ioctl(s, SIOCZIFDATA, &ifdr) == -1) + err(EXIT_FAILURE, "SIOCZIFDATA"); + ifi = &ifdr.ifdr_data; + } + print_plural("\tinput: ", ifi->ifi_ipackets, "packet"); print_human_bytes(hflag, ifi->ifi_ibytes); if (ifi->ifi_imcasts)
CVS commit: src/sbin/nvmectl
Module Name:src Committed By: jdolecek Date: Sun Sep 27 16:45:21 UTC 2020 Modified Files: src/sbin/nvmectl: identify.c Log Message: show APSTA support status in identify To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sbin/nvmectl/identify.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/nvmectl/identify.c diff -u src/sbin/nvmectl/identify.c:1.6 src/sbin/nvmectl/identify.c:1.7 --- src/sbin/nvmectl/identify.c:1.6 Sat Dec 1 18:29:19 2018 +++ src/sbin/nvmectl/identify.c Sun Sep 27 16:45:21 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: identify.c,v 1.6 2018/12/01 18:29:19 jdolecek Exp $ */ +/* $NetBSD: identify.c,v 1.7 2020/09/27 16:45:21 jdolecek Exp $ */ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD @@ -30,7 +30,7 @@ #include #ifndef lint -__RCSID("$NetBSD: identify.c,v 1.6 2018/12/01 18:29:19 jdolecek Exp $"); +__RCSID("$NetBSD: identify.c,v 1.7 2020/09/27 16:45:21 jdolecek Exp $"); #if 0 __FBSDID("$FreeBSD: head/sbin/nvmecontrol/identify.c 329824 2018-02-22 13:32:31Z wma $"); #endif @@ -145,6 +145,9 @@ print_controller(struct nvm_identify_con printf("Volatile Write Cache:%s\n", (cdata->vwc & NVME_ID_CTRLR_VWC_PRESENT) ? "Present" : "Not Present"); + printf("Autonomous Power State Transitions:%s\n", + (cdata->apsta & NVME_ID_CTRLR_APSTA_PRESENT) ? + "Supported" : "Not Supported"); if (cdata->oacs & NVME_ID_CTRLR_OACS_NS) { printf("\n");
CVS commit: src/sbin/nvmectl
Module Name:src Committed By: jdolecek Date: Sun Sep 27 17:27:08 UTC 2020 Modified Files: src/sbin/nvmectl: power.c Log Message: print current power state and workload as separate values for 'nvmectl power nvme0' To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sbin/nvmectl/power.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/nvmectl/power.c diff -u src/sbin/nvmectl/power.c:1.4 src/sbin/nvmectl/power.c:1.5 --- src/sbin/nvmectl/power.c:1.4 Wed Apr 18 10:11:44 2018 +++ src/sbin/nvmectl/power.c Sun Sep 27 17:27:07 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: power.c,v 1.4 2018/04/18 10:11:44 nonaka Exp $ */ +/* $NetBSD: power.c,v 1.5 2020/09/27 17:27:07 jdolecek Exp $ */ /*- * Copyright (c) 2016 Netflix, Inc @@ -28,7 +28,7 @@ #include #ifndef lint -__RCSID("$NetBSD: power.c,v 1.4 2018/04/18 10:11:44 nonaka Exp $"); +__RCSID("$NetBSD: power.c,v 1.5 2020/09/27 17:27:07 jdolecek Exp $"); #if 0 __FBSDID("$FreeBSD: head/sbin/nvmecontrol/power.c 329824 2018-02-22 13:32:31Z wma $"); #endif @@ -129,7 +129,9 @@ power_show(int fd) if (nvme_completion_is_error(&pt.cpl)) errx(1, "set feature power mgmt request returned error"); - printf("Current Power Mode is %d\n", pt.cpl.cdw0); + printf("Current Power State is %d, Workload Hint %d\n", + pt.cpl.cdw0 & ((1 << 5) - 1), + pt.cpl.cdw0 >> 5); } void
CVS commit: src/sbin/nvmectl
Module Name:src Committed By: jdolecek Date: Sun Sep 27 18:17:35 UTC 2020 Modified Files: src/sbin/nvmectl: nvmectl.8 nvmectl.h power.c Log Message: add -s option for 'power' command, this instructs the controller to save the value so it persists resets/whatnot; the NVMe specification lists this as optional, so this only works if the controller supports it To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sbin/nvmectl/nvmectl.8 src/sbin/nvmectl/power.c cvs rdiff -u -r1.8 -r1.9 src/sbin/nvmectl/nvmectl.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/nvmectl/nvmectl.8 diff -u src/sbin/nvmectl/nvmectl.8:1.5 src/sbin/nvmectl/nvmectl.8:1.6 --- src/sbin/nvmectl/nvmectl.8:1.5 Wed Apr 18 10:17:54 2018 +++ src/sbin/nvmectl/nvmectl.8 Sun Sep 27 18:17:35 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: nvmectl.8,v 1.5 2018/04/18 10:17:54 nonaka Exp $ +.\" $NetBSD: nvmectl.8,v 1.6 2020/09/27 18:17:35 jdolecek Exp $ .\" .\" Copyright (c) 2012 Intel Corporation .\" All rights reserved. @@ -34,7 +34,7 @@ .\" .\" $FreeBSD: head/sbin/nvmecontrol/nvmecontrol.8 314230 2017-02-25 00:09:16Z imp $ .\" -.Dd May 19, 2016 +.Dd September 27, 2020 .Dt NVMECTL 8 .Os .Sh NAME @@ -74,6 +74,7 @@ .Nm .Ic power .Op Fl l +.Op Fl s .Op Fl p Ar power_state .Op Fl w Ar workload_hint .Ar device_id @@ -84,6 +85,19 @@ .Sh DESCRIPTION NVM Express (NVMe) is a storage protocol standard, for SSDs and other high-speed storage devices over PCI Express. +.Ss power +The power command controls the supported power states. +.Fl l +will list supported power states. +.Fl p +will set the power state to specified value. +.Fl w +will set workload value. +With +.Fl s , +the specified power state and workload value is saved, +so it persists any autonomous transitions and resets. +Support for saving the values is optional, and depends on the controller. .Ss logpage The logpage command knows how to print log pages of various types. It also knows about vendor specific log pages from hgst/wdc and intel. Index: src/sbin/nvmectl/power.c diff -u src/sbin/nvmectl/power.c:1.5 src/sbin/nvmectl/power.c:1.6 --- src/sbin/nvmectl/power.c:1.5 Sun Sep 27 17:27:07 2020 +++ src/sbin/nvmectl/power.c Sun Sep 27 18:17:35 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: power.c,v 1.5 2020/09/27 17:27:07 jdolecek Exp $ */ +/* $NetBSD: power.c,v 1.6 2020/09/27 18:17:35 jdolecek Exp $ */ /*- * Copyright (c) 2016 Netflix, Inc @@ -28,7 +28,7 @@ #include #ifndef lint -__RCSID("$NetBSD: power.c,v 1.5 2020/09/27 17:27:07 jdolecek Exp $"); +__RCSID("$NetBSD: power.c,v 1.6 2020/09/27 18:17:35 jdolecek Exp $"); #if 0 __FBSDID("$FreeBSD: head/sbin/nvmecontrol/power.c 329824 2018-02-22 13:32:31Z wma $"); #endif @@ -96,15 +96,14 @@ power_list(struct nvm_identify_controlle } static void -power_set(int fd, int power_val, int workload, int perm) +power_set(int fd, int power_val, int workload, int saveflag) { struct nvme_pt_command pt; - uint32_t p; - p = perm ? (1u << 31) : 0; memset(&pt, 0, sizeof(pt)); pt.cmd.opcode = NVM_ADMIN_SET_FEATURES; - pt.cmd.cdw10 = NVM_FEAT_POWER_MANAGEMENT | p; + pt.cmd.cdw10 = NVM_FEAT_POWER_MANAGEMENT + | (saveflag ? NVM_SET_FEATURES_SV : 0); pt.cmd.cdw11 = power_val | (workload << 5); if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) @@ -138,15 +137,18 @@ void power(int argc, char *argv[]) { struct nvm_identify_controller cdata; - intch, listflag = 0, powerflag = 0, power_val = 0, fd; + intch, listflag = 0, powerflag = 0, power_val = 0, fd, saveflag = 0; intworkload = 0; char*end; - while ((ch = getopt(argc, argv, "lp:w:")) != -1) { + while ((ch = getopt(argc, argv, "lsp:w:")) != -1) { switch (ch) { case 'l': listflag = 1; break; + case 's': + saveflag = 1; + break; case 'p': powerflag = 1; power_val = strtol(optarg, &end, 0); @@ -185,7 +187,7 @@ power(int argc, char *argv[]) } if (powerflag) { - power_set(fd, power_val, workload, 0); + power_set(fd, power_val, workload, saveflag); goto out; } power_show(fd); Index: src/sbin/nvmectl/nvmectl.h diff -u src/sbin/nvmectl/nvmectl.h:1.8 src/sbin/nvmectl/nvmectl.h:1.9 --- src/sbin/nvmectl/nvmectl.h:1.8 Wed Apr 18 10:16:22 2018 +++ src/sbin/nvmectl/nvmectl.h Sun Sep 27 18:17:35 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: nvmectl.h,v 1.8 2018/04/18 10:16:22 nonaka Exp $ */ +/* $NetBSD: nvmectl.h,v 1.9 2020/09/27 18:17:35 jdolecek Exp $ */ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD @@ -78,7 +78,7 @@ struct nvme_function { #endif #define POWER_USAGE \ -"power [-l] [-p new-state [-w workload-hint]] \n" +"power [-l] [[-s] -p new-state [-w workload-hint]] \n" #define WDC_USAGE \ "wdc cap-diag [-o path-templete]\n"
CVS commit: src/sbin/ifconfig
Module Name:src Committed By: roy Date: Mon Sep 28 13:50:22 UTC 2020 Modified Files: src/sbin/ifconfig: ifconfig.c Log Message: ifconfig: Just look at if_data->ifi_link_state for carrier It should be the sole source of truth. if_data is also carried in ifa_data from getifaddrs(3) which saves more ioctl calls. To generate a diff of this commit: cvs rdiff -u -r1.246 -r1.247 src/sbin/ifconfig/ifconfig.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/ifconfig/ifconfig.c diff -u src/sbin/ifconfig/ifconfig.c:1.246 src/sbin/ifconfig/ifconfig.c:1.247 --- src/sbin/ifconfig/ifconfig.c:1.246 Sat Sep 26 23:43:26 2020 +++ src/sbin/ifconfig/ifconfig.c Mon Sep 28 13:50:22 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: ifconfig.c,v 1.246 2020/09/26 23:43:26 roy Exp $ */ +/* $NetBSD: ifconfig.c,v 1.247 2020/09/28 13:50:22 roy Exp $ */ /*- * Copyright (c) 1997, 1998, 2000 The NetBSD Foundation, Inc. @@ -63,7 +63,7 @@ #ifndef lint __COPYRIGHT("@(#) Copyright (c) 1983, 1993\ The Regents of the University of California. All rights reserved."); -__RCSID("$NetBSD: ifconfig.c,v 1.246 2020/09/26 23:43:26 roy Exp $"); +__RCSID("$NetBSD: ifconfig.c,v 1.247 2020/09/28 13:50:22 roy Exp $"); #endif /* not lint */ #include @@ -852,6 +852,7 @@ printall(const char *ifname, prop_dictio struct ifaddrs *ifap, *ifa; struct ifreq ifr; const struct sockaddr_dl *sdl = NULL; + const struct if_data *ifi = NULL; prop_dictionary_t env, oenv; int idx; char *p; @@ -880,8 +881,10 @@ printall(const char *ifname, prop_dictio if (ifname != NULL && strcmp(ifname, ifa->ifa_name) != 0) continue; - if (ifa->ifa_addr->sa_family == AF_LINK) + if (ifa->ifa_addr->sa_family == AF_LINK) { sdl = (const struct sockaddr_dl *)ifa->ifa_addr; + ifi = (const struct if_data *)ifa->ifa_data; + } if (p && strcmp(p, ifa->ifa_name) == 0) continue; if (!prop_dictionary_set_string(env, "if", ifa->ifa_name)) @@ -895,7 +898,8 @@ printall(const char *ifname, prop_dictio if (uflag && (ifa->ifa_flags & IFF_UP) == 0) continue; - if (sflag && carrier(env)) + if (sflag && (ifi == NULL || + ifi->ifi_link_state == LINK_STATE_DOWN)) continue; idx++; /* @@ -910,6 +914,7 @@ printall(const char *ifname, prop_dictio status(sdl, ifa->ifa_data, env, oenv); sdl = NULL; + ifi = NULL; } if (lflag) printf("\n"); @@ -1213,34 +1218,15 @@ setifmtu(prop_dictionary_t env, prop_dic static int carrier(prop_dictionary_t env) { - struct ifmediareq ifmr = { .ifm_status = 0 }; + struct ifdatareq ifdr = { .ifdr_data.ifi_link_state = 0 }; - if (direct_ioctl(env, SIOCGIFMEDIA, &ifmr) == -1) { - /* - * Interface doesn't support SIOC{G,S}IFMEDIA; - * check link state. - */ - struct ifdatareq ifdr = { .ifdr_data.ifi_link_state = 0 }; + if (direct_ioctl(env, SIOCGIFDATA, &ifdr) == -1) + return EXIT_FAILURE; - if (direct_ioctl(env, SIOCGIFDATA, &ifdr) == -1) - return EXIT_FAILURE; - if (ifdr.ifdr_data.ifi_link_state == LINK_STATE_DOWN) - return EXIT_FAILURE; - else - return EXIT_SUCCESS; - } - if ((ifmr.ifm_status & IFM_AVALID) == 0) { - /* - * Interface doesn't report media-valid status. - * assume ok. - */ - return EXIT_SUCCESS; - } - /* otherwise, return ok for active, not-ok if not active. */ - if (ifmr.ifm_status & IFM_ACTIVE) - return EXIT_SUCCESS; - else + if (ifdr.ifdr_data.ifi_link_state == LINK_STATE_DOWN) return EXIT_FAILURE; + else /* Assume UP if UNKNOWN */ + return EXIT_SUCCESS; } static void
CVS commit: src/sbin/ifconfig
Module Name:src Committed By: msaitoh Date: Tue Sep 29 08:52:11 UTC 2020 Modified Files: src/sbin/ifconfig: ifconfig.8 Log Message: Add [-]eee and [-]vlan-hwfilter. To generate a diff of this commit: cvs rdiff -u -r1.120 -r1.121 src/sbin/ifconfig/ifconfig.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/ifconfig/ifconfig.8 diff -u src/sbin/ifconfig/ifconfig.8:1.120 src/sbin/ifconfig/ifconfig.8:1.121 --- src/sbin/ifconfig/ifconfig.8:1.120 Wed Sep 23 02:09:18 2020 +++ src/sbin/ifconfig/ifconfig.8 Tue Sep 29 08:52:11 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: ifconfig.8,v 1.120 2020/09/23 02:09:18 roy Exp $ +.\" $NetBSD: ifconfig.8,v 1.121 2020/09/29 08:52:11 msaitoh Exp $ .\" .\" Copyright (c) 1983, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" @(#)ifconfig.8 8.4 (Berkeley) 6/1/94 .\" -.Dd September 23, 2020 +.Dd September 29, 2020 .Dt IFCONFIG 8 .Os .Sh NAME @@ -614,6 +614,10 @@ Remove from the .Xr agr 4 interface. +.It Cm eee +Enable IEEE 802.3az Energy Efficiency Ethernet function. +.It Cm -eee +Disable IEEE 802.3az Energy Efficiency Ethernet function. .It Cm vltime Ar n .Pq inet6 only Set valid lifetime for the address. @@ -699,6 +703,10 @@ support it. .It Cm -tso6 Disable hardware-assisted TCP/IPv6 segmentation on interfaces that support it. +.It Cm vlan-hwfilter +Enable hardware-assisted VLAN frame filter on interfaces that support it. +.It Cm -vlan-hwfilter +Disable hardware-assisted VLAN frame filter on interfaces that support it. .It Cm vlan-hwtagging Enable hardware-assisted VLAN tag insertion/removal on interfaces that support it.
CVS commit: src/sbin/mount_nfs
Module Name:src Committed By: christos Date: Sat Oct 3 18:06:37 UTC 2020 Modified Files: src/sbin/mount_nfs: mount_nfs.8 mount_nfs.c Log Message: Add -A (noac) option to turn off the attribute cache. (Maciej W. Rozycki) To generate a diff of this commit: cvs rdiff -u -r1.48 -r1.49 src/sbin/mount_nfs/mount_nfs.8 cvs rdiff -u -r1.72 -r1.73 src/sbin/mount_nfs/mount_nfs.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/mount_nfs/mount_nfs.8 diff -u src/sbin/mount_nfs/mount_nfs.8:1.48 src/sbin/mount_nfs/mount_nfs.8:1.49 --- src/sbin/mount_nfs/mount_nfs.8:1.48 Thu May 17 02:37:06 2018 +++ src/sbin/mount_nfs/mount_nfs.8 Sat Oct 3 14:06:37 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: mount_nfs.8,v 1.48 2018/05/17 06:37:06 wiz Exp $ +.\" $NetBSD: mount_nfs.8,v 1.49 2020/10/03 18:06:37 christos Exp $ .\" .\" Copyright (c) 1992, 1993, 1994, 1995 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" @(#)mount_nfs.8 8.3 (Berkeley) 3/29/95 .\" -.Dd September 12, 2016 +.Dd October 3, 2020 .Dt MOUNT_NFS 8 .Os .Sh NAME @@ -37,7 +37,7 @@ .Nd mount NFS file systems .Sh SYNOPSIS .Nm -.Op Fl 23bCcdilPpqsTUuX +.Op Fl 23AbCcdilPpqsTUuX .Op Fl a Ar maxreadahead .Op Fl D Ar deadthresh .Op Fl g Ar maxgroups @@ -75,6 +75,17 @@ Use the NFS Version 2 protocol. Use the NFS Version 3 protocol. The default is to try version 3 first, and fall back to version 2 if the mount fails. +.It Fl A +Disable the attribute cache in the client, making it consult the server +for the current version of a given file's attributes every time the file +is accessed. + +By default the attribute cache is enabled, making the client only consult +the server every handful of seconds. This improves performance, however +at the cost of the risk of a mid-air collision when changes are made +simultaneously by different NFS clients and/or locally on the NFS server +that affect the same file. In that case changes made elsewhere may be +missed, leading to consistency issues. .It Fl a Ar maxreadahead Set the read-ahead count to the specified value. This may be in the range of 0 - 4, and determines how many blocks @@ -186,6 +197,9 @@ Same as .It Cm nfsv3 Same as .Fl 3 . +.It Cm noac +Same as +.Fl A . .It Cm noresport Same as .Fl p . Index: src/sbin/mount_nfs/mount_nfs.c diff -u src/sbin/mount_nfs/mount_nfs.c:1.72 src/sbin/mount_nfs/mount_nfs.c:1.73 --- src/sbin/mount_nfs/mount_nfs.c:1.72 Wed May 16 22:34:31 2018 +++ src/sbin/mount_nfs/mount_nfs.c Sat Oct 3 14:06:37 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: mount_nfs.c,v 1.72 2018/05/17 02:34:31 thorpej Exp $ */ +/* $NetBSD: mount_nfs.c,v 1.73 2020/10/03 18:06:37 christos Exp $ */ /* * Copyright (c) 1992, 1993, 1994 @@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1992, 19 #if 0 static char sccsid[] = "@(#)mount_nfs.c 8.11 (Berkeley) 5/4/95"; #else -__RCSID("$NetBSD: mount_nfs.c,v 1.72 2018/05/17 02:34:31 thorpej Exp $"); +__RCSID("$NetBSD: mount_nfs.c,v 1.73 2020/10/03 18:06:37 christos Exp $"); #endif #endif /* not lint */ @@ -79,6 +79,7 @@ __RCSID("$NetBSD: mount_nfs.c,v 1.72 201 #define ALTF_CONN 0x0002 #define ALTF_DUMBTIMR 0x0004 #define ALTF_INTR 0x0008 +#define ALTF_NOAC 0x0010 #define ALTF_NFSV3 0x0020 #define ALTF_RDIRPLUS 0x0040 #define ALTF_MNTUDP 0x0080 @@ -109,6 +110,7 @@ static const struct mntopt mopts[] = { { "conn", 0, ALTF_CONN, 1 }, { "dumbtimer", 0, ALTF_DUMBTIMR, 1 }, { "intr", 0, ALTF_INTR, 1 }, + { "ac", 1, ALTF_NOAC, 1 }, { "nfsv3", 0, ALTF_NFSV3, 1 }, { "rdirplus", 0, ALTF_RDIRPLUS, 1 }, { "mntudp", 0, ALTF_MNTUDP, 1 }, @@ -217,6 +219,9 @@ mount_nfs_parseargs(int argc, char *argv force2 = 1; nfsargsp->flags &= ~NFSMNT_NFSV3; break; + case 'A': + nfsargsp->flags |= NFSMNT_NOAC; + break; case 'a': num = strtol(optarg, &p, 10); if (*p || num < 0) @@ -281,6 +286,8 @@ mount_nfs_parseargs(int argc, char *argv nfsargsp->flags |= NFSMNT_DUMBTIMR; if (altflags & ALTF_INTR) nfsargsp->flags |= NFSMNT_INT; + if (altflags & ALTF_NOAC) +nfsargsp->flags |= NFSMNT_NOAC; if (altflags & (ALTF_NFSV3|ALTF_NQNFS)) { if (force2) errx(1, "conflicting version options");
CVS commit: src/sbin/mount_nfs
Module Name:src Committed By: wiz Date: Sat Oct 3 18:29:02 UTC 2020 Modified Files: src/sbin/mount_nfs: mount_nfs.8 Log Message: New sentence, new line. To generate a diff of this commit: cvs rdiff -u -r1.49 -r1.50 src/sbin/mount_nfs/mount_nfs.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/mount_nfs/mount_nfs.8 diff -u src/sbin/mount_nfs/mount_nfs.8:1.49 src/sbin/mount_nfs/mount_nfs.8:1.50 --- src/sbin/mount_nfs/mount_nfs.8:1.49 Sat Oct 3 18:06:37 2020 +++ src/sbin/mount_nfs/mount_nfs.8 Sat Oct 3 18:29:02 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: mount_nfs.8,v 1.49 2020/10/03 18:06:37 christos Exp $ +.\" $NetBSD: mount_nfs.8,v 1.50 2020/10/03 18:29:02 wiz Exp $ .\" .\" Copyright (c) 1992, 1993, 1994, 1995 .\" The Regents of the University of California. All rights reserved. @@ -79,13 +79,14 @@ fall back to version 2 if the mount fail Disable the attribute cache in the client, making it consult the server for the current version of a given file's attributes every time the file is accessed. - +.Pp By default the attribute cache is enabled, making the client only consult -the server every handful of seconds. This improves performance, however -at the cost of the risk of a mid-air collision when changes are made -simultaneously by different NFS clients and/or locally on the NFS server -that affect the same file. In that case changes made elsewhere may be -missed, leading to consistency issues. +the server every handful of seconds. +This improves performance, however at the cost of the risk of a +mid-air collision when changes are made simultaneously by different +NFS clients and/or locally on the NFS server that affect the same file. +In that case changes made elsewhere may be missed, leading to +consistency issues. .It Fl a Ar maxreadahead Set the read-ahead count to the specified value. This may be in the range of 0 - 4, and determines how many blocks
CVS commit: src/sbin/mount_nfs
Module Name:src Committed By: christos Date: Sat Oct 3 18:42:20 UTC 2020 Modified Files: src/sbin/mount_nfs: mount_nfs.c Log Message: - centralize number parsing code - enable -g - KNF To generate a diff of this commit: cvs rdiff -u -r1.73 -r1.74 src/sbin/mount_nfs/mount_nfs.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/mount_nfs/mount_nfs.c diff -u src/sbin/mount_nfs/mount_nfs.c:1.73 src/sbin/mount_nfs/mount_nfs.c:1.74 --- src/sbin/mount_nfs/mount_nfs.c:1.73 Sat Oct 3 14:06:37 2020 +++ src/sbin/mount_nfs/mount_nfs.c Sat Oct 3 14:42:20 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: mount_nfs.c,v 1.73 2020/10/03 18:06:37 christos Exp $ */ +/* $NetBSD: mount_nfs.c,v 1.74 2020/10/03 18:42:20 christos Exp $ */ /* * Copyright (c) 1992, 1993, 1994 @@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1992, 19 #if 0 static char sccsid[] = "@(#)mount_nfs.c 8.11 (Berkeley) 5/4/95"; #else -__RCSID("$NetBSD: mount_nfs.c,v 1.73 2020/10/03 18:06:37 christos Exp $"); +__RCSID("$NetBSD: mount_nfs.c,v 1.74 2020/10/03 18:42:20 christos Exp $"); #endif #endif /* not lint */ @@ -52,7 +52,8 @@ __RCSID("$NetBSD: mount_nfs.c,v 1.73 202 #include #include -#include +#include +#include /* XXX: redefines enums */ #include #include #include @@ -181,21 +182,36 @@ mount_nfs_dogetargs(struct nfs_args *nfs nfsargsp->addrlen = sizeof(sa); } else { if ((tspec = strdup(spec)) == NULL) { - err(1, "strdup"); + err(EXIT_FAILURE, "strdup"); } if (!getnfsargs(tspec, nfsargsp)) { - exit(1); + exit(EXIT_FAILURE); } free(tspec); } } +static int +getnum(const char *s, int c) +{ + char *es; + long num = strtol(s, &es, 10); + if (*es || num <= 0 || num > INT_MAX) + errx(EXIT_FAILURE, "Illegal value `%s' for option -%c", s, c); + return (int)num; +} + +static __dead void +conflicting(void) +{ + errx(EXIT_FAILURE, "Conflicting version options"); +} + void mount_nfs_parseargs(int argc, char *argv[], struct nfs_args *nfsargsp, int *mntflags, char *spec, char *name) { - char *p; int altflags, num; int c; mntoptparse_t mp; @@ -210,12 +226,12 @@ mount_nfs_parseargs(int argc, char *argv case '3': case 'q': if (force2) -errx(1, "conflicting version options"); +conflicting(); force3 = 1; break; case '2': if (force3) -errx(1, "conflicting version options"); +conflicting(); force2 = 1; nfsargsp->flags &= ~NFSMNT_NFSV3; break; @@ -223,10 +239,7 @@ mount_nfs_parseargs(int argc, char *argv nfsargsp->flags |= NFSMNT_NOAC; break; case 'a': - num = strtol(optarg, &p, 10); - if (*p || num < 0) -errx(1, "illegal -a value -- %s", optarg); - nfsargsp->readahead = num; + nfsargsp->readahead = getnum(optarg, c); nfsargsp->flags |= NFSMNT_READAHEAD; break; case 'b': @@ -239,30 +252,20 @@ mount_nfs_parseargs(int argc, char *argv nfsargsp->flags &= ~NFSMNT_NOCONN; break; case 'D': - num = strtol(optarg, &p, 10); - if (*p || num <= 0) -errx(1, "illegal -D value -- %s", optarg); - nfsargsp->deadthresh = num; + nfsargsp->deadthresh = getnum(optarg, c); nfsargsp->flags |= NFSMNT_DEADTHRESH; break; case 'd': nfsargsp->flags |= NFSMNT_DUMBTIMR; break; -#if 0 /* */ case 'g': - num = strtol(optarg, &p, 10); - if (*p || num <= 0) -errx(1, "illegal -g value -- %s", optarg); + num = getnum(optarg, c); set_rpc_maxgrouplist(num); nfsargsp->maxgrouplist = num; nfsargsp->flags |= NFSMNT_MAXGRPS; break; -#endif case 'I': - num = strtol(optarg, &p, 10); - if (*p || num <= 0) -errx(1, "illegal -I value -- %s", optarg); - nfsargsp->readdirsize = num; + nfsargsp->readdirsize = getnum(optarg, c); nfsargsp->flags |= NFSMNT_READDIRSIZE; break; case 'i': @@ -277,7 +280,7 @@ mount_nfs_parseargs(int argc, char *argv case 'o': mp = getmntopts(optarg, mopts, mntflags, &altflags); if (mp == NULL) -err(1, "getmntopts"); +err(EXIT_FAILURE, "getmntopts"); if (altflags & ALTF_BG) opflags |= BGRND; if (altflags & ALTF_CONN) @@ -290,12 +293,12 @@ mount_nfs_parseargs(int argc, char *argv nfsargsp->flags |= NFSMNT_NOAC; if (altflags & (ALTF_NFSV3|ALTF_NQNFS)) { if (force2) - errx(1, "conflicting version options"); + conflicting(); force3 = 1; } if (altflags & ALTF_NFSV2) { if (force3) - errx(1, "conflicting version options"); + conflicting(); force2 = 1; nfsargsp->flags &= ~NFSMNT_NFSV3; } @@ -318,7 +321,7 @@ mount_nfs_parseargs(int argc, char *argv nfsargsp->sotype = SOCK_STREAM; } if (altflags & ALTF_PORT) { -port = getmntoptnum(mp, "port"); +port = (int)getmntoptnum(mp, "port"); } if (altflags & ALTF_RSIZE) { nfsargsp->rsize = @@ -378,16 +381,10 @@ mount_nfs_parseargs(int argc, char *argv nfsargsp->flags &= ~
CVS commit: src/sbin/ifconfig
Module Name:src Committed By: roy Date: Mon Oct 5 16:17:05 UTC 2020 Modified Files: src/sbin/ifconfig: media.c Log Message: ifconfig: Warn once more if media supported but no types This reverts media.c -r1.7 To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sbin/ifconfig/media.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/ifconfig/media.c diff -u src/sbin/ifconfig/media.c:1.10 src/sbin/ifconfig/media.c:1.11 --- src/sbin/ifconfig/media.c:1.10 Tue Sep 22 14:14:17 2020 +++ src/sbin/ifconfig/media.c Mon Oct 5 16:17:05 2020 @@ -1,6 +1,6 @@ #include #ifndef lint -__RCSID("$NetBSD: media.c,v 1.10 2020/09/22 14:14:17 roy Exp $"); +__RCSID("$NetBSD: media.c,v 1.11 2020/10/05 16:17:05 roy Exp $"); #endif /* not lint */ #include @@ -426,25 +426,25 @@ media_status(int media_type, int link_st /* Interface link status is queried through SIOCGIFMEDIA. * Not all interfaces have actual media. */ - if (ifmr.ifm_count != 0) { - media_list = calloc(ifmr.ifm_count, sizeof(int)); - if (media_list == NULL) - err(EXIT_FAILURE, "malloc"); - ifmr.ifm_ulist = media_list; - - if (prog_ioctl(s, SIOCGIFMEDIA, &ifmr) == -1) - err(EXIT_FAILURE, "SIOCGIFMEDIA"); - - printf("\tmedia: %s ", get_media_type_string(ifmr.ifm_current)); - print_media_word(ifmr.ifm_current, " "); - if (ifmr.ifm_active != ifmr.ifm_current) { - printf(" ("); - print_media_word(ifmr.ifm_active, " "); - printf(")"); - } - printf("\n"); - } else - media_list = NULL; + if (ifmr.ifm_count == 0) + warnx("%s: no media types?", ifname); + + media_list = calloc(ifmr.ifm_count, sizeof(int)); + if (media_list == NULL) + err(EXIT_FAILURE, "malloc"); + ifmr.ifm_ulist = media_list; + + if (prog_ioctl(s, SIOCGIFMEDIA, &ifmr) == -1) + err(EXIT_FAILURE, "SIOCGIFMEDIA"); + + printf("\tmedia: %s ", get_media_type_string(ifmr.ifm_current)); + print_media_word(ifmr.ifm_current, " "); + if (ifmr.ifm_active != ifmr.ifm_current) { + printf(" ("); + print_media_word(ifmr.ifm_active, " "); + printf(")"); + } + printf("\n"); if (ifmr.ifm_status & IFM_STATUS_VALID) print_media_status(IFM_TYPE(ifmr.ifm_current), ifmr.ifm_status);
CVS commit: src/sbin/ifconfig
Module Name:src Committed By: roy Date: Mon Oct 5 17:29:22 UTC 2020 Modified Files: src/sbin/ifconfig: media.c Log Message: Minor correction to prior To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sbin/ifconfig/media.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/ifconfig/media.c diff -u src/sbin/ifconfig/media.c:1.11 src/sbin/ifconfig/media.c:1.12 --- src/sbin/ifconfig/media.c:1.11 Mon Oct 5 16:17:05 2020 +++ src/sbin/ifconfig/media.c Mon Oct 5 17:29:22 2020 @@ -1,6 +1,6 @@ #include #ifndef lint -__RCSID("$NetBSD: media.c,v 1.11 2020/10/05 16:17:05 roy Exp $"); +__RCSID("$NetBSD: media.c,v 1.12 2020/10/05 17:29:22 roy Exp $"); #endif /* not lint */ #include @@ -424,10 +424,10 @@ media_status(int media_type, int link_st return; } - /* Interface link status is queried through SIOCGIFMEDIA. - * Not all interfaces have actual media. */ - if (ifmr.ifm_count == 0) + if (ifmr.ifm_count == 0) { warnx("%s: no media types?", ifname); + return; + } media_list = calloc(ifmr.ifm_count, sizeof(int)); if (media_list == NULL)
CVS commit: src/sbin/ccdconfig
Module Name:src Committed By: mlelstv Date: Tue Oct 6 18:47:08 UTC 2020 Modified Files: src/sbin/ccdconfig: ccdconfig.c Log Message: Use raw device for configuring units. This is necessary as having a block device opened prevents autodiscovery of wedges. To generate a diff of this commit: cvs rdiff -u -r1.57 -r1.58 src/sbin/ccdconfig/ccdconfig.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/ccdconfig/ccdconfig.c diff -u src/sbin/ccdconfig/ccdconfig.c:1.57 src/sbin/ccdconfig/ccdconfig.c:1.58 --- src/sbin/ccdconfig/ccdconfig.c:1.57 Sun Sep 6 02:34:30 2020 +++ src/sbin/ccdconfig/ccdconfig.c Tue Oct 6 18:47:07 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: ccdconfig.c,v 1.57 2020/09/06 02:34:30 mrg Exp $ */ +/* $NetBSD: ccdconfig.c,v 1.58 2020/10/06 18:47:07 mlelstv Exp $ */ /*- * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc. @@ -33,7 +33,7 @@ #ifndef lint __COPYRIGHT("@(#) Copyright (c) 1996, 1997\ The NetBSD Foundation, Inc. All rights reserved."); -__RCSID("$NetBSD: ccdconfig.c,v 1.57 2020/09/06 02:34:30 mrg Exp $"); +__RCSID("$NetBSD: ccdconfig.c,v 1.58 2020/10/06 18:47:07 mlelstv Exp $"); #endif #include @@ -391,24 +391,38 @@ pathtounit(char *path, int *unitp) static char * resolve_ccdname(char *name) { - char c, *path; + char *path, *buf; + const char *p; + char c; size_t len; int rawpart; if (name[0] == '/' || name[0] == '.') { /* Assume they gave the correct pathname. */ - return estrdup(name); - } + path = estrdup(name); + } else { - len = strlen(name); - c = name[len - 1]; + len = strlen(name); + c = name[len - 1]; - if (isdigit((unsigned char)c)) { - if ((rawpart = getrawpartition()) < 0) - return NULL; - easprintf(&path, "/dev/%s%c", name, 'a' + rawpart); - } else - easprintf(&path, "/dev/%s", name); + if (isdigit((unsigned char)c)) { + if ((rawpart = getrawpartition()) < 0) +return NULL; + easprintf(&path, "/dev/%s%c", name, 'a' + rawpart); + } else + easprintf(&path, "/dev/%s", name); + } + + /* + * Convert to raw device if possible. + */ + buf = emalloc(MAXPATHLEN); + p = getdiskrawname(buf, MAXPATHLEN, path); + if (p) { + free(path); + path = estrdup(p); + } + free(buf); return path; } @@ -562,6 +576,7 @@ dump_ccd(int argc, char **argv, int acti continue; } errs += printccdinfo(i); + free(ccd); } return errs; }
CVS commit: src/sbin/ifconfig
Module Name:src Committed By: roy Date: Sun Oct 11 21:32:37 UTC 2020 Modified Files: src/sbin/ifconfig: util.c Log Message: ifconfig: if SIOCGLIFADDR fails, continue to the next address To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/sbin/ifconfig/util.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/ifconfig/util.c diff -u src/sbin/ifconfig/util.c:1.19 src/sbin/ifconfig/util.c:1.20 --- src/sbin/ifconfig/util.c:1.19 Tue Oct 1 10:52:53 2019 +++ src/sbin/ifconfig/util.c Sun Oct 11 21:32:37 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: util.c,v 1.19 2019/10/01 10:52:53 kardel Exp $ */ +/* $NetBSD: util.c,v 1.20 2020/10/11 21:32:37 roy Exp $ */ /*- * Copyright (c) 2008 David Young. All rights reserved. @@ -27,7 +27,7 @@ #include #ifndef lint -__RCSID("$NetBSD: util.c,v 1.19 2019/10/01 10:52:53 kardel Exp $"); +__RCSID("$NetBSD: util.c,v 1.20 2020/10/11 21:32:37 roy Exp $"); #endif /* not lint */ #include @@ -275,8 +275,10 @@ print_link_addresses(prop_dictionary_t e iflr.flags = IFLR_PREFIX; iflr.prefixlen = sdl->sdl_alen * NBBY; - if (prog_ioctl(s, SIOCGLIFADDR, &iflr) == -1) + if (prog_ioctl(s, SIOCGLIFADDR, &iflr) == -1) { warn("%s: ioctl SIOCGLIFADDR", __func__); + continue; + } if (((iflr.flags & IFLR_ACTIVE) != 0) != print_active_only) continue;
CVS commit: src/sbin/ifconfig
Module Name:src Committed By: roy Date: Wed Oct 14 13:37:14 UTC 2020 Modified Files: src/sbin/ifconfig: ifconfig.c media.c media.h Log Message: ifconfig: go back to using direct ioctls rather than data from getifaddrs AF_LINK may not be the first address returned for the interface. Technically, it *might* not even exist on the interface even though other families do. This is likely a driver bug if this really is the case though. As such it's just easier to use direct ioctls rather than thump around getifaddrs results. As it stands, the code makes a lot of getifaddrs calls anyway, so an extra ioctl or two won't break the bank. To generate a diff of this commit: cvs rdiff -u -r1.247 -r1.248 src/sbin/ifconfig/ifconfig.c cvs rdiff -u -r1.12 -r1.13 src/sbin/ifconfig/media.c cvs rdiff -u -r1.2 -r1.3 src/sbin/ifconfig/media.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/ifconfig/ifconfig.c diff -u src/sbin/ifconfig/ifconfig.c:1.247 src/sbin/ifconfig/ifconfig.c:1.248 --- src/sbin/ifconfig/ifconfig.c:1.247 Mon Sep 28 13:50:22 2020 +++ src/sbin/ifconfig/ifconfig.c Wed Oct 14 13:37:14 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: ifconfig.c,v 1.247 2020/09/28 13:50:22 roy Exp $ */ +/* $NetBSD: ifconfig.c,v 1.248 2020/10/14 13:37:14 roy Exp $ */ /*- * Copyright (c) 1997, 1998, 2000 The NetBSD Foundation, Inc. @@ -63,7 +63,7 @@ #ifndef lint __COPYRIGHT("@(#) Copyright (c) 1983, 1993\ The Regents of the University of California. All rights reserved."); -__RCSID("$NetBSD: ifconfig.c,v 1.247 2020/09/28 13:50:22 roy Exp $"); +__RCSID("$NetBSD: ifconfig.c,v 1.248 2020/10/14 13:37:14 roy Exp $"); #endif /* not lint */ #include @@ -135,8 +135,7 @@ static int setlinkstr(prop_dictionary_t, static int unsetlinkstr(prop_dictionary_t, prop_dictionary_t); static int setifdescr(prop_dictionary_t, prop_dictionary_t); static int unsetifdescr(prop_dictionary_t, prop_dictionary_t); -static void status(const struct sockaddr_dl *, const void *, -prop_dictionary_t, prop_dictionary_t); +static void status(prop_dictionary_t, prop_dictionary_t); __dead static void usage(void); static const struct kwinst ifflagskw[] = { @@ -850,9 +849,6 @@ void printall(const char *ifname, prop_dictionary_t env0) { struct ifaddrs *ifap, *ifa; - struct ifreq ifr; - const struct sockaddr_dl *sdl = NULL; - const struct if_data *ifi = NULL; prop_dictionary_t env, oenv; int idx; char *p; @@ -872,19 +868,8 @@ printall(const char *ifname, prop_dictio p = NULL; idx = 0; for (ifa = ifap; ifa; ifa = ifa->ifa_next) { - memset(&ifr, 0, sizeof(ifr)); - estrlcpy(ifr.ifr_name, ifa->ifa_name, sizeof(ifr.ifr_name)); - if (sizeof(ifr.ifr_addr) >= ifa->ifa_addr->sa_len) { - memcpy(&ifr.ifr_addr, ifa->ifa_addr, - ifa->ifa_addr->sa_len); - } - if (ifname != NULL && strcmp(ifname, ifa->ifa_name) != 0) continue; - if (ifa->ifa_addr->sa_family == AF_LINK) { - sdl = (const struct sockaddr_dl *)ifa->ifa_addr; - ifi = (const struct if_data *)ifa->ifa_data; - } if (p && strcmp(p, ifa->ifa_name) == 0) continue; if (!prop_dictionary_set_string(env, "if", ifa->ifa_name)) @@ -898,8 +883,7 @@ printall(const char *ifname, prop_dictio if (uflag && (ifa->ifa_flags & IFF_UP) == 0) continue; - if (sflag && (ifi == NULL || - ifi->ifi_link_state == LINK_STATE_DOWN)) + if (sflag && carrier(env) == LINK_STATE_DOWN) continue; idx++; /* @@ -912,9 +896,7 @@ printall(const char *ifname, prop_dictio continue; } - status(sdl, ifa->ifa_data, env, oenv); - sdl = NULL; - ifi = NULL; + status(env, oenv); } if (lflag) printf("\n"); @@ -1256,13 +1238,12 @@ print_human_bytes(bool humanize, uint64_ #define MAX_PRINT_LEN 58 /* XXX need a better way to determine this! */ void -status(const struct sockaddr_dl *sdl, const void *ifa_data, -prop_dictionary_t env, prop_dictionary_t oenv) +status(prop_dictionary_t env, prop_dictionary_t oenv) { - const struct if_data *ifi = ifa_data; status_func_t *status_f; statistics_func_t *statistics_f; struct ifdatareq ifdr; + struct if_data *ifi; struct ifreq ifr; struct ifdrv ifdrv; char fbuf[BUFSIZ]; @@ -1351,18 +1332,16 @@ status(const struct sockaddr_dl *sdl, co free(p); } - media_status(sdl->sdl_type, ifi->ifi_link_state, env, oenv); + media_status(env, oenv); if (!vflag && !zflag) goto proto_status; /* We already have if_data from SIOCGIFDATA in ifa_data. */ - if (zflag) { - estrlcpy(ifdr.ifdr_name, ifname, sizeof(ifdr.ifdr_name)); - if (prog_ioctl(s, SIOCZIFDATA, &ifdr) == -1) - err(EXIT_FAILURE, "SIOCZIFDATA"); - ifi = &ifdr.ifdr_data; - } + estrlcpy(ifdr.ifdr_name, ifname, sizeof(ifdr.ifdr_name)); + if (prog_ioctl(s, zflag ? SIOCZIFDATA : SIOCGIFDATA, &ifdr) == -1) + err(EXIT_FAILURE, zflag ? "SIOCZIFDATA" : "SIOCGIFDATA"); + ifi = &ifdr.ifdr_data; print_plural("\tinput: ", ifi->
CVS commit: src/sbin/mount
Module Name:src Committed By: mlelstv Date: Sun Oct 18 10:57:30 UTC 2020 Modified Files: src/sbin/mount: mount.c Log Message: Make command line arguments -r and -w actually override defaults from fstab, previously -w would only cancel a preceeding -r. No longer strip -o rw. To generate a diff of this commit: cvs rdiff -u -r1.102 -r1.103 src/sbin/mount/mount.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/mount/mount.c diff -u src/sbin/mount/mount.c:1.102 src/sbin/mount/mount.c:1.103 --- src/sbin/mount/mount.c:1.102 Sun Oct 9 21:03:43 2016 +++ src/sbin/mount/mount.c Sun Oct 18 10:57:30 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: mount.c,v 1.102 2016/10/09 21:03:43 christos Exp $ */ +/* $NetBSD: mount.c,v 1.103 2020/10/18 10:57:30 mlelstv Exp $ */ /* * Copyright (c) 1980, 1989, 1993, 1994 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19 #if 0 static char sccsid[] = "@(#)mount.c 8.25 (Berkeley) 5/8/95"; #else -__RCSID("$NetBSD: mount.c,v 1.102 2016/10/09 21:03:43 christos Exp $"); +__RCSID("$NetBSD: mount.c,v 1.103 2020/10/18 10:57:30 mlelstv Exp $"); #endif #endif /* not lint */ @@ -94,6 +94,11 @@ static const struct opt { __MNT_FLAGS }; +#define FLG_UPDATE 1 +#define FLG_RDONLY 2 +#define FLG_RDWRITE 4 +#define FLG_FORCE 8 + static const char ffs_fstype[] = "ffs"; int @@ -128,14 +133,14 @@ main(int argc, char *argv[]) debug = 1; break; case 'f': - init_flags |= MNT_FORCE; + init_flags |= FLG_FORCE; break; case 'o': if (*optarg) catopt(&options, optarg); break; case 'r': - init_flags |= MNT_RDONLY; + init_flags |= FLG_RDONLY; break; case 't': if (vfslist != NULL) @@ -145,13 +150,13 @@ main(int argc, char *argv[]) vfstype = optarg; break; case 'u': - init_flags |= MNT_UPDATE; + init_flags |= FLG_UPDATE; break; case 'v': verbose++; break; case 'w': - init_flags &= ~MNT_RDONLY; + init_flags |= FLG_RDWRITE; break; case '?': default: @@ -218,7 +223,7 @@ main(int argc, char *argv[]) */ canonical_path = realpath(*argv, canonical_path_buf); - if (init_flags & MNT_UPDATE) { + if (init_flags & FLG_UPDATE) { /* * Try looking up the canonical path first, * then try exactly what the user entered. @@ -395,7 +400,7 @@ mountfs(const char *vfstype, const char catopt(&optbuf, "rw"); if (getargs == 0 && strcmp(name, "/") == 0 && !hasopt(optbuf, "union")) - flags |= MNT_UPDATE; + flags |= FLG_UPDATE; else if (skipmounted) { if ((numfs = getmntinfo(&sfp, MNT_WAIT)) == 0) { warn("getmntinfo"); @@ -431,12 +436,15 @@ mountfs(const char *vfstype, const char } } } - if (flags & MNT_FORCE) + if (flags & FLG_FORCE) catopt(&optbuf, "force"); - if (flags & MNT_RDONLY) + if (flags & FLG_RDONLY) catopt(&optbuf, "ro"); + /* make -w override -r */ + if (flags & FLG_RDWRITE) + catopt(&optbuf, "rw"); - if (flags & MNT_UPDATE) { + if (flags & FLG_UPDATE) { catopt(&optbuf, "update"); /* Figure out the fstype only if we defaulted to ffs */ if (vfstype == ffs_fstype && statvfs(name, &sf) != -1) @@ -690,7 +698,7 @@ mangle(char *options, int *argcp, const *p = '\0'; argv[argc++] = p+1; } - } else if (strcmp(p, "rw") != 0) { + } else { argv[argc++] = "-o"; argv[argc++] = p; }
CVS commit: src/sbin/mount
Module Name:src Committed By: nia Date: Sat Oct 24 10:51:34 UTC 2020 Modified Files: src/sbin/mount: mount.8 Log Message: file systems that are used as what spools? To generate a diff of this commit: cvs rdiff -u -r1.87 -r1.88 src/sbin/mount/mount.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/mount/mount.8 diff -u src/sbin/mount/mount.8:1.87 src/sbin/mount/mount.8:1.88 --- src/sbin/mount/mount.8:1.87 Tue Jan 9 09:15:57 2018 +++ src/sbin/mount/mount.8 Sat Oct 24 10:51:34 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: mount.8,v 1.87 2018/01/09 09:15:57 wiz Exp $ +.\" $NetBSD: mount.8,v 1.88 2020/10/24 10:51:34 nia Exp $ .\" .\" Copyright (c) 1980, 1989, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" @(#)mount.8 8.8 (Berkeley) 6/16/94 .\" -.Dd January 8, 2018 +.Dd October 24, 2020 .Dt MOUNT 8 .Os .Sh NAME @@ -239,8 +239,8 @@ list of file systems shown by default wi .Xr df 1 . .It Cm noatime Never update the access time field for files. -This option is useful for optimizing read performance on file systems -that are used as news spools. +This option is useful for optimizing read performance on file systems, +and avoiding excess writes on flash-based file systems. .It Cm noauto This file system should be skipped when mount is run with the .Fl a
CVS commit: src/sbin/brconfig
Module Name:src Committed By: maxv Date: Sun Jul 19 14:39:42 UTC 2020 Modified Files: src/sbin/brconfig: brconfig.8 Log Message: sync with reality To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/sbin/brconfig/brconfig.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/brconfig/brconfig.8 diff -u src/sbin/brconfig/brconfig.8:1.18 src/sbin/brconfig/brconfig.8:1.19 --- src/sbin/brconfig/brconfig.8:1.18 Mon Jan 5 00:36:23 2015 +++ src/sbin/brconfig/brconfig.8 Sun Jul 19 14:39:42 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: brconfig.8,v 1.18 2015/01/05 00:36:23 msaitoh Exp $ +.\" $NetBSD: brconfig.8,v 1.19 2020/07/19 14:39:42 maxv Exp $ .\" .\" Copyright 2001 Wasabi Systems, Inc. .\" All rights reserved. @@ -33,7 +33,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd January 5, 2015 +.Dd July 19, 2020 .Dt BRCONFIG 8 .Os .Sh NAME @@ -152,9 +152,7 @@ The current implementation passes all ARP and RARP packets through the bridge while filtering IP and IPv6 packets through the configured packet filter, such as -.Xr ipf 4 -or -.Xr pf 4 . +.Xr npf 7 . Other packet types are blocked. .It Cm learn Ar interface Mark an interface as a @@ -259,7 +257,7 @@ create .Xr pf 4 , .Xr ifconfig.if 5 , .Xr ifconfig 8 , -.Xr ipf 8 , +.Xr npf 7 , .Xr pfil 9 .Sh HISTORY The
CVS commit: src/sbin/brconfig
Module Name:src Committed By: wiz Date: Sun Jul 19 14:43:35 UTC 2020 Modified Files: src/sbin/brconfig: brconfig.8 Log Message: Remove unused Pp. Sort SEE ALSO. To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/sbin/brconfig/brconfig.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/brconfig/brconfig.8 diff -u src/sbin/brconfig/brconfig.8:1.19 src/sbin/brconfig/brconfig.8:1.20 --- src/sbin/brconfig/brconfig.8:1.19 Sun Jul 19 14:39:42 2020 +++ src/sbin/brconfig/brconfig.8 Sun Jul 19 14:43:35 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: brconfig.8,v 1.19 2020/07/19 14:39:42 maxv Exp $ +.\" $NetBSD: brconfig.8,v 1.20 2020/07/19 14:43:35 wiz Exp $ .\" .\" Copyright 2001 Wasabi Systems, Inc. .\" All rights reserved. @@ -84,7 +84,6 @@ All other operations require that a brid If a bridge is specified with no sub-commands, the status of that bridge is displayed. The following sub-commands are available: -.Pp .Bl -tag -width indent .It Cm up Start forwarding packets on the bridge. @@ -256,8 +255,8 @@ create .Xr bridge 4 , .Xr pf 4 , .Xr ifconfig.if 5 , -.Xr ifconfig 8 , .Xr npf 7 , +.Xr ifconfig 8 , .Xr pfil 9 .Sh HISTORY The
CVS commit: src/sbin/gpt
Module Name:src Committed By: christos Date: Mon Jul 27 20:54:18 UTC 2020 Modified Files: src/sbin/gpt: gpt.8 Log Message: catch up with source rename of fbsd-zfs -> zfs To generate a diff of this commit: cvs rdiff -u -r1.73 -r1.74 src/sbin/gpt/gpt.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/gpt/gpt.8 diff -u src/sbin/gpt/gpt.8:1.73 src/sbin/gpt/gpt.8:1.74 --- src/sbin/gpt/gpt.8:1.73 Sun May 24 16:59:16 2020 +++ src/sbin/gpt/gpt.8 Mon Jul 27 16:54:18 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: gpt.8,v 1.73 2020/05/24 20:59:16 wiz Exp $ +.\" $NetBSD: gpt.8,v 1.74 2020/07/27 20:54:18 christos Exp $ .\" .\" Copyright (c) 2002 Marcel Moolenaar .\" All rights reserved. @@ -26,7 +26,7 @@ .\" .\" $FreeBSD: src/sbin/gpt/gpt.8,v 1.17 2006/06/22 22:22:32 marcel Exp $ .\" -.Dd May 24, 2020 +.Dd July 27, 2020 .Dt GPT 8 .Os .Sh NAME @@ -203,8 +203,9 @@ UFS/UFS2 .It Cm fbsd-vinum .Fx vinum -.It Cm fbsd-zfs -.Fx +.It Cm zfs +.Fx , +.Nx ZFS .It Cm linux-data Linux data
CVS commit: src/sbin/tunefs
Module Name:src Committed By: christos Date: Sat Aug 8 11:44:55 UTC 2020 Modified Files: src/sbin/tunefs: tunefs.c Log Message: Find the if a device points to an active filesystem by looking at the mount list. To generate a diff of this commit: cvs rdiff -u -r1.52 -r1.53 src/sbin/tunefs/tunefs.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/tunefs/tunefs.c diff -u src/sbin/tunefs/tunefs.c:1.52 src/sbin/tunefs/tunefs.c:1.53 --- src/sbin/tunefs/tunefs.c:1.52 Sat May 16 14:31:47 2020 +++ src/sbin/tunefs/tunefs.c Sat Aug 8 07:44:55 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: tunefs.c,v 1.52 2020/05/16 18:31:47 christos Exp $ */ +/* $NetBSD: tunefs.c,v 1.53 2020/08/08 11:44:55 christos Exp $ */ /* * Copyright (c) 1983, 1993 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19 #if 0 static char sccsid[] = "@(#)tunefs.c 8.3 (Berkeley) 5/3/95"; #else -__RCSID("$NetBSD: tunefs.c,v 1.52 2020/05/16 18:31:47 christos Exp $"); +__RCSID("$NetBSD: tunefs.c,v 1.53 2020/08/08 11:44:55 christos Exp $"); #endif #endif /* not lint */ @@ -95,6 +95,7 @@ static void bread(daddr_t, char *, int, static void change_log_info(long long); static void getsb(struct fs *, const char *); static int openpartition(const char *, int, char *, size_t); +static int isactive(int, struct statvfs *); static void show_log_info(void); __dead static void usage(void); @@ -233,9 +234,9 @@ main(int argc, char *argv[]) fi = openpartition(special, openflags, device, sizeof(device)); special = device; } - active = fstatvfs(fi, &sfs) != -1; if (fi == -1) err(1, "%s", special); + active = !Fflag && isactive(fi, &sfs); getsb(&sblock, special); #define CHANGEVAL(old, new, type, suffix) do\ @@ -469,6 +470,35 @@ main(int argc, char *argv[]) exit(0); } +static int +isactive(int fd, struct statvfs *rsfs) +{ + struct stat st0, st; + struct statvfs *sfs; + int n; + + if (fstat(fd, &st0) == -1) { + warn("stat"); + return 0; + } + + if ((n = getmntinfo(&sfs, 0)) == -1) { + warn("getmntinfo"); + return 0; + } + + for (int i = 0; i < n; i++) { + if (stat(sfs[i].f_mntfromname, &st) == -1) + continue; + if (st.st_rdev != st0.st_rdev) + continue; + *rsfs = sfs[i]; + return 1; + + } + return 0; +} + static void show_log_info(void) {
CVS commit: src/sbin/route
Module Name:src Committed By: christos Date: Sat Aug 29 19:27:08 UTC 2020 Modified Files: src/sbin/route: route.8 Log Message: Document 'L' To generate a diff of this commit: cvs rdiff -u -r1.61 -r1.62 src/sbin/route/route.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/route/route.8 diff -u src/sbin/route/route.8:1.61 src/sbin/route/route.8:1.62 --- src/sbin/route/route.8:1.61 Tue Jul 31 17:22:09 2018 +++ src/sbin/route/route.8 Sat Aug 29 15:27:08 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: route.8,v 1.61 2018/07/31 21:22:09 sevan Exp $ +.\" $NetBSD: route.8,v 1.62 2020/08/29 19:27:08 christos Exp $ .\" .\" Copyright (c) 1983, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" @(#)route.8 8.4 (Berkeley) 6/1/94 .\" -.Dd July 31, 2018 +.Dd August 29, 2020 .Dt ROUTE 8 .Os .Sh NAME @@ -310,6 +310,7 @@ by indicating the following correspondin .It Li D Ta "" Ta " RTF_DYNAMIC" Ta created dynamically (redirect) .It Li G Ta "" Ta " RTF_GATEWAY" Ta forwarded to dest by intermediary .It Li H Ta "" Ta " RTF_HOST" Ta host entry (net otherwise) +.It Li L Ta "" Ta " RTF_LLDATA" Ta local link, generated by ARP or NDP .It Li l Ta "" Ta " RTF_LOCAL" Ta Route represents a local address .It Li M Ta "" Ta " RTF_MODIFIED" Ta modified dynamically (redirect) .It Li p Ta -proxy Ta " RTF_ANNOUNCE" Ta make entry a link level proxy
CVS commit: src/sbin/route
Module Name:src Committed By: christos Date: Sat Aug 29 19:27:40 UTC 2020 Modified Files: src/sbin/route: rtutil.c Log Message: Instead of defining RTF_LLINFO, use RTF_LLDATA To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sbin/route/rtutil.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/route/rtutil.c diff -u src/sbin/route/rtutil.c:1.10 src/sbin/route/rtutil.c:1.11 --- src/sbin/route/rtutil.c:1.10 Thu Jul 13 04:26:29 2017 +++ src/sbin/route/rtutil.c Sat Aug 29 15:27:40 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: rtutil.c,v 1.10 2017/07/13 08:26:29 manu Exp $ */ +/* $NetBSD: rtutil.c,v 1.11 2020/08/29 19:27:40 christos Exp $ */ /* $OpenBSD: show.c,v 1.1 2006/05/27 19:16:37 claudio Exp $ */ /* @@ -59,12 +59,6 @@ #include "prog_ops.h" #include "rtutil.h" -/* - * Keep to handle ARP/NDP entries (fake routes) - * for backward compatibility. - */ -#define RTF_LLINFO 0x400 - #define PLEN(LONG_BIT / 4 + 2) #define PFKEYV2_CHUNK sizeof(u_int64_t) static char *link_print(const struct sockaddr *); @@ -89,7 +83,7 @@ static const struct bits bits[] = { /* { RTF_CLONING, 'C' }, */ { RTF_CONNECTED, 'C' }, /* { RTF_XRESOLVE, 'X' }, */ - { RTF_LLINFO, 'L' }, + { RTF_LLDATA, 'L' }, { RTF_STATIC, 'S' }, { RTF_PROTO1, '1' }, { RTF_PROTO2, '2' }, @@ -268,7 +262,7 @@ p_rtentry(struct rt_msghdr *rtm, int fla char ifbuf[IF_NAMESIZE]; #endif - if ((flags & RT_LFLAG) && (rtm->rtm_flags & RTF_LLINFO)) + if ((flags & RT_LFLAG) && (rtm->rtm_flags & RTF_LLDATA)) return; if (old_af != sa->sa_family) {
CVS commit: src/sbin/route
Module Name:src Committed By: christos Date: Sat Aug 29 19:28:32 UTC 2020 Modified Files: src/sbin/route: show.c Log Message: Make the "interesting" flags match the netstat ones, so: route show -inet netstat -r -f inet outputs match. To generate a diff of this commit: cvs rdiff -u -r1.50 -r1.51 src/sbin/route/show.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/route/show.c diff -u src/sbin/route/show.c:1.50 src/sbin/route/show.c:1.51 --- src/sbin/route/show.c:1.50 Mon Apr 4 03:37:07 2016 +++ src/sbin/route/show.c Sat Aug 29 15:28:32 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: show.c,v 1.50 2016/04/04 07:37:07 ozaki-r Exp $ */ +/* $NetBSD: show.c,v 1.51 2020/08/29 19:28:32 christos Exp $ */ /* * Copyright (c) 1983, 1988, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "from: @(#)route.c 8.3 (Berkeley) 3/9/94"; #else -__RCSID("$NetBSD: show.c,v 1.50 2016/04/04 07:37:07 ozaki-r Exp $"); +__RCSID("$NetBSD: show.c,v 1.51 2020/08/29 19:28:32 christos Exp $"); #endif #endif /* not lint */ @@ -132,8 +132,10 @@ void show(int argc, char *const *argv, int flags) { int af, rflags; - static int interesting = RTF_UP | RTF_GATEWAY | RTF_HOST | - RTF_REJECT | RTF_LOCAL | RTF_BROADCAST; + static int interesting = RTF_ANNOUNCE | RTF_BLACKHOLE | RTF_BROADCAST | + RTF_CONNECTED | RTF_DYNAMIC | RTF_GATEWAY | RTF_HOST | RTF_LLDATA | + RTF_LOCAL | RTF_MODIFIED | RTF_PROTO1 | RTF_PROTO2 | RTF_REJECT | + RTF_STATIC | RTF_UP; parse_show_opts(argc, argv, &af, &rflags, NULL, true); p_rttables(af, flags, rflags, interesting);
CVS commit: src/sbin/restore
Module Name:src Committed By: bouyer Date: Thu Sep 3 19:31:34 UTC 2020 Modified Files: src/sbin/restore: tape.c Log Message: If we hit an unknown header type (likely to be a corrupt record), and the user choose to not abort, skip to the next header instead of trying to use it. This allowed me to recover files from a corrupt dump, instead of getting a segfault. To generate a diff of this commit: cvs rdiff -u -r1.68 -r1.69 src/sbin/restore/tape.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/restore/tape.c diff -u src/sbin/restore/tape.c:1.68 src/sbin/restore/tape.c:1.69 --- src/sbin/restore/tape.c:1.68 Mon Mar 2 03:17:24 2015 +++ src/sbin/restore/tape.c Thu Sep 3 19:31:34 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: tape.c,v 1.68 2015/03/02 03:17:24 enami Exp $ */ +/* $NetBSD: tape.c,v 1.69 2020/09/03 19:31:34 bouyer Exp $ */ /* * Copyright (c) 1983, 1993 @@ -39,7 +39,7 @@ #if 0 static char sccsid[] = "@(#)tape.c 8.9 (Berkeley) 5/1/95"; #else -__RCSID("$NetBSD: tape.c,v 1.68 2015/03/02 03:17:24 enami Exp $"); +__RCSID("$NetBSD: tape.c,v 1.69 2020/09/03 19:31:34 bouyer Exp $"); #endif #endif /* not lint */ @@ -1384,6 +1384,7 @@ findinode(struct s_spcl *header) top: do { if (header->c_magic != FS_UFS2_MAGIC) { +skip: skipcnt++; while (gethead(header) == FAIL || header->c_date != dumpdate) @@ -1438,7 +1439,8 @@ findinode(struct s_spcl *header) default: panic("unknown tape header type %d\n", spcl.c_type); - break; + fprintf(stderr, "skiping to next header\n"); + goto skip; } } while (header->c_type == TS_ADDR);
CVS commit: src/sbin/ccdconfig
Module Name:src Committed By: mrg Date: Sun Sep 6 02:34:30 UTC 2020 Modified Files: src/sbin/ccdconfig: ccdconfig.c Log Message: rework error message to never call printf() %s with NULL. To generate a diff of this commit: cvs rdiff -u -r1.56 -r1.57 src/sbin/ccdconfig/ccdconfig.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/ccdconfig/ccdconfig.c diff -u src/sbin/ccdconfig/ccdconfig.c:1.56 src/sbin/ccdconfig/ccdconfig.c:1.57 --- src/sbin/ccdconfig/ccdconfig.c:1.56 Sun Dec 7 10:44:34 2014 +++ src/sbin/ccdconfig/ccdconfig.c Sun Sep 6 02:34:30 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: ccdconfig.c,v 1.56 2014/12/07 10:44:34 mlelstv Exp $ */ +/* $NetBSD: ccdconfig.c,v 1.57 2020/09/06 02:34:30 mrg Exp $ */ /*- * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc. @@ -33,7 +33,7 @@ #ifndef lint __COPYRIGHT("@(#) Copyright (c) 1996, 1997\ The NetBSD Foundation, Inc. All rights reserved."); -__RCSID("$NetBSD: ccdconfig.c,v 1.56 2014/12/07 10:44:34 mlelstv Exp $"); +__RCSID("$NetBSD: ccdconfig.c,v 1.57 2020/09/06 02:34:30 mrg Exp $"); #endif #include @@ -245,7 +245,7 @@ do_single(int argc, char **argv, int act cp = strdup(buf); if (cp == NULL) { - warn("%s", cp); + warn("strdup failed"); goto error; }
CVS commit: src/sbin/amrctl
Module Name:src Committed By: mrg Date: Sun Sep 6 02:34:03 UTC 2020 Modified Files: src/sbin/amrctl: amrctl.c Log Message: avoid calling printf() %s with NULL. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sbin/amrctl/amrctl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/amrctl/amrctl.c diff -u src/sbin/amrctl/amrctl.c:1.11 src/sbin/amrctl/amrctl.c:1.12 --- src/sbin/amrctl/amrctl.c:1.11 Mon Aug 27 00:36:03 2018 +++ src/sbin/amrctl/amrctl.c Sun Sep 6 02:34:02 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: amrctl.c,v 1.11 2018/08/27 00:36:03 sevan Exp $ */ +/* $NetBSD: amrctl.c,v 1.12 2020/09/06 02:34:02 mrg Exp $ */ /*- * Copyright (c) 2002, Pierre David @@ -29,7 +29,7 @@ #include #ifndef lint -__RCSID("$NetBSD: amrctl.c,v 1.11 2018/08/27 00:36:03 sevan Exp $"); +__RCSID("$NetBSD: amrctl.c,v 1.12 2020/09/06 02:34:02 mrg Exp $"); #endif #include @@ -453,7 +453,8 @@ describe_one_volume(int ldrv, int verbos printf("Logical volume %d\t", ldrv); statestr = describe_state(verbosity, state); - printf("%s ", statestr); + if (statestr) + printf("%s ", statestr); printf("(%.2f GB, RAID%d", szgb, raid_level); if (verbosity >= 1) { describe_property(prop, propstr);
CVS commit: src/sbin/raidctl
Module Name:src Committed By: mrg Date: Sun Sep 6 05:31:46 UTC 2020 Modified Files: src/sbin/raidctl: rf_configure.c Log Message: avoid trying to printf() a NULL as %s. fixes likely bug. To generate a diff of this commit: cvs rdiff -u -r1.33 -r1.34 src/sbin/raidctl/rf_configure.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/raidctl/rf_configure.c diff -u src/sbin/raidctl/rf_configure.c:1.33 src/sbin/raidctl/rf_configure.c:1.34 --- src/sbin/raidctl/rf_configure.c:1.33 Thu Jan 18 00:32:49 2018 +++ src/sbin/raidctl/rf_configure.c Sun Sep 6 05:31:46 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: rf_configure.c,v 1.33 2018/01/18 00:32:49 mrg Exp $ */ +/* $NetBSD: rf_configure.c,v 1.34 2020/09/06 05:31:46 mrg Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. @@ -49,7 +49,7 @@ #include #ifndef lint -__RCSID("$NetBSD: rf_configure.c,v 1.33 2018/01/18 00:32:49 mrg Exp $"); +__RCSID("$NetBSD: rf_configure.c,v 1.34 2020/09/06 05:31:46 mrg Exp $"); #endif @@ -286,7 +286,7 @@ rf_MakeConfig(char *configname, RF_Confi b = getfsspecname(b1, sizeof(b1), buf); if (b == NULL) { warnx("Config file error: warning: unable to get " - "device file for spare disk %d: %s", c, b); + "device file for spare disk %d: %s", c, buf); b = buf; }
CVS commit: src/sbin/ifconfig
Module Name:src Committed By: martin Date: Mon Mar 1 16:47:48 UTC 2021 Modified Files: src/sbin/ifconfig: Makefile.common Log Message: Make IEEE802.11 support optional To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sbin/ifconfig/Makefile.common Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/ifconfig/Makefile.common diff -u src/sbin/ifconfig/Makefile.common:1.5 src/sbin/ifconfig/Makefile.common:1.6 --- src/sbin/ifconfig/Makefile.common:1.5 Tue May 2 20:12:27 2017 +++ src/sbin/ifconfig/Makefile.common Mon Mar 1 16:47:48 2021 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.common,v 1.5 2017/05/02 20:12:27 christos Exp $ +# $NetBSD: Makefile.common,v 1.6 2021/03/01 16:47:48 martin Exp $ # shared stuff with src/distrib/utils/x_ifconfig for install media. # stuff not required by install media should be into Makefile. @@ -11,8 +11,11 @@ DPADD+= ${LIBUTIL} ${LIBPROP} LDADD+= -lutil -lprop INCS+= af_inetany.h env.h extern.h media.h parse.h util.h -SRCS+= af_inet.c af_inetany.c env.c ether.c ieee80211.c \ +SRCS+= af_inet.c af_inetany.c env.c ether.c \ ifconfig.c media.c parse.c tunnel.c util.c vlan.c +.ifndef NOIEEE80211 +SRCS+= ieee80211.c +.endif .ifndef SMALLPROG SRCS+= agr.c l2tp.c .endif
CVS commit: src/sbin/ifconfig
Module Name:src Committed By: christos Date: Tue Mar 9 14:39:43 UTC 2021 Modified Files: src/sbin/ifconfig: ifconfig.8 Log Message: PR/50933: Uwe Toenjes: Document hardware limitations To generate a diff of this commit: cvs rdiff -u -r1.121 -r1.122 src/sbin/ifconfig/ifconfig.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/ifconfig/ifconfig.8 diff -u src/sbin/ifconfig/ifconfig.8:1.121 src/sbin/ifconfig/ifconfig.8:1.122 --- src/sbin/ifconfig/ifconfig.8:1.121 Tue Sep 29 04:52:11 2020 +++ src/sbin/ifconfig/ifconfig.8 Tue Mar 9 09:39:43 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: ifconfig.8,v 1.121 2020/09/29 08:52:11 msaitoh Exp $ +.\" $NetBSD: ifconfig.8,v 1.122 2021/03/09 14:39:43 christos Exp $ .\" .\" Copyright (c) 1983, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" @(#)ifconfig.8 8.4 (Berkeley) 6/1/94 .\" -.Dd September 29, 2020 +.Dd March 9, 2021 .Dt IFCONFIG 8 .Os .Sh NAME @@ -904,6 +904,14 @@ tried to alter an interface's configurat .\" .Xr eon 5 , .Xr rc 8 , .Xr routed 8 +.Sh BUGS +Due to hardware limitations some of the capabilities cannot be turned on +and off individually and need to be specified together. +For example the +.Xr ixg 4 +driver can't enable separately tcp and udp, or the transmit and receive +checksumming capabilities. +Unfortunately the diagnostic messages in this case are lacking. .Sh HISTORY The .Nm
CVS commit: src/sbin/mount_nfs
Module Name:src Committed By: rin Date: Sun Mar 14 02:56:51 UTC 2021 Modified Files: src/sbin/mount_nfs: mount_nfs.8 Log Message: Fix typo: s/--r/-r/ To generate a diff of this commit: cvs rdiff -u -r1.51 -r1.52 src/sbin/mount_nfs/mount_nfs.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/mount_nfs/mount_nfs.8 diff -u src/sbin/mount_nfs/mount_nfs.8:1.51 src/sbin/mount_nfs/mount_nfs.8:1.52 --- src/sbin/mount_nfs/mount_nfs.8:1.51 Sun Jan 24 12:51:32 2021 +++ src/sbin/mount_nfs/mount_nfs.8 Sun Mar 14 02:56:51 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: mount_nfs.8,v 1.51 2021/01/24 12:51:32 jmcneill Exp $ +.\" $NetBSD: mount_nfs.8,v 1.52 2021/03/14 02:56:51 rin Exp $ .\" .\" Copyright (c) 1992, 1993, 1994, 1995 .\" The Regents of the University of California. All rights reserved. @@ -218,7 +218,7 @@ Same as .Fl a Ar maxreadahead . .It Cm rsize Ns = Ns Aq Ar readsize Same as -.Fl -r Ar readsize . +.Fl r Ar readsize . .It Cm soft Same as .Fl s .
CVS commit: src/sbin/rndctl
Module Name:src Committed By: nia Date: Fri Apr 2 07:04:05 UTC 2021 Modified Files: src/sbin/rndctl: rndctl.8 Log Message: rndctl.8: reflect current reality To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/sbin/rndctl/rndctl.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/rndctl/rndctl.8 diff -u src/sbin/rndctl/rndctl.8:1.26 src/sbin/rndctl/rndctl.8:1.27 --- src/sbin/rndctl/rndctl.8:1.26 Thu May 7 19:09:26 2020 +++ src/sbin/rndctl/rndctl.8 Fri Apr 2 07:04:05 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: rndctl.8,v 1.26 2020/05/07 19:09:26 riastradh Exp $ +.\" $NetBSD: rndctl.8,v 1.27 2021/04/02 07:04:05 nia Exp $ .\" .\" Copyright (c) 1997 Michael Graff .\" All rights reserved. @@ -26,7 +26,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd August 10, 2014 +.Dd April 2, 2021 .Dt RNDCTL 8 .Os .Sh NAME @@ -56,11 +56,9 @@ entropy pool maintained by The following options are available: .Bl -tag -width 123456 .It Fl C -Disable collection of timing information for the given -device name or device type. +Disable collection of data for the given device name or device type. .It Fl c -Enable collection of timing information for the given -device name or device type. +Enable collection of data for the given device name or device type. .It Fl d Only the device named .Ar devname @@ -68,14 +66,15 @@ is altered or displayed. This is mutually exclusive with .Fl t . .It Fl E -Disable entropy estimation from the collected timing information for -the given device name or device type. -If collection is still enabled, timing information is still -collected and mixed into the internal entropy pool, -but no entropy is assumed to be present. +Disable entropy estimation for the given device name or device type. +If collection is still enabled, data is still collected and mixed into +the internal entropy pool, but no entropy is assumed to be present. .It Fl e -Enable entropy estimation using the collected timing information -for the given device name or device type. +Re-enable entropy estimation for the given device name or device type. +If the kernel's estimate for the given device is zero, as it is for +devices of types other than +.Ic rng , +this does not increase the estimate. .It Fl i With the .Fl L @@ -138,6 +137,7 @@ Verbose output. .El .Sh SEE ALSO .Xr rnd 4 , +.Xr entropy 7 , .Xr rnd 9 .Sh HISTORY The
CVS commit: src/sbin/rndctl
Module Name:src Committed By: nia Date: Fri Apr 2 07:17:56 UTC 2021 Modified Files: src/sbin/rndctl: rndctl.c Log Message: rndctl: make -l's "Flags" field reflect current reality don't print "legacy options" RND_FLAG_ESTIMATE_TIME and "RND_FLAG_ESTIMATE_VALUE" only print "estimate" if we have actually counted any bits from something, since it's no longer really possible to "enable estimation". ideally, there should also be a "samples" field so it's clear collected bits are not being counted. To generate a diff of this commit: cvs rdiff -u -r1.37 -r1.38 src/sbin/rndctl/rndctl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/rndctl/rndctl.c diff -u src/sbin/rndctl/rndctl.c:1.37 src/sbin/rndctl/rndctl.c:1.38 --- src/sbin/rndctl/rndctl.c:1.37 Tue May 12 09:48:44 2020 +++ src/sbin/rndctl/rndctl.c Fri Apr 2 07:17:56 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: rndctl.c,v 1.37 2020/05/12 09:48:44 simonb Exp $ */ +/* $NetBSD: rndctl.c,v 1.38 2021/04/02 07:17:56 nia Exp $ */ /*- * Copyright (c) 1997 Michael Graff. @@ -31,7 +31,7 @@ #include #ifndef lint -__RCSID("$NetBSD: rndctl.c,v 1.37 2020/05/12 09:48:44 simonb Exp $"); +__RCSID("$NetBSD: rndctl.c,v 1.38 2021/04/02 07:17:56 nia Exp $"); #endif #include @@ -75,7 +75,7 @@ __dead static void usage(void); static u_int32_t find_type(const char *name); static const char *find_name(u_int32_t); static void do_ioctl(rndctl_t *); -static char * strflags(u_int32_t); +static char * strflags(uint32_t, u_int32_t); static void do_list(int, u_int32_t, char *); static void do_stats(void); @@ -444,29 +444,21 @@ do_ioctl(rndctl_t *rctl) } static char * -strflags(u_int32_t fl) +strflags(uint32_t totalbits, u_int32_t fl) { static char str[512]; str[0] = '\0'; - if (fl & RND_FLAG_NO_ESTIMATE) - ; - else + if (totalbits > 0 && (fl & RND_FLAG_NO_ESTIMATE) == 0) strlcat(str, "estimate, ", sizeof(str)); - if (fl & RND_FLAG_NO_COLLECT) - ; - else + if ((fl & RND_FLAG_NO_COLLECT) == 0) strlcat(str, "collect, ", sizeof(str)); if (fl & RND_FLAG_COLLECT_VALUE) strlcat(str, "v, ", sizeof(str)); if (fl & RND_FLAG_COLLECT_TIME) strlcat(str, "t, ", sizeof(str)); - if (fl & RND_FLAG_ESTIMATE_VALUE) - strlcat(str, "dv, ", sizeof(str)); - if (fl & RND_FLAG_ESTIMATE_TIME) - strlcat(str, "dt, ", sizeof(str)); if (str[strlen(str) - 2] == ',') str[strlen(str) - 2] = '\0'; @@ -500,7 +492,8 @@ do_list(int all, u_int32_t type, char *n rstat_name.source.rt.name, rstat_name.source.rt.total, find_name(rstat_name.source.rt.type), - strflags(rstat_name.source.rt.flags)); + strflags(rstat_name.source.rt.total, + rstat_name.source.rt.flags)); if (vflag) { printf("\tDt samples = %d\n", rstat_name.source.dt_samples); @@ -538,7 +531,8 @@ do_list(int all, u_int32_t type, char *n rstat.source[i].rt.name, rstat.source[i].rt.total, find_name(rstat.source[i].rt.type), -strflags(rstat.source[i].rt.flags)); +strflags(rstat.source[i].rt.total, + rstat.source[i].rt.flags)); if (vflag) { printf("\tDt samples = %d\n", rstat.source[i].dt_samples);
CVS commit: src/sbin/gpt
Module Name:src Committed By: martin Date: Mon Mar 30 10:41:53 UTC 2020 Modified Files: src/sbin/gpt: gpt_uuid.c Log Message: Now that we use the same UUID for ZFS as FreeBSD, drop the FreeBSD marker from the description. To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/sbin/gpt/gpt_uuid.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/gpt/gpt_uuid.c diff -u src/sbin/gpt/gpt_uuid.c:1.18 src/sbin/gpt/gpt_uuid.c:1.19 --- src/sbin/gpt/gpt_uuid.c:1.18 Tue Jun 25 04:25:11 2019 +++ src/sbin/gpt/gpt_uuid.c Mon Mar 30 10:41:53 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: gpt_uuid.c,v 1.18 2019/06/25 04:25:11 jnemeth Exp $ */ +/* $NetBSD: gpt_uuid.c,v 1.19 2020/03/30 10:41:53 martin Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #include #ifdef __RCSID -__RCSID("$NetBSD: gpt_uuid.c,v 1.18 2019/06/25 04:25:11 jnemeth Exp $"); +__RCSID("$NetBSD: gpt_uuid.c,v 1.19 2020/03/30 10:41:53 martin Exp $"); #endif #include @@ -73,7 +73,7 @@ static const struct { { GPT_ENT_TYPE_FREEBSD_SWAP, "fbsd-swap", "FreeBSD swap" }, { GPT_ENT_TYPE_FREEBSD_UFS, "fbsd-ufs", "FreeBSD UFS/UFS2" }, { GPT_ENT_TYPE_FREEBSD_VINUM, "fbsd-vinum", "FreeBSD vinum" }, - { GPT_ENT_TYPE_FREEBSD_ZFS, "fbsd-zfs", "FreeBSD ZFS" }, + { GPT_ENT_TYPE_FREEBSD_ZFS, "zfs", "ZFS" }, { GPT_ENT_TYPE_LINUX_DATA, "linux-data", "Linux data" }, { GPT_ENT_TYPE_LINUX_RAID, "linux-raid", "Linux RAID" }, { GPT_ENT_TYPE_LINUX_SWAP, "linux-swap", "Linux swap" },
CVS commit: src/sbin/route
Module Name:src Committed By: christos Date: Thu Apr 2 18:32:32 UTC 2020 Modified Files: src/sbin/route: prog_ops.h route.c route_hostops.c route_rumpops.c Log Message: Add a prog_setsockopt (thanks kre@) To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sbin/route/prog_ops.h cvs rdiff -u -r1.167 -r1.168 src/sbin/route/route.c cvs rdiff -u -r1.1 -r1.2 src/sbin/route/route_hostops.c \ src/sbin/route/route_rumpops.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/route/prog_ops.h diff -u src/sbin/route/prog_ops.h:1.3 src/sbin/route/prog_ops.h:1.4 --- src/sbin/route/prog_ops.h:1.3 Thu Nov 6 16:29:32 2014 +++ src/sbin/route/prog_ops.h Thu Apr 2 14:32:31 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: prog_ops.h,v 1.3 2014/11/06 21:29:32 christos Exp $ */ +/* $NetBSD: prog_ops.h,v 1.4 2020/04/02 18:32:31 christos Exp $ */ /* * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -36,36 +36,50 @@ struct prog_ops { int (*op_init)(void); - int (*op_sysctl)(const int *, u_int, void *, size_t *, - const void *, size_t); - int (*op_socket)(int, int, int); + int (*op_setsockopt)(int, int, int, const void *, socklen_t); + + int (*op_open)(const char *, int, ...); pid_t (*op_getpid)(void); ssize_t (*op_read)(int, void *, size_t); ssize_t (*op_write)(int, const void *, size_t); + int (*op_sysctl)(const int *, u_int, void *, size_t *, + const void *, size_t); int (*op_shutdown)(int, int); }; extern const struct prog_ops prog_ops; #define prog_init prog_ops.op_init + #define prog_socket prog_ops.op_socket +#define prog_setsockopt prog_ops.op_setsockopt + #define prog_open prog_ops.op_open #define prog_getpid prog_ops.op_getpid + #define prog_read prog_ops.op_read #define prog_write prog_ops.op_write + #define prog_sysctl prog_ops.op_sysctl + #define prog_shutdown prog_ops.op_shutdown + #else #define prog_init ((int (*)(void))NULL) + #define prog_socket socket +#define prog_setsockopt setsockopt + #define prog_open open #define prog_getpid getpid + #define prog_read read #define prog_write write + #define prog_sysctl sysctl #define prog_shutdown shutdown #endif Index: src/sbin/route/route.c diff -u src/sbin/route/route.c:1.167 src/sbin/route/route.c:1.168 --- src/sbin/route/route.c:1.167 Sat Mar 14 18:26:39 2020 +++ src/sbin/route/route.c Thu Apr 2 14:32:31 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: route.c,v 1.167 2020/03/14 22:26:39 roy Exp $ */ +/* $NetBSD: route.c,v 1.168 2020/04/02 18:32:31 christos Exp $ */ /* * Copyright (c) 1983, 1989, 1991, 1993 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19 #if 0 static char sccsid[] = "@(#)route.c 8.6 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: route.c,v 1.167 2020/03/14 22:26:39 roy Exp $"); +__RCSID("$NetBSD: route.c,v 1.168 2020/04/02 18:32:31 christos Exp $"); #endif #endif /* not lint */ @@ -212,7 +212,7 @@ main(int argc, char * const *argv) int on = 1; sock = prog_socket(PF_ROUTE, SOCK_RAW, 0); - if (setsockopt(sock, SOL_SOCKET, SO_RERROR, + if (prog_setsockopt(sock, SOL_SOCKET, SO_RERROR, &on, sizeof(on)) == -1) warn("SO_RERROR"); } Index: src/sbin/route/route_hostops.c diff -u src/sbin/route/route_hostops.c:1.1 src/sbin/route/route_hostops.c:1.2 --- src/sbin/route/route_hostops.c:1.1 Mon Dec 13 12:39:47 2010 +++ src/sbin/route/route_hostops.c Thu Apr 2 14:32:31 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: route_hostops.c,v 1.1 2010/12/13 17:39:47 pooka Exp $ */ +/* $NetBSD: route_hostops.c,v 1.2 2020/04/02 18:32:31 christos Exp $ */ /* * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -28,7 +28,7 @@ #include #ifndef lint -__RCSID("$NetBSD: route_hostops.c,v 1.1 2010/12/13 17:39:47 pooka Exp $"); +__RCSID("$NetBSD: route_hostops.c,v 1.2 2020/04/02 18:32:31 christos Exp $"); #endif /* !lint */ #include @@ -41,14 +41,17 @@ __RCSID("$NetBSD: route_hostops.c,v 1.1 #include "prog_ops.h" const struct prog_ops prog_ops = { - .op_socket = socket, - .op_open = open, - .op_getpid = getpid, - .op_read = read, - .op_write = write, + .op_socket = socket, + .op_setsockopt = setsockopt, - .op_sysctl = sysctl, + .op_open = open, + .op_getpid = getpid, - .op_shutdown = shutdown, + .op_read = read, + .op_write = write, + + .op_sysctl = sysctl, + + .op_shutdown = shutdown, }; Index: src/sbin/route/route_rumpops.c diff -u src/sbin/route/route_rumpops.c:1.1 src/sbin/route/route_rumpops.c:1.2 --- src/sbin/route/route_rumpops.c:1.1 Mon Dec 13 12:39:47 2010 +++ src/sbin/route/route_rumpops.c Thu Apr 2 14:32:31 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: route_rumpops.c,v 1.1 2010/12/13 17:39:47 pooka Exp $ */ +/* $NetBSD: route_rumpops.c,v 1.2 2020/04/02 18:32:31 christos Exp $ */ /* * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -28,7 +28,7 @@ #include #ifndef lint -__RCSID("$NetBSD: route_rumpops.c,v 1.1 2010/12/13 17:39:47 pook