
James at kyzo
Aug 28, 2003, 6:29 AM
Post #1 of 1
(666 views)
Permalink
|
|
rmdirs... and a fix for "mbox.c" !
|
|
I was having problems with "rmdirs" going into spinloops when called from "clamscan", so I re-coded it - attached. I've also devised my own "quick and dirty" solution to the problem of "clamd" crashing and leaking memory. Seeing as the problem seems to be mainly in "mbox" i've ditched it and replaced it with "ripmime". On the 375 test messages I have been using it is also 12 seconds faster (89 secs down to 77 secs). So, here's my new "mbox.c" :- -------------------------------------------------------------- #include <stdio.h> #include <stdlib.h> #include <unistd.h> #define RIPMIME "/usr/local/bin/ripmime" int cl_mbox(const char *dir, int desc) { int ret,stat; ret = fork(); if (ret==-1) return -1; if (ret==0) { if (desc) dup2(desc,0); execlp(RIPMIME,RIPMIME,"-d",dir,"-i","-",NULL); exit(-1); } waitpid(ret,&stat,0); return 0; } -------------------------------------------------------------- James
|