This one time, at band camp, martin f krafft said: > also sprach Stephen Gran <[EMAIL PROTECTED]> [2006.06.21.1527 +0200]: > > This is apparently by design: > > > > return updated ? 0 : 1; > > > > What does it break? Why is it a bug? > > Any script that uses set -e (all of mine do). Now I have to > explicitly check return code to determine whether there was an > error.
It just means instead of writing:
freshclam
you have to write:
if freshclam; then ... fi
which you should be doing in a set -e script anyway.
> I'd say it's a bug because there's no error. Moreover, by the time
> freshclam finishes, what does it matter whether it was updated or
> not?
If by finishes, you mean exits, there are a number of things freshclam
can exit from, but that doesn't mean it exited successfully. Unless you
want to parse output, return codes provide a good way to communicate
back status. This is fairly traditional behavior.
This is in fact documented in the expected place, freshclam(1):
RETURN CODES
0 : Database successfully updated.
1 : Database is up-to-date.
40: Unknown option passed.
50: Can't change directory.
51: Can't check MD5 sum.
52: Connection (network) problem.
53: Can't unlink file.
54: MD5 or digital signature verification error.
55: Error reading file.
56: Config file error.
57: Can't create new file.
58: Can't read database from remote server.
59: Mirrors are not fully synchronized (try again later).
60: Can't get information about clamav user from /etc/passwd.
61: Can't drop privileges.
62: Can't initialize logger.
I agree it's not necessarily expected, but I tend to disagree that it's
a problem.
--
-----------------------------------------------------------------
| ,''`. Stephen Gran |
| : :' : [EMAIL PROTECTED] |
| `. `' Debian user, admin, and developer |
| `- http://www.debian.org |
-----------------------------------------------------------------
signature.asc
Description: Digital signature

