Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Mar 1997 12:04:25 +1100
From:      Bruce Evans <bde@zeta.org.au>
To:        bde@zeta.org.au, nate@mt.sri.com
Cc:        current@freebsd.org, mpp@freefall.freebsd.org
Subject:   Re: dumpfs patch for review
Message-ID:  <199703280104.MAA12659@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>> >> >+ 	    afs.fs_id[1], ctime((time_t *)&afs.fs_id[0]));
>> >>                                 ^^^^^^^^^^
>> >> 
>> >> Bogus cast.  Just as wrong as the one in fsirand.c.
>> >
>> >Since fs_id[0] is declared as int_32, I have to cast it to time_t in
>> >order for it to be 'right' (according to fsirand).
>> 
>> As I said, fsirand is wrong too.  It converts the pointer, not the object.
>> If time_t is 64 bits then the pointer would probably point to 32 bits of
>> data and 32 bits of garbage.
>
>But it's not.  Do you propose changing the definition in
>/sys/fs/ffs/fs.h?

time_t (actually _BSD_TIME_T_) is defined in <machine/ansi.h>.  It has
nothing to do with fs.h.  It is machine-dependent.

>> >> The minfree...maxbpg line shouldn't be changed.
>> >
>> >Why not change them?  We had to change something?
>> 
>> Nothing was broken in that line.
>
>To make a cake, you gotta break a few eggs. :)

Not in this case.  The only reason to change it would be to make the
output look pretty.  In the non-broken version, there are 4 fields
on the minfree...maxbpg line and 4 fields on the line that needs to
be changed.  The changed fields are harder to print than the old
fields, because they are usually wider, but not always (the random
value takes 11 characters for -2^31 and 1 character for 0), so some
caclulations would be required to print the correct number of tabs
to get the columns to line up.  Moving the time value to a line by
itself creates other ugliness.  It is disconnected from the random
value.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199703280104.MAA12659>