Browse code

clamd/server-th.c: fix handling of pthread_attr_init/pthread_create in ClamukoScanOnAccess (bb#1169)

git-svn: trunk@4169

Tomasz Kojm authored on 2008/09/08 23:08:05
Showing 2 changed files
... ...
@@ -1,3 +1,8 @@
1
+Mon Sep  8 16:10:48 CEST 2008 (tk)
2
+----------------------------------
3
+  * clamd/server-th.c: fix handling of pthread_attr_init/pthread_create in
4
+		       ClamukoScanOnAccess (bb#1169)
5
+
1 6
 Thu Sep  4 12:53:44 EEST 2008 (edwin)
2 7
 -------------------------------------
3 8
  * configure: fix bzip2 cve test link problems (bb #1158)
... ...
@@ -503,14 +503,14 @@ int acceptloop_th(int *socketds, int nsockets, struct cl_engine *engine, unsigne
503 503
 #ifdef CLAMUKO
504 504
     {
505 505
         do {
506
-	    if(!pthread_attr_init(&clamuko_attr)) break;
506
+	    if(pthread_attr_init(&clamuko_attr)) break;
507 507
 	    pthread_attr_setdetachstate(&clamuko_attr, PTHREAD_CREATE_JOINABLE);
508 508
 	    if(!(tharg = (struct thrarg *) malloc(sizeof(struct thrarg)))) break;
509 509
 	    tharg->copt = copt;
510 510
 	    tharg->engine = engine;
511 511
 	    tharg->limits = &limits;
512 512
 	    tharg->options = options;
513
-	    if(pthread_create(&clamuko_pid, &clamuko_attr, clamukoth, tharg)) break;
513
+	    if(!pthread_create(&clamuko_pid, &clamuko_attr, clamukoth, tharg)) break;
514 514
 	    free(tharg);
515 515
 	    tharg=NULL;
516 516
 	} while(0);