Get rid of RET_SYS, just use RET_FAIL
RET_SYS was used for commands failing due to internal or environmental errors, but not really systematically. The difference to RET_FAIL is how dispatch() treats them: RET_SYS got logged, and cost no BTUs. More specific logging is possible at the point of failure than in dispatch(). Make sure that's done for all failures that used to return RET_SYS. The change in BTU charging affects commands consider, offer, repay, trade failing due to internal errors. It also affects deity commands reload and turn (irrelevant because deities get unlimited BTUs), and commands apropos, info and motd (irrelevant because they cost no BTUs).
This commit is contained in:
parent
e803950463
commit
29aefc356f
10 changed files with 42 additions and 36 deletions
|
@ -62,7 +62,7 @@ turn(void)
|
|||
if ((unlink(downfil) == -1) && (errno != ENOENT)) {
|
||||
pr("Could not remove no-login file, logins still disabled.\n");
|
||||
logerror("Could not remove no-login file (%s).\n", downfil);
|
||||
return RET_SYS;
|
||||
return RET_FAIL;
|
||||
}
|
||||
return RET_OK;
|
||||
} else {
|
||||
|
@ -89,7 +89,7 @@ turn(void)
|
|||
pr("Could not remove motd.\n");
|
||||
logerror("Could not remove motd file (%s).\n",
|
||||
msgfilepath);
|
||||
return RET_SYS;
|
||||
return RET_FAIL;
|
||||
}
|
||||
return RET_OK;
|
||||
} else
|
||||
|
@ -100,7 +100,7 @@ turn(void)
|
|||
if (fptr == NULL) {
|
||||
pr("Something went wrong opening the message file.\n");
|
||||
logerror("Could not open message file (%s).\n", msgfilepath);
|
||||
return RET_SYS;
|
||||
return RET_FAIL;
|
||||
}
|
||||
|
||||
if (msgfilepath == downfil)
|
||||
|
@ -112,13 +112,13 @@ turn(void)
|
|||
pr("Something went wrong writing the message file.\n");
|
||||
logerror("Could not properly write message file (%s).\n",
|
||||
msgfilepath);
|
||||
return RET_SYS;
|
||||
return RET_FAIL;
|
||||
}
|
||||
if (fclose(fptr)) {
|
||||
pr("Something went wrong closing the message.\n");
|
||||
logerror("Could not properly close message file (%s).\n",
|
||||
msgfilepath);
|
||||
return RET_SYS;
|
||||
return RET_FAIL;
|
||||
}
|
||||
|
||||
pr("\n");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue