On Tue, Oct 5, 2010 at 5:38 PM, Lennart Poettering
<[email protected]> wrote:
> On Tue, 05.10.10 08:41, [email protected] ([email protected]) 
> wrote:
>
>> +static int swap_list_get(MountPoint **swap_list_head) {
>> +        FILE *proc_swaps;
>> +
>> +        if (!(proc_swaps = fopen("/proc/swaps", "re")))
>> +                return -errno;
>> +
>> +        (void) fscanf(proc_swaps, "%*s %*s %*s %*s %*s\n");
>> +
>> +        for (;;) {
>> +                MountPoint *swap;
>> +                char *dev = NULL, *d;
>> +                int k;
>> +
>> +                if ((k = fscanf(proc_swaps,
>> +                                "%ms " /* device/file */
>> +                                "%*s " /* type of swap */
>> +                                "%*s " /* swap size */
>> +                                "%*s " /* used */
>> +                                "%*s\n", /* priority */
>> +                                &dev)) != 1) {
>> +
>> +                        if (k == EOF)
>> +                                break;
>> +
>> +                        free(dev);
>> +                        return -EBADMSG;
>
> Please just "continue" in this error case, too, much like you handle
> mountinfo.

Yes, I've asked fidencio to be more permissive with errors trying to
continue as far as possible, that also includes not return from the
shutdown program when some error occurs. Your comment goes in the same
lines :-)

-- 
Gustavo Sverzut Barbieri
http://profusion.mobi embedded systems
--------------------------------------
MSN: [email protected]
Skype: gsbarbieri
Mobile: +55 (19) 9225-2202
_______________________________________________
systemd-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to