From f2d268b847e19bbb5f674dfafc4452c35918e868 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Tue, 7 Feb 2012 22:39:00 +0000 Subject: (open_archive) clean API --- URPM.xs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/URPM.xs b/URPM.xs index b9e3dad..90e896f 100644 --- a/URPM.xs +++ b/URPM.xs @@ -999,7 +999,7 @@ update_provides_files(URPM__Package pkg, HV *provides) { } FD_t -open_archive(char *filename, pid_t *pid, int *empty_archive) { +open_archive(char *filename, int *empty_archive) { int fd; FD_t rfd = NULL; struct { @@ -3395,11 +3395,10 @@ Urpm_parse_hdlist__XS(urpm, filename, ...) HV *obsoletes = fobsoletes && SvROK(*fobsoletes) && SvTYPE(SvRV(*fobsoletes)) == SVt_PVHV ? (HV*)SvRV(*fobsoletes) : NULL; if (depslist != NULL) { - pid_t pid = 0; int empty_archive = 0; FD_t fd; - fd = open_archive(filename, &pid, &empty_archive); + fd = open_archive(filename, &empty_archive); if (empty_archive) { mXPUSHs(newSViv(1 + av_len(depslist))); @@ -3453,13 +3452,7 @@ Urpm_parse_hdlist__XS(urpm, filename, ...) int ok = Fclose(fd) == 0; - if (pid) { - kill(pid, SIGTERM); - int status; - int rc = waitpid(pid, &status, 0); - ok = rc != -1 && WEXITSTATUS(status) != 1; /* in our standard case, gzip will exit with status code 2, meaning "decompression OK, trailing garbage ignored" */ - pid = 0; - } else if (!empty_archive) { + if (!empty_archive) { ok = av_len(depslist) >= start_id; } SPAGAIN; -- cgit v1.2.1