Home | History | Annotate | Download | only in dev_mkdb
History log of /src/usr.sbin/dev_mkdb/dev_mkdb.c
RevisionDateAuthorComments
 1.31  08-Aug-2023  riastradh dev_mkdb(8): No need for weird padding any more.

cdbw_output never needed it at runtime, and the declaration no longer
makes gcc angry about not having it.
 1.30  01-Aug-2023  mrg cdbw_output()'s 3rd argument must be a 16-byte char array, so pad the
string literals passed to it with enough nuls to make this true.

found by GCC 12.
 1.29  03-Jun-2012  joerg Switch device database to cdb(5). Rework ttyname(3) and ttyname_r(3) to
depend on new devname_r(3) as heart. Add /dev/pts magic directly to
devname(3). While it can lead to returning non-existing paths, the
behavior is more consistent that way. Drop caching layer in devname(3),
it doesn't buy anything for the common case of having access to the
database. Teach devname(3) proper fallback behavior of scanning /dev.
Create both old-style and new-style database for now in /etc/rc.d/sysdb.
 1.28  30-Aug-2011  joerg branches: 1.28.2; 1.28.4;
static openinfo. dead, not unused usage.
 1.27  15-Apr-2009  lukem Fix -Wsign-compare issue
 1.26  28-Dec-2008  christos branches: 1.26.2;
fix suseconds_t format.
 1.25  21-Jul-2008  lukem Remove the \n and tabs from the __COPYRIGHT() strings.
Tweak to use a consistent format.
 1.24  15-Dec-2007  perry branches: 1.24.6;
convert __attribute__s to applicable cdefs.h macros
 1.23  18-Nov-2005  christos branches: 1.23.10;
The latest fts fix that removes double-slashes from paths exposed a bug
in the code. Don't assume that the extra slash is going to be there.
 1.22  24-Oct-2005  christos Don't assume that fts(3) will add a slash to the name. From Steve Woodford.
KNF.
 1.21  16-Mar-2005  xtraeme Kill __P(), use ANSI function declarations; WARNS=3
 1.20  07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22366, verified by myself.
 1.19  17-May-2003  itojun use strlcpy. don't hardcode sizes, use sizeof.
 1.18  15-Dec-2002  hannken Set explicit database layout. Default is filesystem block size
and hashdb doesn't work for bucket size >= 65536.
Approved by: Jason R. Thorpe <thorpej@netbsd.org>
 1.17  15-Jul-2001  manu Removed two debug messages commited by mistake. Sorry about this.
 1.16  14-Jul-2001  manu errno is not tested any more if dbopen succeeds (to quote errno(2), "It
should only be examined after an error")
Added an additionnal chdir so that -o works with a file in the current
directory.
 1.15  13-Jul-2001  manu Moved the errno=0 in the loop for opening the temp file. The problem was that
successful syscalls never set errno, and hence we could have had an inifinite
loop if the opening failed once and succeded on second attempt.
 1.14  12-Jul-2001  manu FIxed a problem with string length (a leading / was appearing in w, who and others)
We were using rename() to create the target file from the temp file. Now the temp file is created in the same directory of the targer file so that rename() will always work (it needs to have the files in the same filesystem)
Using the -o file, the output file may be on a world writable directory, we hence open the temporary file using O_EXCL, and we loop trying different names until it works.
 1.13  08-Jul-2001  manu We use rename() to produce the dev.db file, and rename() is not able to move
files across filesystems. Hence we use /var/run for dev.tmp, since dev.db
will be in /var/run.
 1.12  05-Jul-2001  manu - Moved the temp file to /tmp instead of /var/tmp
- Added a O_EXCL flag so that we cannot open an existing file for temp file
 1.11  04-Jul-2001  manu Added flags to choose the location of the input device directory and the
output device database. Goal is to be consistent with other *_mkdb
utilities such as pwd_mkdb or kvm_mkdb.
 1.10  10-Apr-2001  enami Descent into subdirs so that pstat -v prints files on fdescfs symbolically.
 1.9  10-Apr-2001  enami - Cosmetic changes like:
* Put space after keyword `switch'.
* Explicitly dereference pointer to function.
- Remove unnecessary cast.
 1.8  18-Oct-1997  lukem deprecate register, use memset/memmove instead of bzero/bcopy
 1.7  17-Oct-1997  lukem WARNSify, getopt returns -1 not EOF
 1.6  08-Mar-1997  mikel RCSid police
 1.5  30-Jan-1995  mycroft Merge with 4.4-Lite, and use libc err(3) and warn(3).
 1.4  22-Oct-1993  mycroft From Mark Weaver:
Use lstat() rather that stat(), to avoid chasing symlinks.
 1.3  01-Aug-1993  mycroft Add RCS identifiers.
 1.2  21-Apr-1993  proven Changed hash_open to dbopen.
 1.1  21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2  30-Jan-1995  mycroft Import original 4.4-Lite version.
 1.1.1.1  21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.23.10.1  09-Jan-2008  matt sync with HEAD
 1.24.6.1  18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.26.2.1  13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.28.4.1  23-Jun-2012  riz Pull up following revision(s) (requested by joerg in ticket #328):
lib/libc/gen/devname.c: revision 1.22
distrib/sparc64/instfs/dot.profile: revision 1.7
distrib/i386/cdroms/install.sh: revision 1.3
tests/lib/libcurses/director/director.c: revision 1.10
lib/libc/include/reentrant.h: revision 1.15
distrib/amd64/cdroms/install.sh: revision 1.3
tests/include/t_paths.c: revision 1.12
share/man/man7/hier.7: revision 1.101
etc/rc.d/sysdb: revision 1.24
include/stdlib.h: revision 1.99
tests/lib/libcurses/Makefile: revision 1.3
distrib/sparc64/cdroms/installcd/install.sh: revision 1.3
distrib/i386/cdroms/Makefile.cdrom: revision 1.27
lib/libc/gen/ttyname.c: revision 1.25
usr.bin/tic/Makefile: revision 1.2
tools/compat/Makefile: revision 1.57
lib/libterminfo/compile.c: revision 1.7
lib/libc/gen/ttyname.c: revision 1.26
lib/libterminfo/compile.c: revision 1.8
tools/compat/Makefile: revision 1.59
tools/compat/cdbw.h: revision 1.1
distrib/i386/installimage/install.sh: revision 1.2
lib/libc/include/namespace.h: revision 1.154
usr.bin/tic/tic.c: revision 1.13
usr.bin/tic/tic.c: revision 1.14
usr.bin/tic/tic.c: revision 1.15
distrib/sets/lists/base/mi: revision 1.996
usr.bin/tic/tic.c: revision 1.16
usr.sbin/dev_mkdb/dev_mkdb.8: revision 1.13
usr.bin/tic/tic.c: revision 1.17
usr.bin/tic/tic.c: revision 1.18
tools/compat/cdbr.h: revision 1.1
distrib/sparc64/instfs/list: revision 1.25
usr.bin/tic/tic.c: revision 1.19
lib/libc/cdb/cdbw.c: revision 1.4
lib/libc/cdb/cdbw.3: revision 1.4
lib/libc/cdb/cdbw.3: revision 1.5
share/terminfo/Makefile: revision 1.3
usr.sbin/dev_mkdb/dev_mkdb.c: revision 1.29
usr.sbin/dev_mkdb/Makefile: revision 1.8
lib/libc/gen/ttyname.3: revision 1.23
lib/libc/gen/ttyname.3: revision 1.24
lib/libc/cdb/cdbr.c: revision 1.3
include/cdbw.h: revision 1.2
distrib/sparc64/cdroms/installcd/Makefile: revision 1.15
lib/libc/gen/devname.3: revision 1.12
tools/compat/compat_defs.h: revision 1.85
tools/compat/compat_defs.h: revision 1.86
lib/libterminfo/term_private.h: revision 1.10
lib/libterminfo/term.c: revision 1.14
usr.bin/tic/tic.1: revision 1.10
lib/libterminfo/term.c: revision 1.15
lib/libterminfo/Makefile.hash: revision 1.5
lib/libterminfo/term.c: revision 1.16
distrib/amd64/installimage/install.sh: revision 1.2
share/man/man5/rc.conf.5: revision 1.152
distrib/sets/lists/tests/mi: revision 1.472
distrib/amd64/cdroms/Makefile.cdrom: revision 1.7
include/paths.h: revision 1.41
bin/ps/ps.1: revision 1.101
lib/libterminfo/terminfo.5.in: revision 1.16
usr.bin/tic/tic.c: revision 1.20
lib/libterminfo/terminfo.5.in: revision 1.17
Prefer __printflike.
Use queue(3)
Replace linear lookup with hash table, reducing runtime by 60%.
Use e* from util.h.
One more strdup -> estrdup.
Maintain nalias and nterm on the fly.
Add void for ttyslot prototype.
Use memcmp in place of strncmp, since length is known to no longer than
either of the arguments.
Fix a number of memory leaks. Keep final loop of the cleanup in tic(1)
under #ifdef __VALGRIND__ though.
Add __predict_true / __predict_false definitions.
Add a special seeder for cdbw_output that gives stable results.
Hook up cdbw(3) for the tool build.
Prototype for cdbw_stable_seeder.
Provide a usable thr_once for !_REENTRANT
Switch device database to cdb(5). Rework ttyname(3) and ttyname_r(3) to
depend on new devname_r(3) as heart. Add /dev/pts magic directly to
devname(3). While it can lead to returning non-existing paths, the
behavior is more consistent that way. Drop caching layer in devname(3),
it doesn't buy anything for the common case of having access to the
database. Teach devname(3) proper fallback behavior of scanning /dev.
Create both old-style and new-style database for now in /etc/rc.d/sysdb.
Switch terminfo(3) to cdb(5).
Fix typos.
Make Alan Barrett happy and add ().
Add cdbr(3) support to tools/compat.
Bump date for previous.
Relax consistency to make it possible to match valid entries.
Prefix devname's buffer with /dev/ as ttyname is supposed to return the
full path. Reported by Dave Huang.
 1.28.2.1  30-Oct-2012  yamt sync with head

RSS XML Feed