Ignore:
Timestamp:
May 7, 2008, 11:54:58 AM (12 years ago)
Author:
Bruno Cornec
Message:

Attempt to solve #244 by ignoring SIGPIPE during big file restore with gzip

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.6/mondo/src/mondorestore/mondorestore.c

    r1930 r1932  
    5454 * @{
    5555 */
    56 /**
    57  * If TRUE, then SIGPIPE was just caught.
    58  * Set by the signal handler; cleared after it's handled.
    59  */
    60 bool g_sigpipe_caught = FALSE;
    6156
    6257/**
     
    14901485        sprintf(command, "%s -dc > \"%s\" 2>> %s", bkpinfo->zip_exe,
    14911486                file_to_openout, MONDO_LOGFILE);
     1487        if (strcmp(bkpinfo->zip_exe, "gzip") == 0) {
     1488            /* Ignore SIGPIPE for gzip as it causes errors on big files
     1489             * Cf: http://trac.mondorescue.org/ticket/244
     1490             */
     1491            signal(SIGPIPE,SIG_IGN);
     1492        }
    14921493    }
    14931494    sprintf(tmp, "Pipe command = '%s'", command);
     
    15421543    }
    15431544    paranoid_pclose(pout);
     1545
     1546    if (bkpinfo->zip_exe[0]) {
     1547        if (strcmp(bkpinfo->zip_exe, "gzip") == 0) {
     1548            /* Re-enable SIGPIPE for gzip
     1549             */
     1550            signal(SIGPIPE, terminate_daemon);
     1551        }
     1552    }
    15441553
    15451554    log_msg(1, "pathname_of_last_file_restored is now %s",
Note: See TracChangeset for help on using the changeset viewer.