← Commit list

9bbf6b98c

Denys Vlasenko
Denys Vlasenko
2013-03-04
SUCCESS Duration: 178s

Subject

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

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

coreutils/hostid.c+2 -1
@@ -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();
}