summaryrefslogtreecommitdiff
path: root/rpmio/rpmlog.c
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2003-01-28 17:17:26 +0000
committerjbj <devnull@localhost>2003-01-28 17:17:26 +0000
commitc63f257a7ebd1d41a3caf38172251bdb2e6c0b20 (patch)
treeb915754e18cb70148686f0c3f75d4f7bfcf9121c /rpmio/rpmlog.c
parentb4352eaa31f458d0eee5bf9b319982ded7fb246f (diff)
downloadlibrpm-tizen-c63f257a7ebd1d41a3caf38172251bdb2e6c0b20.tar.gz
librpm-tizen-c63f257a7ebd1d41a3caf38172251bdb2e6c0b20.tar.bz2
librpm-tizen-c63f257a7ebd1d41a3caf38172251bdb2e6c0b20.zip
- fix: clean relocation path for --prefix=/.
- python: permit stdout/stderr to be remapped to install.log. CVS patchset: 6031 CVS date: 2003/01/28 17:17:26
Diffstat (limited to 'rpmio/rpmlog.c')
-rw-r--r--rpmio/rpmlog.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/rpmio/rpmlog.c b/rpmio/rpmlog.c
index 13abea8c6..4d8e8d9c0 100644
--- a/rpmio/rpmlog.c
+++ b/rpmio/rpmlog.c
@@ -124,6 +124,18 @@ rpmlogCallback rpmlogSetCallback(rpmlogCallback cb)
return ocb;
}
+/*@unchecked@*/ /*@null@*/
+static FILE * _stdlog = NULL;
+
+FILE * rpmlogSetFile(FILE * fp)
+ /*@globals _stdlog @*/
+ /*@modifies _stdlog @*/
+{
+ FILE * ofp = _stdlog;
+ _stdlog = fp;
+ return ofp;
+}
+
/*@-readonlytrans@*/ /* FIX: double indirection. */
/*@observer@*/ /*@unchecked@*/
static char *rpmlogMsgPrefix[] = {
@@ -158,7 +170,7 @@ static void vrpmlog (unsigned code, const char *fmt, va_list ap)
/*@unused@*/ unsigned fac = RPMLOG_FAC(code);
char *msgbuf, *msg;
int msgnb = BUFSIZ, nb;
- FILE * msgout = stderr;
+ FILE * msgout = (_stdlog ? _stdlog : stderr);
if ((mask & rpmlogMask) == 0)
return;
@@ -216,7 +228,7 @@ static void vrpmlog (unsigned code, const char *fmt, va_list ap)
switch (pri) {
case RPMLOG_INFO:
case RPMLOG_NOTICE:
- msgout = stdout;
+ msgout = (_stdlog ? _stdlog : stdout);
break;
case RPMLOG_EMERG: