Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15:Update
star
bnc#858660_detect_gzip_failures.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File bnc#858660_detect_gzip_failures.patch of Package star
Index: star-1.5.3/star/buffer.c =================================================================== --- star-1.5.3.orig/star/buffer.c +++ star-1.5.3/star/buffer.c @@ -1793,6 +1793,10 @@ checkerrs() errmsgno(EX_BAD, "Problems with restore database.\n"); return (TRUE); } + if (xstats.s_comprerrs > 0) { + errmsgno(EX_BAD, "Compress program returned error[%d].\n", xstats.s_comprerrs); + return (TRUE); + } return (FALSE); } @@ -1868,6 +1872,16 @@ die(err) excomerrno(err, "Cannot recover from error - exiting.\n"); } +void sigchld_handler(int sig) +{ + int status; + pid_t pid; + while ((pid = wait4(compresspid, &status, 0, NULL)) > 0) { + if (pid == compresspid) + xstats.s_comprerrs = WEXITSTATUS(status); + } + +} /* * Quick hack to implement a -z flag. May be changed soon. */ @@ -1883,6 +1897,8 @@ compressopen() int mypid; char *zip_prog = "gzip"; + compresspid = 0; + if (compress_prg) zip_prog = compress_prg; else if (bzflag) @@ -1946,6 +1962,7 @@ compressopen() #else if (fpipe(pp) == 0) comerr("Compress pipe failed\n"); + signal(SIGCHLD, sigchld_handler); mypid = fork(); if (mypid < 0) comerr("Compress fork failed\n"); @@ -1975,7 +1992,10 @@ compressopen() fexecl(zip_prog, tarf, pp[1], null, zip_prog, "-d", (char *)NULL); errmsg("Compress: exec of '%s' failed\n", zip_prog); _exit(-1); + } else { + compresspid = mypid; } + fclose(tarf); if (cflag) { tarf = pp[1]; Index: star-1.5.3/star/star.c =================================================================== --- star-1.5.3.orig/star/star.c +++ star-1.5.3/star/star.c @@ -115,6 +115,7 @@ char strvers[] = "1.5.3"; /* The pure v char *vers; /* the full version string */ struct star_stats xstats; /* for printing statistics */ +pid_t compresspid = 0; extern BOOL havepat; /* Pattern matching in use */ Index: star-1.5.3/star/star.h =================================================================== --- star-1.5.3.orig/star/star.h +++ star-1.5.3/star/star.h @@ -858,9 +858,11 @@ struct star_stats { int s_setxattr; /* set xattr for file failed */ #endif int s_restore; /* other incremental restore specific */ + int s_comprerrs; /* errors of compress-subprogram */ }; extern struct star_stats xstats; +extern pid_t compresspid; /* pid of compress-subprogram child */ #include <schily/param.h>
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor