aboutsummaryrefslogtreecommitdiffstats
path: root/URPM.xs
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2005-08-23 12:15:59 +0000
committerPascal Rigaux <pixel@mandriva.com>2005-08-23 12:15:59 +0000
commit0866f38d3e50f6b3d963788120e1bc2f46fbe0a4 (patch)
treed743198abef1e27b48db668832e842fc167be554 /URPM.xs
parent9c542cd3f87a099ee8b099984e55396bb7df50d1 (diff)
downloadperl-URPM-0866f38d3e50f6b3d963788120e1bc2f46fbe0a4.tar
perl-URPM-0866f38d3e50f6b3d963788120e1bc2f46fbe0a4.tar.gz
perl-URPM-0866f38d3e50f6b3d963788120e1bc2f46fbe0a4.tar.bz2
perl-URPM-0866f38d3e50f6b3d963788120e1bc2f46fbe0a4.tar.xz
perl-URPM-0866f38d3e50f6b3d963788120e1bc2f46fbe0a4.zip
correctly handle -1 fileno returned by callback_open
Diffstat (limited to 'URPM.xs')
-rw-r--r--URPM.xs6
1 files changed, 4 insertions, 2 deletions
diff --git a/URPM.xs b/URPM.xs
index 312e96d..6762c08 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -1345,8 +1345,10 @@ static void *rpmRunTransactions_callback(const void *h,
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, (void *)1); /* necessary to avoid forked/execed process to lock removable */
+ if (fd) {
+ fd = fdLink(fd, "persist perl-URPM");
+ Fcntl(fd, F_SETFD, (void *)1); /* necessary to avoid forked/execed process to lock removable */
+ }
PUTBACK;
} else if (callback == td->callback_close) {
fd = fdFree(fd, "persist perl-URPM");