From 6b9564109a101bd1f80b1659805dff9cd3dc7ef3 Mon Sep 17 00:00:00 2001
From: Rob Swindell <rob@synchro.net>
Date: Sat, 13 Mar 2021 12:46:12 -0800
Subject: [PATCH] Fix error removing INPUT.MSG introduced in Commit d02fc1a2

remove() is expected to fail in this scenario sometimes depending
on how writemsg() is used - in the error case, the user was trying
to edit his .plan file with the ;plan command:
term Node 10 <Deuce> !ERROR 11 (Resource temporarily unavailable) in writemsg.cpp line 1232 (editfile) removing "/sbbs/node10/temp/INPUT.MSG" access=0

Thanks for the bug report!
---
 src/sbbs3/writemsg.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/sbbs3/writemsg.cpp b/src/sbbs3/writemsg.cpp
index 05e33f10df..96b4a93f31 100644
--- a/src/sbbs3/writemsg.cpp
+++ b/src/sbbs3/writemsg.cpp
@@ -1228,8 +1228,7 @@ bool sbbs_t::editfile(char *fname, bool msg)
 
 		msg_tmp_fname(useron_xedit, msgtmp, sizeof(msgtmp));
 		if(stricmp(msgtmp,path)) {
-			if(removecase(msgtmp) != 0)
-				errormsg(WHERE, ERR_REMOVE, msgtmp, 0);
+			(void)removecase(msgtmp);
 			if(fexistcase(path))
 				CopyFile(path, msgtmp, /* failIfExists: */FALSE);
 		}
-- 
GitLab