--- sbbs/src/xpdev/semfile.c 2018/04/24 16:41:24 1.1.1.1 +++ sbbs/src/xpdev/semfile.c 2018/04/24 16:45:38 1.1.1.2 @@ -1,12 +1,12 @@ /* semfile.c */ -/* $Id: semfile.c,v 1.1.1.1 2018/04/24 16:41:24 root Exp $ */ +/* $Id: semfile.c,v 1.1.1.2 2018/04/24 16:45:38 root Exp $ */ /**************************************************************************** * @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * * * - * Copyright 2006 Rob Swindell - http://www.synchro.net/copyright.html * + * Copyright 2007 Rob Swindell - http://www.synchro.net/copyright.html * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License * @@ -126,17 +126,20 @@ void DLLCALL semfile_list_free(str_list_ BOOL DLLCALL semfile_signal(const char* fname, const char* text) { int file; + struct utimbuf ut; #if !defined(NO_SOCKET_SUPPORT) char hostname[128]; if(text==NULL && gethostname(hostname,sizeof(hostname))==0) text=hostname; #endif - if((file=open(fname,O_CREAT|O_WRONLY))<0) /* use sopen instead? */ + if((file=open(fname,O_CREAT|O_WRONLY,S_IREAD|S_IWRITE))<0) /* use sopen instead? */ return(FALSE); if(text!=NULL) write(file,text,strlen(text)); - /* use utime() for force the time-stamp to that of the local system? */ close(file); - return(TRUE); + + /* update the time stamp */ + ut.actime = ut.modtime = time(NULL); + return utime(fname, &ut)==0; }