Skip to content
Snippets Groups Projects
Commit 784016be authored by rswindell's avatar rswindell
Browse files

Bug-fix: ftouch() now updates the time-stamp on a file if it already exists

(doh!)
This explains why some sysops don't see SCFG save-changes forcing an sbbsctrl
config reload (it wasn't updating the timestamp of ctrl/recycle if the file
already existed).
parent bbe680fd
No related branches found
No related tags found
No related merge requests found
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * * @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 * * This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License * * modify it under the terms of the GNU General Public License *
...@@ -111,9 +111,13 @@ BOOL ftouch(const char* fname) ...@@ -111,9 +111,13 @@ BOOL ftouch(const char* fname)
{ {
int file; int file;
if((file=nopen(fname,O_WRONLY|O_CREAT))<0) if(!fexist(fname)) { /* create the file */
return(FALSE); if((file=nopen(fname,O_WRONLY|O_CREAT))<0)
close(file); return(FALSE);
close(file);
}
/* update the time stamp */
utime(fname,NULL);
return(TRUE); return(TRUE);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment