git-svn: trunk@4845
Tomasz Kojm authored on 2009/02/23 21:20:58... | ... |
@@ -56,13 +56,18 @@ int main(int argc, char **argv) |
56 | 56 |
return 2; |
57 | 57 |
} |
58 | 58 |
|
59 |
+ if((ret = cl_init(CL_INIT_DEFAULT)) != CL_SUCCESS) { |
|
60 |
+ printf("Can't initialize libclamav: %s\n", cl_strerror(ret)); |
|
61 |
+ return 2; |
|
62 |
+ } |
|
63 |
+ |
|
59 | 64 |
if(!(engine = cl_engine_new())) { |
60 |
- printf("Can't initialize antivirus engine\n"); |
|
65 |
+ printf("Can't create new engine\n"); |
|
61 | 66 |
return 2; |
62 | 67 |
} |
63 | 68 |
|
64 | 69 |
/* load all available databases from default directory */ |
65 |
- if((ret = cl_load(cl_retdbdir(), engine, &sigs, CL_DB_STDOPT))) { |
|
70 |
+ if((ret = cl_load(cl_retdbdir(), engine, &sigs, CL_DB_STDOPT)) != CL_SUCCESS) { |
|
66 | 71 |
printf("cl_load: %s\n", cl_strerror(ret)); |
67 | 72 |
close(fd); |
68 | 73 |
cl_engine_free(engine); |
... | ... |
@@ -72,7 +77,7 @@ int main(int argc, char **argv) |
72 | 72 |
printf("Loaded %u signatures.\n", sigs); |
73 | 73 |
|
74 | 74 |
/* build engine */ |
75 |
- if((ret = cl_engine_compile(engine)) != 0) { |
|
75 |
+ if((ret = cl_engine_compile(engine)) != CL_SUCCESS) { |
|
76 | 76 |
printf("Database initialization error: %s\n", cl_strerror(ret));; |
77 | 77 |
cl_engine_free(engine); |
78 | 78 |
close(fd); |