aboutsummaryrefslogtreecommitdiffstats
path: root/URPM.xs
diff options
context:
space:
mode:
Diffstat (limited to 'URPM.xs')
-rw-r--r--URPM.xs14
1 files changed, 14 insertions, 0 deletions
diff --git a/URPM.xs b/URPM.xs
index e1fefb9..d125cd4 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -239,6 +239,13 @@ struct _FD_s {
};
/*@access FD_t@*/
+static int rpmError_callback_data;
+void rpmError_callback() {
+ if (rpmErrorCode() != RPMERR_UNLINK && rpmErrorCode() != RPMERR_RMDIR) {
+ write(rpmError_callback_data, rpmErrorString(), strlen(rpmErrorString()));
+ }
+}
+
static inline
void fdInitDigest(FD_t fd, pgpHashAlgo hashalgo, int flags)
/*@modifies fd @*/
@@ -3643,4 +3650,11 @@ setVerbosity(level)
const char *
rpmErrorString()
+void
+rpmErrorWriteTo(fd)
+ int fd
+ CODE:
+ rpmError_callback_data = fd;
+ rpmErrorSetCallback(rpmError_callback);
+
/* vim:set ts=8 sts=2 sw=2: */