Ok, a (hopefully) better idea.
If the value of id is 0, don't return anything and exit with EXIT_FAILURE.
That maintains consistency and makes the user aware that something is
seriously broken. [By the same view, returning a well-known value, like
0xdeadbeef or similar, could serve the same purpose; it seems more
cautious to not return anything, though.]
For my purposes, it is enough that I can set the hostid via a sysctl, and
hostid will function just fine:
So, I can get around a broken hostid - the responsbility of coming up with
a consistent [and hopefully unique] hostid is now on the administrator [or
OS vendor].
On Thu, 3 May 2007, John Cowan wrote:
C. Speare scripsit:
A possible (but weak) workaround is to test for the case where id is 0.
It's fine to detect that case, but the whole idea of hostid is to
return the same value each time it's called on the same host,
so returning a random value is unhelpful.
--
Work hard, John Cowan
play hard, address@hidden
die young, http://www.ccil.org/~cowan
rot quickly.