aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--URPM.xs9
-rw-r--r--perl-URPM.spec7
2 files changed, 11 insertions, 5 deletions
diff --git a/URPM.xs b/URPM.xs
index d1c6ffa..51a0c5d 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -738,9 +738,9 @@ static void *rpmRunTransactions_callback(const void *h,
const void * pkgKey,
void * data) {
static int last_amount;
- static FD_t fd = NULL;
static struct timeval tprev;
static struct timeval tcurr;
+ static FD_t fd = NULL;
long delta;
int i;
struct s_TransactionData *td = data;
@@ -812,11 +812,12 @@ static void *rpmRunTransactions_callback(const void *h,
PUTBACK;
i = call_sv(callback, callback == td->callback_open ? G_SCALAR : G_DISCARD);
SPAGAIN;
- if (i != 1 && callback == td->callback_open) croak("callback_open should return a file handle");
- if (i == 1) {
+ if (callback == td->callback_open) {
+ if (i != 1) croak("callback_open should return a file handle");
i = POPi;
fd = fdDup(i);
fd = fdLink(fd, "persist perl-URPM");
+ Fcntl(fd, F_SETFD, 1); /* necessary to avoid forked/execed process to lock removable */
PUTBACK;
} else if (callback == td->callback_close) {
fd = fdFree(fd, "persist perl-URPM");
@@ -829,7 +830,7 @@ static void *rpmRunTransactions_callback(const void *h,
LEAVE;
}
}
- return fd;
+ return callback == td->callback_open ? fd : NULL;
}
MODULE = URPM PACKAGE = URPM::Package PREFIX = Pkg_
diff --git a/perl-URPM.spec b/perl-URPM.spec
index 8eacbdf..768eaae 100644
--- a/perl-URPM.spec
+++ b/perl-URPM.spec
@@ -1,7 +1,7 @@
%define name perl-URPM
%define real_name URPM
%define version 0.81
-%define release 10mdk
+%define release 11mdk
%{expand:%%define rpm_version %(rpm -q --queryformat '%{VERSION}-%{RELEASE}' rpm)}
@@ -49,6 +49,11 @@ rm -rf $RPM_BUILD_ROOT
%changelog
+* Mon Mar 3 2003 François Pons <fpons@mandrakesoft.com> 0.81-11mdk
+- fixed duplicated filehandle not with close-on-exec flag
+ which caused removable device to be locked on some case
+ using urpmi.
+
* Thu Feb 27 2003 François Pons <fpons@mandrakesoft.com> 0.81-10mdk
- allow choices to return mulitple selection.