Bug 6056 - hostid utility sometimes prints 64-bit number
Summary: hostid utility sometimes prints 64-bit number
Status: RESOLVED FIXED
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: PC Linux
: P5 major
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-03 10:55 UTC by Alexander Zubkov
Modified: 2013-03-04 02:06 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Zubkov 2013-03-03 10:55:40 UTC
hostid should print 32-bit number. But on platforms with 64-bit long (which is used for storing hostid) it can output 64-bit numbers in some cases:
# ./busybox hostid
ffffffffb45de613
In linux coreutils this case is specially commented:
http://git.savannah.gnu.org/cgit/coreutils.git/tree/src/hostid.c
It happens when hostid number is sign-extended.
Comment 1 Denys Vlasenko 2013-03-04 02:06:53 UTC
commit 9bbf6b98c42a212b8a4b1aa02975ac18bb612922
Author: Denys Vlasenko <vda.linux@googlemail.com>
Date:   Mon Mar 4 03:04:38 2013 +0100

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