PennMUSH Community

Changeset 784

Show
Ignore:
Timestamp:
04/24/07 16:46:48 (2 years ago)
Author:
shawnw
Message:

#5851: Closing stdin and stdout

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • 1.8.2/branches/devel/CHANGES.182

    r779 r784  
    3535    on. Suggested by Dan Widdis. [SW] 
    3636 *  '{think foo} bar' exhibited odd behavior. [GM] 
     37 *  'make test' wouldn't work right unless '.' was in you path. 
     38     Fix by Nathan Baum. 
     39 *  stdin and stdout weren't getting closed, potentially causing 
     40    problems when trying to log out of a shell after starting 
     41    a mush. Reported by K Moon. [SW] 
    3742 
    3843Version 1.8.2 patchlevel 3                      March 11, 2007 
  • 1.8.2/branches/devel/hdrs/log.h

    r463 r784  
    1515extern void start_all_logs(void); 
    1616extern void end_all_logs(void); 
    17 extern void redirect_stderr(void); 
     17extern void redirect_streams(void); 
    1818extern void WIN32_CDECL do_log 
    1919  (int logtype, dbref player, dbref object, const char *fmt, ...) 
  • 1.8.2/branches/devel/src/game.c

    r527 r784  
    738738  config_file_startup(conf, 0); 
    739739  start_all_logs(); 
    740   redirect_stderr(); 
     740  redirect_streams(); 
    741741 
    742742  /* Initialize the attribute chunk storage */ 
  • 1.8.2/branches/devel/src/log.c

    r467 r784  
    122122} 
    123123 
    124 /** Redirect stderr to a error log file.  
     124/** Redirect stderr to a error log file and close stdout and stdin.  
    125125 * Should be called after start_all_logs(). 
    126126 * \param log name of logfile to redirect stderr to. 
    127127 */ 
    128128void 
    129 redirect_stderr(void) 
     129redirect_streams(void) 
    130130{ 
    131131  FILE *errlog_fp; 
     
    144144    fclose(errlog_fp); 
    145145  } 
     146#ifndef DEBUG_BYTECODE 
     147  fclose(stdout); 
     148#endif 
     149  fclose(stdin); 
    146150} 
    147151