PennMUSH Community

Changeset 1060

Show
Ignore:
Timestamp:
08/05/07 01:53:46 (1 year ago)
Author:
shawnw
Message:

Merge db save failure fixes from devel into trunk

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • 1.8.3/trunk/CHANGES.182

    r1036 r1060  
    1313 
    1414========================================================================== 
     15 
     16Version 1.8.2 patchlevel 7                       ????  ??, 2007 
     17 
     18Fixes: 
     19  * Clarified the behavior of eval() and get_eval() in help. 
     20    Suggested by Talvo and Javelin. 
     21  * A failed db save no longer broadcasts a success message 
     22    in addition to a failure one. Reported by Cooee. 
     23  * The open database file wasn't getting closed on a failed 
     24    save. 
    1525 
    1626Version 1.8.2 patchlevel 6                       July 9, 2007 
  • 1.8.3/trunk/src/game.c

    r1032 r1060  
    9595extern const unsigned char *tables; 
    9696extern void conf_default_set(void); 
    97 static int dump_database_internal(void); 
     97static bool dump_database_internal(void); 
    9898static FILE *db_open(const char *filename); 
    9999static FILE *db_open_write(const char *filename); 
     
    310310jmp_buf db_err; 
    311311 
    312 static int 
     312static bool 
    313313dump_database_internal(void) 
    314314{ 
     
    330330    flag_broadcast("WIZARD ROYALTY", 0, 
    331331                   T("GAME: ERROR! Database save failed!")); 
     332    if (f) 
     333      db_close(f); 
    332334#ifndef PROFILING 
    333335#ifdef HAS_ITIMER 
     
    335337#endif 
    336338#endif 
    337     return 1
     339    return false
    338340  } else { 
    339341    local_dump_database(); 
     
    413415#endif 
    414416 
    415   return 0
     417  return true
    416418} 
    417419 
     
    512514 
    513515  do_rawlog(LT_ERR, "DUMPING: %s.#%d#", globals.dumpfile, epoch); 
    514   dump_database_internal(); 
    515   do_rawlog(LT_ERR, "DUMPING: %s.#%d# (done)", globals.dumpfile, epoch); 
     516  if (dump_database_internal()) 
     517    do_rawlog(LT_ERR, "DUMPING: %s.#%d# (done)", globals.dumpfile, epoch); 
    516518} 
    517519 
     
    529531{ 
    530532  pid_t child; 
    531   int nofork, status, split; 
     533  bool nofork, status, split; 
    532534  epoch++; 
    533535 
     
    606608    } else { 
    607609      reserve_fd(); 
    608       if (DUMP_NOFORK_COMPLETE && *DUMP_NOFORK_COMPLETE) 
     610      if (status && DUMP_NOFORK_COMPLETE && *DUMP_NOFORK_COMPLETE) 
    609611        flag_broadcast(0, 0, "%s", DUMP_NOFORK_COMPLETE); 
    610612    }