Ignore:
Timestamp:
Nov 30, 2011, 2:58:20 PM (14 years ago)
Author:
dmik
Message:

Use pid instead of the ordinal number in log file names.

This in particular fixes the problem when WGSS50 writes to the log
before the ordinal is correctly initialized by KERNEL32 which resulted
into two processes writing to the same log file.

This also guarantees that a subsequent re-run will not vanish the
previous log file which is also useful sometimes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/gcc-kmk/src/kernel32/winimagepeldr.cpp

    r21824 r21837  
    4141
    4242#ifdef DEBUG
     43#include <process.h>
    4344//use a different logfile
    4445#define PRIVATE_LOGGING
     
    8687 char logname[CCHMAXPATH];
    8788
    88     sprintf(logname, "pe_%d.log", loadNr);
     89    sprintf(logname, "pe_%d.log", getpid());
    8990        _privateLogFile = fopen(logname, "w");
    9091    if(_privateLogFile == NULL) {
    91         sprintf(logname, "%spe_%d.log", kernel32Path, loadNr);
     92        sprintf(logname, "%spe_%d.log", kernel32Path, getpid());
    9293            _privateLogFile = fopen(logname, "w");
    9394    }
Note: See TracChangeset for help on using the changeset viewer.