[systemd-devel] [PATCH v2] fsck: Search for fsck.type in PATH

Colin Guthrie gmane at colin.guthr.ie
Mon Apr 14 03:37:18 PDT 2014


'Twas brillig, and Mike Gilbert at 12/04/14 20:54 did gyre and gimble:
> On Sat, Apr 12, 2014 at 3:10 PM, Mike Gilbert <floppym at gentoo.org> wrote:
>> On Sat, Apr 12, 2014 at 1:40 PM, Zbigniew Jędrzejewski-Szmek
>> <zbyszek at in.waw.pl> wrote:
>>>> +static void test_fsck_exists(void) {
>>>> +        /* Ensure we use a sane default for PATH. */
>>>> +        unsetenv("PATH");
>>>> +
>>>> +        /* fsck.minix is provided by util-linux and will probably exist. */
>>>> +        assert(fsck_exists("minix") == 0);
>>>> +
>>>> +        assert(fsck_exists("AbCdE") == -ENOENT);
>>>> +}
>>> assert_se().
>>>
>>
>> We are comparing integers, not strings. This matches the other integer
>> comparisons in this source file.
>>
> 
> I guess I have misinterpreted what "assert_se" means... is that
> documented somewhere?

the _se suffix just means "side effect". So if systemd were compiled
without asserts the action would still happen (whereas a normal assert()
is totally skipped).

In this case the side effect is actually calling fsck_exists().

Col


-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited http://www.tribalogic.net/
Open Source:
  Mageia Contributor http://www.mageia.org/
  PulseAudio Hacker http://www.pulseaudio.org/
  Trac Hacker http://trac.edgewall.org/


More information about the systemd-devel mailing list