On Tue, Oct 5, 2010 at 5:38 PM, Lennart Poettering <lenn...@poettering.net> wrote: > On Tue, 05.10.10 08:41, fiden...@profusion.mobi (fiden...@profusion.mobi) > 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: barbi...@gmail.com Skype: gsbarbieri Mobile: +55 (19) 9225-2202 _______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel