X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fmount.c;h=dcf0a434744483a6a9944a22a7347c711c646d0d;hp=fd77516076659b196f3740bd152fcded8154fa91;hb=1ddff895f3ad85ec79c4923ba8c882a283826f42;hpb=a55da3cd5ea9d8cb6d7f1490516734fd43d016cb diff --git a/src/mount.c b/src/mount.c index fd7751607..dcf0a4347 100644 --- a/src/mount.c +++ b/src/mount.c @@ -1408,13 +1408,14 @@ finish: static int mount_load_proc_self_mountinfo(Manager *m, bool set_flags) { int r; + unsigned i; char *device, *path, *options, *options2, *fstype, *d, *p, *o; assert(m); rewind(m->proc_self_mountinfo); - for (;;) { + for (i = 1;; i++) { int k; device = path = options = options2 = fstype = d = p = o = NULL; @@ -1427,7 +1428,7 @@ static int mount_load_proc_self_mountinfo(Manager *m, bool set_flags) { "%ms " /* (5) mount point */ "%ms" /* (6) mount options */ "%*[^-]" /* (7) optional fields */ - "- " /* (8) seperator */ + "- " /* (8) separator */ "%ms " /* (9) file system type */ "%ms" /* (10) mount source */ "%ms" /* (11) mount options 2 */ @@ -1441,8 +1442,8 @@ static int mount_load_proc_self_mountinfo(Manager *m, bool set_flags) { if (k == EOF) break; - r = -EBADMSG; - goto finish; + log_warning("Failed to parse /proc/self/mountinfo:%u.", i); + goto clean_up; } if (asprintf(&o, "%s,%s", options, options2) < 0) { @@ -1459,6 +1460,7 @@ static int mount_load_proc_self_mountinfo(Manager *m, bool set_flags) { if ((r = mount_add_one(m, d, p, o, fstype, true, set_flags)) < 0) goto finish; +clean_up: free(device); free(path); free(options);