From 784016befb64087f7f6f573312df39ece9bae0de Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Thu, 10 May 2007 00:53:51 +0000
Subject: [PATCH] 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).

---
 src/sbbs3/nopen.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/sbbs3/nopen.c b/src/sbbs3/nopen.c
index c40e84a2b7..5c7ff77d7d 100644
--- a/src/sbbs3/nopen.c
+++ b/src/sbbs3/nopen.c
@@ -8,7 +8,7 @@
  * @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				*
@@ -111,9 +111,13 @@ BOOL ftouch(const char* fname)
 {
 	int file;
 
-	if((file=nopen(fname,O_WRONLY|O_CREAT))<0)
-		return(FALSE);
-	close(file);
+	if(!fexist(fname)) {	/* create the file */
+		if((file=nopen(fname,O_WRONLY|O_CREAT))<0)
+			return(FALSE);
+		close(file);
+	}
+	/* update the time stamp */
+	utime(fname,NULL);
 
 	return(TRUE);
 }
-- 
GitLab