Ticket #1203: fix_retval_of_read_stderr_file.diff

File fix_retval_of_read_stderr_file.diff, 900 bytes (added by Nicolas, 12 years ago)

Make read_stderr_file pass the error code of read_file_malloc instead of always returning ERR_MALLOC.

  • client/app_control.cpp

     
    818818int ACTIVE_TASK::read_stderr_file() {
    819819    char* buf1, *buf2;
    820820    char path[MAXPATHLEN];
     821    int retval;
    821822
    822823    // truncate stderr output to the last 63KB;
    823824    // it's unlikely that more than that will be useful
     
    825826    int max_len = 63*1024;
    826827    sprintf(path, "%s/%s", slot_dir, STDERR_FILE);
    827828    if (!boinc_file_exists(path)) return 0;
    828     if (read_file_malloc(path, buf1, max_len, !config.stderr_head)) {
    829         return ERR_MALLOC;
    830     }
     829
     830    retval = read_file_malloc(path, buf1, max_len, !config.stderr_head)
     831    if (retval) return retval;
    831832
    832833    // if it's a vbox app, check for string in stderr saying
    833834    // the job failed because CPU VM extensions disabled