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.

BUG=chromium:358419
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-on: https://chromium-review.googlesource.com/192550
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
1 file changed