diff options
-rw-r--r-- | rpmtools.pm | 1 | ||||
-rw-r--r-- | rpmtools.spec | 6 | ||||
-rw-r--r-- | rpmtools.xs | 13 |
3 files changed, 18 insertions, 2 deletions
diff --git a/rpmtools.pm b/rpmtools.pm index 10b0475..3695d73 100644 --- a/rpmtools.pm +++ b/rpmtools.pm @@ -118,7 +118,6 @@ sub read_hdlists { if (my $pid = fork()) { close O; - select(undef, undef, undef, 0.05); push @names, rpmtools::_parse_(fileno *I, $params->{flags}, $params->{info}, $params->{provides}); close I; diff --git a/rpmtools.spec b/rpmtools.spec index 5229873..82ad4b4 100644 --- a/rpmtools.spec +++ b/rpmtools.spec @@ -1,5 +1,5 @@ %define name rpmtools -%define release 5mdk +%define release 6mdk # do not modify here, see Makefile in the CVS %define version 4.0 @@ -54,6 +54,10 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/perl5/man/*/* %changelog +* Thu Jan 17 2002 François Pons <fpons@mandrakesoft.com> 4.0-6mdk +- modified delay management in respect to rpmlib, use + select to wait for input before giving up to rpmlib. + * Wed Jan 16 2002 François Pons <fpons@mandrakesoft.com> 4.0-5mdk - added little delay when reading hdlist. diff --git a/rpmtools.xs b/rpmtools.xs index fc528e7..e73998d 100644 --- a/rpmtools.xs +++ b/rpmtools.xs @@ -3,8 +3,11 @@ #include "XSUB.h" #include <sys/utsname.h> +#include <sys/select.h> +#include <sys/time.h> #include <sys/types.h> #include <sys/stat.h> +#include <unistd.h> #include <fcntl.h> #undef Fflush @@ -487,6 +490,16 @@ _parse_(fileno_or_rpmfile, flag, info, ...) int i; if (SvIOK(fileno_or_rpmfile)) { + int d = SvIV(fileno_or_rpmfile); + fd_set readfds; + struct timeval timeout; + + FD_ZERO(&readfds); + FD_SET(d, &readfds); + timeout.tv_sec = 1; + timeout.tv_usec = 0; + select(d+1, &readfds, NULL, NULL, &timeout); + fd = fdDup(SvIV(fileno_or_rpmfile)); fd_is_hdlist = 1; } else { |