fix building w/ABIs that have broken stat structures

If the system's stat buffer is broken and doesn't declare st_dev as a
dev_t, we hit a build failure when we try to pass it into a func that
expects a dev_t.

Add some checks to handle this case.  It produces the same code on sane
ABIs, so other than ugliness, it should be fine.

TEST=`emerge-link rootdev` produces same code
TEST=`emerge-daisy rootdev` produces same code
TEST=`emerge-mipsel-o32-generic rootdev` now works

Change-Id: I956436e0c40318c8f2ac61b2e202ec739132c245
Reviewed-by: Mike Frysinger <>
Commit-Queue: Mike Frysinger <>
Tested-by: Mike Frysinger <>
1 file changed