(main,mobility_check,upda,turn,rea,mobupdate,ef_open,logerror,
emp_config,gamedown,show_motd,match_user,typed_wu, delete_old_announcements) [_WIN32]: switch the default file mode to binary to match POSIX. Remove the now unneccessary ifdef for the open/fopen. Add text mode for user files (econfig/auth).
This commit is contained in:
parent
f6e78f4589
commit
1a8488bc45
13 changed files with 14 additions and 65 deletions
|
@ -112,6 +112,10 @@ main(int argc, char **argv)
|
|||
char *config_file = NULL;
|
||||
s_char tbuf[256];
|
||||
|
||||
#if defined(_WIN32)
|
||||
_fmode = _O_BINARY;
|
||||
#endif
|
||||
|
||||
loginit("server");
|
||||
|
||||
mainpid = getpid();
|
||||
|
|
|
@ -52,11 +52,7 @@ mobility_check(void *unused)
|
|||
while (1) {
|
||||
time(&now);
|
||||
/* logerror("Updating timestamp file at %s", ctime(&now));*/
|
||||
#if !defined(_WIN32)
|
||||
if ((fp = fopen(timestampfil, "r+")) == NULL) {
|
||||
#else
|
||||
if ((fp = fopen(timestampfil, "r+b")) == NULL) {
|
||||
#endif
|
||||
logerror("Unable to edit timestamp file.");
|
||||
continue;
|
||||
}
|
||||
|
@ -101,11 +97,7 @@ mobility_init(void)
|
|||
mobility */
|
||||
|
||||
time(&now);
|
||||
#if !defined(_WIN32)
|
||||
if ((fp = fopen(timestampfil, "r+")) == NULL) {
|
||||
#else
|
||||
if ((fp = fopen(timestampfil, "r+b")) == NULL) {
|
||||
#endif
|
||||
logerror("Unable to edit timestamp file.");
|
||||
/* FIXME safe to continue? */
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue