summaryrefslogtreecommitdiff
path: root/src/util/cleanupdelta.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/cleanupdelta.c')
-rw-r--r--src/util/cleanupdelta.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/util/cleanupdelta.c b/src/util/cleanupdelta.c
index 4a67fc38..190e2c70 100644
--- a/src/util/cleanupdelta.c
+++ b/src/util/cleanupdelta.c
@@ -35,17 +35,19 @@ static void cleanup(int signum)
exit(signum);
}
-__attribute__((format(printf, 2, 0)))
-static void output_cb(alpm_loglevel_t level, const char *fmt, va_list args)
+static void output_cb(alpm_event_log_t *event)
{
- if(strlen(fmt)) {
- switch(level) {
+ if(event->type != ALPM_EVENT_LOG) {
+ return;
+ }
+ if(strlen(event->fmt)) {
+ switch(event->level) {
case ALPM_LOG_ERROR: printf("error: "); break;
case ALPM_LOG_WARNING: printf("warning: "); break;
/* case ALPM_LOG_DEBUG: printf("debug: "); break; */
default: return;
}
- vprintf(fmt, args);
+ vprintf(event->fmt, event->args);
}
}
@@ -126,7 +128,7 @@ int main(int argc, char *argv[])
}
/* let us get log messages from libalpm */
- alpm_option_set_logcb(handle, output_cb);
+ alpm_option_set_eventcb(handle, (alpm_cb_event) output_cb);
checkdbs(dbnames);
alpm_list_free(dbnames);