SHA256
1
0
forked from pool/schily
schily/schily-2018-05-25_star_detect_gzip_failures.patch
Jan Engelhardt 214927d25b Accepting request 614590 from home:kstreitova:branches:utilities
- add patches from the star package
  * schily-2018-05-25_star_configuration.patch
  * schily-2018-05-25_star_no_fsync.patch
  * schily-2018-05-25_star_lock.patch
  * schily-2018-05-25_star_detect_gzip_failures.patch
  * schily-2018-05-25_star_bufferoverflow.patch
  * schily-2018-05-25_star_use_ssh_by_default.patch
  * schily-2018-05-25_star_selinux.patch
- add missing BuildRequires for star:
  * autoconf (because of selinux patch)
  * libacl-devel
  * libattr-devel
  * libselinux-devel
  * libtool
- install README-FIRST (as schily-rmt) documentation
- add noreplace for %_sysconfdir/default/rmt and
  %_sysconfdir/default/star
- move srmt from sbindir to bindir
- do not ship star_sym and suntar

OBS-URL: https://build.opensuse.org/request/show/614590
OBS-URL: https://build.opensuse.org/package/show/utilities/schily?expand=0&rev=27
2018-06-06 14:57:44 +00:00

89 lines
2.4 KiB
Diff

Index: schily-2018-05-25/star/buffer.c
===================================================================
--- schily-2018-05-25.orig/star/buffer.c
+++ schily-2018-05-25/star/buffer.c
@@ -1804,6 +1804,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);
}
@@ -1879,6 +1883,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.
*/
@@ -1894,6 +1908,8 @@ compressopen()
int mypid;
char *zip_prog = "gzip";
+ compresspid = 0;
+
if (compress_prg)
zip_prog = compress_prg;
else if (bzflag)
@@ -1957,6 +1973,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");
@@ -1986,7 +2003,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: schily-2018-05-25/star/star.c
===================================================================
--- schily-2018-05-25.orig/star/star.c
+++ schily-2018-05-25/star/star.c
@@ -117,6 +117,7 @@ char strvers[] = "1.5.4"; /* 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: schily-2018-05-25/star/star.h
===================================================================
--- schily-2018-05-25.orig/star/star.h
+++ schily-2018-05-25/star/star.h
@@ -870,9 +870,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>