{
fprintf(stderr, _("%s: could not write to compressed file \"%s\": %s\n"),
progname, filename, get_gz_error(ztarfile));
+ disconnect_and_exit(1);
}
}
else
}
}
- if (strcmp(basedir, "-") == 0)
- {
#ifdef HAVE_LIBZ
- if (ztarfile)
- gzclose(ztarfile);
-#endif
+ if (ztarfile != NULL)
+ {
+ if (gzclose(ztarfile) != 0)
+ {
+ fprintf(stderr, _("%s: could not close compressed file \"%s\": %s\n"),
+ progname, filename, get_gz_error(ztarfile));
+ disconnect_and_exit(1);
+ }
}
else
- {
-#ifdef HAVE_LIBZ
- if (ztarfile != NULL)
- gzclose(ztarfile);
#endif
- if (tarfile != NULL)
- fclose(tarfile);
+ {
+ if (strcmp(basedir, "-") != 0)
+ {
+ if (fclose(tarfile) != 0)
+ {
+ fprintf(stderr, _("%s: could not close file \"%s\": %s\n"),
+ progname, filename, strerror(errno));
+ disconnect_and_exit(1);
+ }
+ }
}
break;
{
fprintf(stderr, _("%s: could not write to compressed file \"%s\": %s\n"),
progname, filename, get_gz_error(ztarfile));
+ disconnect_and_exit(1);
}
}
else