fflush before _exit()

svn path=/trunk/boinc/; revision=8516
This commit is contained in:
David Anderson 2005-10-05 20:39:00 +00:00
parent 4217228def
commit 2b31d91773
5 changed files with 21 additions and 3 deletions

View File

@ -385,7 +385,7 @@ void boinc_exit(int status) {
// This is not pretty but unless someone finds a cleaner solution,
// we handle the Mac-case separately .
#ifdef __APPLE_CC__
fflush(stderr);
fflush(NULL);
_exit(status);
#else
exit(status);

View File

@ -12773,3 +12773,15 @@ David 5 Oct 2005
Rom 5 Oct 2005 (staging)
- Tag for 5.1.7 release, all platforms
boinc_core_release_5_1_7
David 5 Oct 2005
- before any _exit() (API, app start, etc.) do a fflush(NULL)
(from Bruce Allen)
api/
boinc_api.C
client/
app_start.C
cs_benchmark.C
clientgui/mac/
mac_saver_module.cpp

View File

@ -442,6 +442,7 @@ int ACTIVE_TASK::start(bool first_time) {
retval = chdir(slot_dir);
if (retval) {
perror("chdir");
fflush(NULL);
_exit(retval);
}
@ -460,6 +461,7 @@ int ACTIVE_TASK::start(bool first_time) {
"execv(%s) failed: %s\n", buf, boincerror(retval)
);
perror("execv");
fflush(NULL);
_exit(errno);
}

View File

@ -168,7 +168,7 @@ DWORD WINAPI win_cpu_benchmarks(LPVOID p) {
#endif
void CLIENT_STATE::start_cpu_benchmarks() {
int i;
int i, retval;
SCOPE_MSG_LOG scope_messages(log_messages, CLIENT_MSG_LOG::DEBUG_MEASUREMENT);
@ -208,7 +208,9 @@ void CLIENT_STATE::start_cpu_benchmarks() {
sprintf(benchmark_descs[i].filename, "%s_%d.xml", CPU_BENCHMARKS_FILE_NAME, i);
PROCESS_ID pid = fork();
if (pid == 0) {
_exit(cpu_benchmarks(benchmark_descs+i));
retval = cpu_benchmarks(benchmark_descs+i);
fflush(NULL);
_exit(retval);
} else {
benchmark_descs[i].pid = pid;
}

View File

@ -208,10 +208,12 @@ OSStatus initBOINCApp() {
status = chdir(buf);
if (status) {
perror("chdir");
fflush(NULL);
_exit(status);
}
status = execl(boincPath, "boinc", "-redirectio", (char *) 0);
fflush(NULL);
_exit(127); // execl error (execl should never return)
} else {
CoreClientPID = myPid; // make this available globally