Commit 15ef937a authored by rswindell's avatar rswindell
Browse files

Using new ftouch() function for signaling/creating semaphore files.

parent 1400f577
......@@ -394,9 +394,7 @@ bool sbbs_t::netmail(char *into, char *title, long mode)
cc_sent++; }
if(cfg.netmail_sem[0]) /* update semaphore file */
if((file=nopen(cmdstr(cfg.netmail_sem,nulstr,nulstr,NULL)
,O_WRONLY|O_CREAT|O_TRUNC))!=-1)
close(file);
ftouch(cmdstr(cfg.netmail_sem,nulstr,nulstr,NULL));
FREE(buf);
return(true);
......@@ -705,9 +703,7 @@ void sbbs_t::qwktonetmail(FILE *rep, char *block, char *into, uchar fromhub)
else { /* Successful */
if(inet) {
if(cfg.inetmail_sem[0]) /* update semaphore file */
if((fido=nopen(cmdstr(cfg.inetmail_sem,nulstr,nulstr,NULL)
,O_WRONLY|O_CREAT|O_TRUNC))!=-1)
close(fido);
ftouch(cmdstr(cfg.inetmail_sem,nulstr,nulstr,NULL));
if(!(useron.exempt&FLAG('S')))
subtract_cdt(&cfg,&useron,cfg.inetmail_cost); }
......@@ -864,9 +860,7 @@ void sbbs_t::qwktonetmail(FILE *rep, char *block, char *into, uchar fromhub)
close(fido);
FREE((char *)qwkbuf);
if(cfg.netmail_sem[0]) /* update semaphore file */
if((fido=nopen(cmdstr(cfg.netmail_sem,nulstr,nulstr,NULL)
,O_WRONLY|O_CREAT|O_TRUNC))!=-1)
close(fido);
ftouch(cmdstr(cfg.netmail_sem,nulstr,nulstr,NULL));
if(!(useron.exempt&FLAG('S')))
subtract_cdt(&cfg,&useron,cfg.netmail_cost);
......
......@@ -1821,9 +1821,7 @@ static void receive_thread(void* arg)
putextdesc(&scfg,f.dir,f.datoffset,ext);
if(scfg.dir[f.dir]->upload_sem[0])
if((file=sopen(scfg.dir[f.dir]->upload_sem,O_WRONLY|O_CREAT|O_TRUNC
,SH_DENYNO,S_IREAD|S_IWRITE))!=-1)
close(file);
ftouch(scfg.dir[f.dir]->upload_sem);
/**************************/
/* Update Uploader's Info */
/**************************/
......
......@@ -265,9 +265,7 @@ bool sbbs_t::inetmail(char *into, char *subj, long mode)
autohangup();
if(cfg.inetmail_sem[0]) /* update semaphore file */
if((file=nopen(cmdstr(cfg.inetmail_sem,nulstr,nulstr,NULL)
,O_WRONLY|O_CREAT|O_TRUNC))!=-1)
close(file);
ftouch(cmdstr(cfg.inetmail_sem,nulstr,nulstr,NULL));
if(!(useron.exempt&FLAG('S')))
subtract_cdt(&cfg,&useron,cfg.inetmail_cost);
......
......@@ -398,20 +398,15 @@ bool sbbs_t::postmsg(uint subnum, smbmsg_t *remsg, long wm_mode)
extern "C" void DLLCALL signal_sub_sem(scfg_t* cfg, uint subnum)
{
char str[MAX_PATH+1];
int file;
if(subnum==INVALID_SUB || subnum>=cfg->total_subs) /* e-mail? */
return;
/* signal semaphore files */
if(cfg->sub[subnum]->misc&SUB_FIDO && cfg->echomail_sem[0])
if((file=nopen(cmdstr(cfg,NULL,cfg->echomail_sem,nulstr,nulstr,str)
,O_WRONLY|O_CREAT|O_TRUNC))!=-1)
close(file);
ftouch(cmdstr(cfg,NULL,cfg->echomail_sem,nulstr,nulstr,str));
if(cfg->sub[subnum]->post_sem[0])
if((file=nopen(cmdstr(cfg,NULL,cfg->sub[subnum]->post_sem,nulstr,nulstr,str)
,O_WRONLY|O_CREAT|O_TRUNC))!=-1)
close(file);
ftouch(cmdstr(cfg,NULL,cfg->sub[subnum]->post_sem,nulstr,nulstr,str));
}
extern "C" int DLLCALL savemsg(scfg_t* cfg, smb_t* smb, smbmsg_t* msg, char* msgbuf)
......
......@@ -438,8 +438,7 @@ bool sbbs_t::unpack_rep(char* repfile)
if(dir!=NULL)
closedir(dir);
sprintf(str,"%sqnet-rep.now",cfg.data_dir);
if((file=nopen(str,O_WRONLY|O_CREAT|O_TRUNC))!=-1)
close(file);
ftouch(str);
}
bputs(text[QWKUnpacked]);
......
......@@ -195,9 +195,7 @@ bool sbbs_t::uploadfile(file_t *f)
,f->name,cfg.lib[cfg.dir[f->dir]->lib]->sname
,cfg.dir[f->dir]->sname);
if(cfg.dir[f->dir]->upload_sem[0])
if((file=nopen(cmdstr(cfg.dir[f->dir]->upload_sem,nulstr,nulstr,NULL)
,O_WRONLY|O_CREAT|O_TRUNC))!=-1)
close(file);
ftouch(cmdstr(cfg.dir[f->dir]->upload_sem,nulstr,nulstr,NULL));
logline("U+",str);
/**************************/
/* Update Uploader's Info */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment