011-012.diff.bz2
patches · 2.0 KB · 2010-03-30
Download « Back to the patches list
diff -buraP 011/HACKLOG 012/HACKLOG
--- 011/HACKLOG 2008-10-09 05:48:15.000000000 -0400
+++ 012/HACKLOG 2008-10-09 06:23:51.000000000 -0400
@@ -416,3 +416,9 @@
On the upside, it is kindof nice that it doesn't have to check
all the data files for substitution values on every checkout.
+ 0621 Removed all references to fpReserve. This is from the old days
+ when the number of file descriptors was very limited, and it was
+ fairly common to be unable to open a file because you had too
+ many sockets active. I can't imagine this is still an issue,
+ even if you have 500 players. Out it goes!
+
diff -buraP 011/src/ban.c 012/src/ban.c
--- 011/src/ban.c 2008-10-09 05:48:15.000000000 -0400
+++ 012/src/ban.c 2008-10-09 06:23:51.000000000 -0400
@@ -1,5 +1,5 @@
/*
- * RAM $Id: ban.c 11 2008-10-09 09:48:15Z quixadhal $
+ * RAM $Id: ban.c 12 2008-10-09 10:23:51Z quixadhal $
*/
/***************************************************************************
@@ -52,7 +52,6 @@
FILE *fp;
bool found = FALSE;
- fclose( fpReserve );
if ( ( fp = fopen( BAN_FILE, "w" ) ) == NULL )
{
perror( BAN_FILE );
@@ -69,7 +68,6 @@
}
fclose(fp);
- fpReserve = fopen( NULL_FILE, "r" );
if (!found)
unlink(BAN_FILE);
}
diff -buraP 011/src/comm.c 012/src/comm.c
--- 011/src/comm.c 2008-10-09 05:48:15.000000000 -0400
+++ 012/src/comm.c 2008-10-09 06:23:51.000000000 -0400
@@ -1,5 +1,5 @@
/*
- * RAM $Id: comm.c 11 2008-10-09 09:48:15Z quixadhal $
+ * RAM $Id: comm.c 12 2008-10-09 10:23:51Z quixadhal $
*/
/***************************************************************************
@@ -92,7 +92,6 @@
*/
DESCRIPTOR_DATA * descriptor_list; /* All open descriptors */
/* DESCRIPTOR_DATA * d_next; *//* Next descriptor in loop */
-FILE * fpReserve; /* Reserved file handle */
bool god; /* All new chars are gods! */
bool merc_down; /* Shutdown */
bool wizlock; /* Game is wizlocked */
@@ -145,15 +144,6 @@
strcpy( str_boot_time, ctime( ¤t_time ) );
/*
- * Reserve one channel for our use.
- */
- if ( ( fpReserve = fopen( NULL_FILE, "r" ) ) == NULL )
- {
- perror( NULL_FILE );
- exit( 1 );
- }
-
- /*
* Get the port number.
*/
port = 4000;
diff -buraP 011/src/db.c 012/src/db.c
--- 011/src/db.c 2008-10-09 05:48:15.000000000 -0400
+++ 012/src/db.c 2008-10-09 06:23:51.000000000 -0400
@@ -1,5 +1,5 @@
/*
- * RAM $Id: db.c 11 2008-10-09 09:48:15Z quixadhal $
+ * RAM $Id: db.c 12 2008-10-09 10:23:51Z quixadhal $
*/
/***************************************************************************
@@ -2788,7 +2788,6 @@
int vnum,nMatch = 0;
/* open file */
- fclose(fpReserve);
fp = fopen("mem.dmp","w");
/* report use of data structures */
@@ -2912,7 +2911,6 @@
/* close file */
fclose(fp);
- fpReserve = fopen( NULL_FILE, "r" );
}
@@ -3246,7 +3244,6 @@
if ( IS_NPC(ch) || str[0] == '\0' )
return;
- fclose( fpReserve );
if ( ( fp = fopen( file, "a" ) ) == NULL )
{
perror( file );
@@ -3259,7 +3256,6 @@
fclose( fp );
}
- fpReserve = fopen( NULL_FILE, "r" );
return;
}
@@ -3308,13 +3304,11 @@
sprintf( buf + strlen(buf), str, param );
log_string( buf );
/* RT removed due to bug-file spamming
- fclose( fpReserve );
if ( ( fp = fopen( BUG_FILE, "a" ) ) != NULL )
{
fprintf( fp, "%s\n", buf );
fclose( fp );
}
- fpReserve = fopen( NULL_FILE, "r" );
*/
return;
diff -buraP 011/src/merc.h 012/src/merc.h
--- 011/src/merc.h 2008-10-09 05:48:15.000000000 -0400
+++ 012/src/merc.h 2008-10-09 06:23:51.000000000 -0400
@@ -1,5 +1,5 @@
/*
- * RAM $Id: merc.h 11 2008-10-09 09:48:15Z quixadhal $
+ * RAM $Id: merc.h 12 2008-10-09 10:23:51Z quixadhal $
*/
/***************************************************************************
@@ -1923,7 +1923,6 @@
extern char bug_buf [];
extern time_t current_time;
extern bool fLogAll;
-extern FILE * fpReserve;
extern KILL_DATA kill_table [];
extern char log_buf [];
extern TIME_INFO_DATA time_info;
diff -buraP 011/src/note.c 012/src/note.c
--- 011/src/note.c 2008-10-09 05:48:15.000000000 -0400
+++ 012/src/note.c 2008-10-09 06:23:51.000000000 -0400
@@ -1,5 +1,5 @@
/*
- * RAM $Id: note.c 11 2008-10-09 09:48:15Z quixadhal $
+ * RAM $Id: note.c 12 2008-10-09 10:23:51Z quixadhal $
*/
/***************************************************************************
@@ -182,7 +182,6 @@
break;
}
- fclose( fpReserve );
if ( ( fp = fopen( name, "w" ) ) == NULL )
{
perror( name );
@@ -199,7 +198,6 @@
fprintf( fp, "Text\n%s~\n", pnote->text);
}
fclose( fp );
- fpReserve = fopen( NULL_FILE, "r" );
return;
}
}
@@ -328,7 +326,6 @@
last->next = pnote;
}
- fclose(fpReserve);
if ( ( fp = fopen(name, "a" ) ) == NULL )
{
perror(name);
@@ -343,7 +340,6 @@
fprintf( fp, "Text\n%s~\n", pnote->text);
fclose( fp );
}
- fpReserve = fopen( NULL_FILE, "r" );
}
bool is_note_to( CHAR_DATA *ch, NOTE_DATA *pnote )
diff -buraP 011/src/save.c 012/src/save.c
--- 011/src/save.c 2008-10-09 05:48:15.000000000 -0400
+++ 012/src/save.c 2008-10-09 06:23:51.000000000 -0400
@@ -1,5 +1,5 @@
/*
- * RAM $Id: save.c 11 2008-10-09 09:48:15Z quixadhal $
+ * RAM $Id: save.c 12 2008-10-09 10:23:51Z quixadhal $
*/
/***************************************************************************
@@ -115,7 +115,6 @@
/* create god log */
if (IS_IMMORTAL(ch) || ch->level >= LEVEL_IMMORTAL)
{
- fclose(fpReserve);
sprintf(strsave, "%s%s",GOD_DIR, capitalize(ch->name));
if ((fp = fopen(strsave,"w")) == NULL)
{
@@ -126,10 +125,8 @@
fprintf(fp,"Lev %2d Trust %2d %s%s\n",
ch->level, get_trust(ch), ch->name, ch->pcdata->title);
fclose( fp );
- fpReserve = fopen( NULL_FILE, "r" );
}
- fclose( fpReserve );
sprintf( strsave, "%s%s", PLAYER_DIR, capitalize( ch->name ) );
if ( ( fp = fopen( TEMP_FILE, "w" ) ) == NULL )
{
@@ -148,7 +145,6 @@
}
fclose( fp );
rename(TEMP_FILE,strsave);
- fpReserve = fopen( NULL_FILE, "r" );
return;
}
@@ -565,7 +561,6 @@
ch->pcdata->condition[COND_HUNGER] = 48;
found = FALSE;
- fclose( fpReserve );
/* decompress if .gz file exists */
sprintf( strsave, "%s%s%s", PLAYER_DIR, capitalize(name),".gz");
@@ -618,9 +613,6 @@
fclose( fp );
}
- fpReserve = fopen( NULL_FILE, "r" );
-
-
/* initialize race */
if (found)
{