[systemd-devel] [PATCH v3] Skip tests that depend on /etc/machine-id if it is not present

Ramkumar Ramachandra artagnon at gmail.com
Fri Nov 30 19:52:10 PST 2012


David Strauss wrote:
> Please fix the spelling of "present."
> The number -128, if used, should get #define'd instead of being a magic
> number dropped in a bunch of places.

Thanks.  Will fix in the next iteration.

> It's not good to mask all errors opening the machine-id with the -128
> response code. The change here seems to make all opening errors return -128.

Hm, perhaps I shouldn't handle wrong permissions as a special case and
fail the tests in that case. I'll specifically mask only an ENOENT in
the next iteration.

> More importantly, what's wrong with looking for the normal [Errno 2] "No
> such file or directory" return code?

There would be no way to differentiate between a ENOENT from this and
an ENOENT from callers then -- clearly, I'm not treating this as a
normal ENOENT error; I'd want a way to trap this specific error from
any caller, and handle it carefully.

Ram


More information about the systemd-devel mailing list