Commit 8daccdb4 by Serge Hallyn

parse.c: don't print error message on callback rv > 0

A callback return value < 0 means there was an error, so print out an error message. But a rv > 0 is used by the mount_unknown_fs functions to say "we found the one we want, stop here." Document this, and only print an error message if rv < 0. Otherwise, lxc-create -B lvm --fstype ext3 -t ubuntu -n u1 will print an (innocuous) error message about being unable to parse the config value 'ext3'. Signed-off-by: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com> Acked-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
parent 6e7e54d9
...@@ -102,7 +102,10 @@ int lxc_file_for_each_line(const char *file, lxc_file_cb callback, void *data) ...@@ -102,7 +102,10 @@ int lxc_file_for_each_line(const char *file, lxc_file_cb callback, void *data)
while (getline(&line, &len, f) != -1) { while (getline(&line, &len, f) != -1) {
err = callback(line, data); err = callback(line, data);
if (err) { if (err) {
ERROR("Failed to parse config: %s", line); // callback rv > 0 means stop here
// callback rv < 0 means error
if (err < 0)
ERROR("Failed to parse config: %s", line);
break; break;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment