diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2005-08-23 12:15:59 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2005-08-23 12:15:59 +0000 |
commit | 0866f38d3e50f6b3d963788120e1bc2f46fbe0a4 (patch) | |
tree | d743198abef1e27b48db668832e842fc167be554 /URPM.xs | |
parent | 9c542cd3f87a099ee8b099984e55396bb7df50d1 (diff) | |
download | perl-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.xs | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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"); |