|
|
|
|
@ -206,6 +206,20 @@ static int download(const struct optstruct *opts, const char *datadir, const cha |
|
|
|
|
return ret; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void msg_callback(enum cl_msg severity, const char *fullmsg, const char *msg, void *ctx) |
|
|
|
|
{ |
|
|
|
|
switch (severity) { |
|
|
|
|
case CL_MSG_ERROR: |
|
|
|
|
logg("^[LibClamAV] %s", msg); |
|
|
|
|
break; |
|
|
|
|
case CL_MSG_WARN: |
|
|
|
|
logg("~[LibClamAV] %s", msg); |
|
|
|
|
default: |
|
|
|
|
logg("*[LibClamAV] %s", msg); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int main(int argc, char **argv) |
|
|
|
|
{ |
|
|
|
|
int ret = 52, retcl; |
|
|
|
|
@ -369,6 +383,7 @@ int main(int argc, char **argv) |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
cl_set_clcb_msg(msg_callback); |
|
|
|
|
/* change the current working directory */ |
|
|
|
|
if(chdir(optget(opts, "DatabaseDirectory")->strarg)) { |
|
|
|
|
logg("!Can't change dir to %s\n", optget(opts, "DatabaseDirectory")->strarg); |
|
|
|
|
|