[klibc] [PATCH] kinit
H. Peter Anvin
hpa at zytor.com
Wed Mar 10 10:28:30 PST 2004
Volker Dormeyer wrote:
> try_name () determined "part" with minor 3 and "res" contained major 3.
> Now, try_name () returned "6" and mknod () created /dev/root with
> major 0 and minor 6. I did a left shift of 8 bits, to give mknod () an
> appropriate 16 bit value of type dev_t.
NO NO NO NO NO NO NO NO NO NO NO NO NO...
First of all, dev_t is 32 bits not 16. Use makedev() to create one.
Second, if that is the case then there is many more places in that code
which need fixing...
> Hmm, I was not sure here. Does it break other setups? I thought this could
> be a problem in other setups, too.
It may be, but your code is wrong.
More information about the klibc