Back to index

wims  3.65+svn20090927
Functions
cleaning.c File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void cleantmpdir (void)
void delete_pid (void)

Function Documentation

void cleantmpdir ( void  )

Definition at line 21 of file cleaning.c.

{
    char buf[MAX_LINELEN+1], *p1, *p2;
    
    accessfile(buf,"r","%s/exec.pid",tmp_dir);
    for(p1=find_word_start(buf); *p1; p1=find_word_start(p2)) {
       p2=find_word_end(p1); if(*p2) *p2++=0;
       kill(atoi(p1),SIGKILL);
    }
    if(strstr(tmp_dir,"sessions/")!=NULL && 
       (strstr(tmp_debug,"yes")==NULL || checkhost(manager_site)<1)) {
       if(remove_tree(tmp_dir)) {
           call_ssh("bin/ch..root cleantmpdir 2>/dev/null");
           remove_tree(tmp_dir);
       }
    }
    else {
       mkfname(buf,"%s/exec.pid",tmp_dir);
       unlink(buf);
       if(strstr(tmp_dir,"sessions/")!=NULL) {
           chmod(tmp_dir,S_IRUSR|S_IWUSR|S_IXUSR);
       }
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void delete_pid ( void  )

Definition at line 47 of file cleaning.c.

{
    char buf[MAX_FNAME+1],pbuf[32];

    flushlog(); flushoutput();
    if(robot_access || *session_prefix==0) return;
    cleantmpdir();
    mkfname(buf,"%s/.pid",s2_prefix);
    readfile(buf,pbuf,sizeof(pbuf));
    if(pbuf[0] && strcmp(pbuf,pidbuf)==0) unlink(buf);
    flushlog();
}

Here is the call graph for this function:

Here is the caller graph for this function: