]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
lldpcli: return success when reading commands from files
authorVincent Bernat <vincent@bernat.im>
Wed, 7 May 2014 09:54:16 +0000 (11:54 +0200)
committerVincent Bernat <vincent@bernat.im>
Wed, 7 May 2014 09:54:16 +0000 (11:54 +0200)
When reading commands from files, we chose to not stop on errors (the
main reason is to allow to specify nonexistent configuration files and
allow lldpd to still work after incompatible updates). However, we also
always return a failure status. Fix that.

Thanks to Brian Bidulock for spotting that. Closes #62.

src/client/lldpcli.c

index bdc2c9265472f286423639deab29669eee5abcb8..5e0d027e666a0acccfbb87554e21370746faffd0 100644 (file)
@@ -535,7 +535,10 @@ main(int argc, char *argv[])
                goto end;
        }
 
-       if (gotinputs) goto end;
+       if (gotinputs) {
+               rc = EXIT_SUCCESS;
+               goto end;
+       }
 
        /* Interactive session */
 #ifdef HAVE_LIBREADLINE