aboutsummaryrefslogtreecommitdiffstats
path: root/URPM.xs
diff options
context:
space:
mode:
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");