summaryrefslogtreecommitdiff
path: root/lib/libalpm
diff options
context:
space:
mode:
authorAaron Griffin <aaron@archlinux.org>2007-01-17 07:21:07 +0000
committerAaron Griffin <aaron@archlinux.org>2007-01-17 07:21:07 +0000
commit1bea7706ae076677387e123cfed0dfbbc68f6691 (patch)
treee0046eb4155c80be7b2edbd5b273b886d44a1c07 /lib/libalpm
parentaea6626fded11f3395ec509635ffec5b5f5d3436 (diff)
downloadpacman-1bea7706ae076677387e123cfed0dfbbc68f6691.tar.xz
* Misc logging changes
Addition of a forced fflush in an attempt to diagnose mutli-logging Removal of varargs from the internal logaction function, they are handled in alpm_logaction just fine
Diffstat (limited to 'lib/libalpm')
-rw-r--r--lib/libalpm/util.c14
-rw-r--r--lib/libalpm/util.h2
2 files changed, 6 insertions, 10 deletions
diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c
index ec4b7eef..ecdd82c6 100644
--- a/lib/libalpm/util.c
+++ b/lib/libalpm/util.c
@@ -343,17 +343,12 @@ int _alpm_rmrf(char *path)
return(0);
}
-int _alpm_logaction(unsigned char usesyslog, FILE *f, char *fmt, ...)
+int _alpm_logaction(unsigned char usesyslog, FILE *f, const char *str)
{
- char msg[1024];
- va_list args;
-
- va_start(args, fmt);
- vsnprintf(msg, 1024, fmt, args);
- va_end(args);
+ _alpm_log(PM_LOG_DEBUG, _("logaction called: %s"), str);
if(usesyslog) {
- syslog(LOG_WARNING, "%s", msg);
+ syslog(LOG_WARNING, "%s", str);
}
if(f) {
@@ -366,7 +361,8 @@ int _alpm_logaction(unsigned char usesyslog, FILE *f, char *fmt, ...)
fprintf(f, "[%02d/%02d/%02d %02d:%02d] %s\n",
tm->tm_mon+1, tm->tm_mday, tm->tm_year-100,
tm->tm_hour, tm->tm_min,
- msg);
+ str);
+ fflush(f);
}
return(0);
diff --git a/lib/libalpm/util.h b/lib/libalpm/util.h
index cda65a3a..73e1c14e 100644
--- a/lib/libalpm/util.h
+++ b/lib/libalpm/util.h
@@ -62,7 +62,7 @@ int _alpm_lckmk(char *file);
int _alpm_lckrm(char *file);
int _alpm_unpack(const char *archive, const char *prefix, const char *fn);
int _alpm_rmrf(char *path);
-int _alpm_logaction(unsigned char usesyslog, FILE *f, char *fmt, ...);
+int _alpm_logaction(unsigned char usesyslog, FILE *f, const char *str);
int _alpm_ldconfig(char *root);
#ifdef _ALPM_TRANS_H
int _alpm_runscriptlet(char *util, char *installfn, char *script, char *ver, char *oldver, pmtrans_t *trans);