From d5ab72c675eedfeaf9ce9aec2572e4451f2ac75a Mon Sep 17 00:00:00 2001 From: rswindell <> Date: Sun, 17 Oct 2004 07:18:12 +0000 Subject: [PATCH] fmutex() will write the local hostname to the file if no text specified. --- src/sbbs3/nopen.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/sbbs3/nopen.c b/src/sbbs3/nopen.c index 4ca29e9647..e7adc0630e 100644 --- a/src/sbbs3/nopen.c +++ b/src/sbbs3/nopen.c @@ -115,9 +115,12 @@ BOOL ftouch(const char* fname) BOOL fmutex(const char* fname, const char* text) { int file; + char hostname[128]; if((file=open(fname,O_CREAT|O_WRONLY|O_EXCL,S_IREAD|S_IWRITE))<0) return(FALSE); + if(text==NULL && gethostname(hostname,sizeof(hostname))==0) + text=hostname; if(text!=NULL) write(file,text,strlen(text)); close(file); -- GitLab