DragonFly commits List (threaded) for 2005-01
Re: cvs commit: src/sbin/mount mntopts.h src/sbin/newfs fscopy.c mkfs.c newfs.c
Good work Chris, but I have one minor nit and that is this
empty_string business. At least for fscopy.c what really
needs to be done there is that the code needs to be cleaned
up and NULL assigned in the 0-length case instead of "".
The one or two write()'s that write node->fs_Bytes should then
check to see if node->fs_Bytes != 0 before doing the write.
The only reason the code works at all is that it nevers frees
node->fs_Data except during the allocation phase if something
errors out during allocation.
In this case the empty_string is a bit too much of a hack to
get around the const/non-const issue.
:cpressey 2005/01/05 19:21:00 PST
:DragonFly src repository
: Modified files:
: sbin/mount mntopts.h
: sbin/newfs fscopy.c mkfs.c newfs.c
: Raise WARNS of newfs to 6:
: - Use static char buffer instead of string constant;
: - Move and add some function prototypes;
: - Don't reuse a scratch variable, use a real pid_t to hold the
: result of a fork();
: - Cast variables as needed (mainly to u_long and u_int32) to avoid
: signed-unsigned comparison warnings;
: - Rename some variables to avoid name clashes;
: - Mark some parameters as unused;
: - Add MOPT_NULL as a struct mntopt constant for terminating a list.
: And apply some style(9):
: - Move out some loop invariant code, for clarity;
: - Remove `register' keywords;
: - Make explicit some checks against NULL.
: Based-on-patch-by: Peter Schuller
: Tested-by: typical usage of installer
: Revision Changes Path
: 1.4 +3 -0 src/sbin/mount/mntopts.h
: 1.5 +5 -3 src/sbin/newfs/fscopy.c
: 1.10 +59 -48 src/sbin/newfs/mkfs.c
: 1.12 +10 -10 src/sbin/newfs/newfs.c