From: Daniel Lezcano Date: Sun, 3 Oct 2010 21:09:36 +0000 (+0200) Subject: Don't display an error in lxc_file_for_each_line X-Git-Tag: lxc-0.7.3~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=75b08dddec3803d313f48bedcfe91737dcf4239a;p=thirdparty%2Flxc.git Don't display an error in lxc_file_for_each_line Don't display an error when the callback returns an error different from zero. A value greater than zero may means "stop". Let's the caller to check the error. Signed-off-by: Daniel Lezcano --- diff --git a/src/lxc/parse.c b/src/lxc/parse.c index ee6b5de83..10510c9d9 100644 --- a/src/lxc/parse.c +++ b/src/lxc/parse.c @@ -81,10 +81,8 @@ int lxc_file_for_each_line(const char *file, lxc_file_cb callback, void *data) while (getline(&line, &len, f) != -1) { err = callback(line, data); - if (err) { - ERROR("failed to process '%s'", line); + if (err) break; - } } if (line)