- wrapper: if a child exits with nonzero status X,

call boinc_finish() with ERR_CHILD_FAILED rather than X.
    If X is zero in the low-order byte
    (e.g. if the program isn't executable)
    the BOINC client will restart us, which isn't what we want.

svn path=/trunk/boinc_samples/; revision=14858
This commit is contained in:
David Anderson 2008-03-06 16:15:17 +00:00
parent 1e1c8ee5bf
commit 480f497e03
2 changed files with 18 additions and 2 deletions

View File

@ -543,3 +543,13 @@ Charlie 21 Feb 2008
mac/ mac/
uc2_graphics.icns uc2_graphics.icns
app_icon.h app_icon.h
David 6 Mar 2008
- wrapper: if a child exits with nonzero status X,
call boinc_finish() with ERR_CHILD_FAILED rather than X.
If X is zero in the low-order byte
(e.g. if the program isn't executable)
the BOINC client will restart us, which isn't what we want.
wrapper/
wrapper.C

View File

@ -490,8 +490,14 @@ int main(int argc, char** argv) {
int status; int status;
if (task.poll(status)) { if (task.poll(status)) {
if (status) { if (status) {
fprintf(stderr, "app error: 0x%x\n", status); fprintf(stderr, "app exit status: 0x%x\n", status);
boinc_finish(status); // On Unix, if the app is non-executable,
// the child status will be 0x6c00.
// If we return this the client will treat it
// as recoverable, and restart us.
// We don't want this, so return an 8-bit error code.
//
boinc_finish(ERR_CHILD_FAILED);
} }
break; break;
} }