diff options
author | Francois Pons <fpons@mandriva.com> | 2002-01-17 10:05:12 +0000 |
---|---|---|
committer | Francois Pons <fpons@mandriva.com> | 2002-01-17 10:05:12 +0000 |
commit | 492b556e340f2722ad860950ed0245e5ea9335ba (patch) | |
tree | da7dec00cbed43275ab4fac886d1050c98aefccc /rpmtools.xs | |
parent | e2d2e1cd01b98d736652443c65fd42a00d1d5ecb (diff) | |
download | rpmtools-492b556e340f2722ad860950ed0245e5ea9335ba.tar rpmtools-492b556e340f2722ad860950ed0245e5ea9335ba.tar.gz rpmtools-492b556e340f2722ad860950ed0245e5ea9335ba.tar.bz2 rpmtools-492b556e340f2722ad860950ed0245e5ea9335ba.tar.xz rpmtools-492b556e340f2722ad860950ed0245e5ea9335ba.zip |
4.0-6mdk4.0.6
Diffstat (limited to 'rpmtools.xs')
-rw-r--r-- | rpmtools.xs | 13 |
1 files changed, 13 insertions, 0 deletions
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 { |