]> git.ipfire.org Git - thirdparty/bacula.git/commit
tweak improve code readability in cancel_cmd
authorAlain Spineux <alain@baculasystems.com>
Thu, 1 Dec 2022 10:45:28 +0000 (11:45 +0100)
committerEric Bollengier <eric@baculasystems.com>
Thu, 14 Sep 2023 11:57:00 +0000 (13:57 +0200)
commitf69d7c4e4db3f0c943fa4270037b446107a8db6a
treec76dab416733c62f0ae0ac4126efc890a7fc96c1
parentc758fa35e2063875e75139a69089fb34f7a2c4a8
tweak improve code readability in cancel_cmd

- it is useless to test for nb != -1 because nb is always >=0
- maybe the idea behind the comment was to test for ret and not nb ???
- &= is a bitwise operator, not for boolean
- notice that the two lines below don't work the same because
    ret = cancel_job(ua, jcr, 60, cancel) && ret;
    ret = ret && cancel_job(ua, jcr, 60, cancel);
  I chose the first one, but maybe because of the comment that I have
  removed, we should use the first one
bacula/src/dird/job.c
bacula/src/dird/ua_cmds.c