[LTP] [PATCH 1/3] lib: add function to check for kernel lockdown

Erico Nunes
2020-07-22T15:52:16Z

On 7/21/20 5:26 PM, Cyril Hrubis wrote:
>> +void tst_lockdown_skip(void)
>> +{
>> + char line[BUFSIZ];
>> + FILE *file;
>> +
>> + if (access("/sys/kernel/security/lockdown", F_OK) != 0)
>> + return;
>> +
>> + file = SAFE_FOPEN("/sys/kernel/security/lockdown", "r");
>> + fgets(line, sizeof(line), file);
>
> The compiler complains that we haven't checked the return value here I
> guess that we can silence it with:
>
> if (!fgets(line, sizeof(line), file)
> return;
>

Thanks, will fix in v2.