hostid: do not output sign-extended host id. Closes 6056

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2013-03-04 03:04:38 +01:00
parent 93b51819cf
commit 9bbf6b98c4
1 changed files with 2 additions and 1 deletions

View File

@ -36,7 +36,8 @@ int hostid_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
bb_show_usage();
}
printf("%08lx\n", gethostid());
/* POSIX says gethostid returns a "32-bit identifier" */
printf("%08x\n", (unsigned)(uint32_t)gethostid());
return fflush_all();
}