diff options
author | Olivier Brunel <jjk@jjacky.com> | 2014-01-10 16:25:14 +0100 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2014-03-03 02:25:54 +0100 |
commit | 28dbd5551ee75e843019e6f067ed069daaabba0b (patch) | |
tree | 409a7b18a3363ae9a53da30ee17ce59fbc67dd5b /lib/libalpm/be_sync.c | |
parent | b6f6a165c4630cac86efb2608b9909b20488a710 (diff) | |
download | pacman-28dbd5551ee75e843019e6f067ed069daaabba0b.tar.gz pacman-28dbd5551ee75e843019e6f067ed069daaabba0b.tar.xz |
Update the event callback
Instead of using two void* arguments for all events, we now send one
pointer to an alpm_event_t struct. This contains the type of event that
was triggered.
With this information, the pointer can then be typecasted to the
event-specific struct in order to get additional arguments.
Signed-off-by: Olivier Brunel <jjk@jjacky.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'lib/libalpm/be_sync.c')
-rw-r--r-- | lib/libalpm/be_sync.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/libalpm/be_sync.c b/lib/libalpm/be_sync.c index 17a8a69f..df0b1b73 100644 --- a/lib/libalpm/be_sync.c +++ b/lib/libalpm/be_sync.c @@ -89,9 +89,13 @@ static int sync_db_validate(alpm_db_t *db) /* we can skip any validation if the database doesn't exist */ if(_alpm_access(db->handle, NULL, dbpath, R_OK) != 0 && errno == ENOENT) { + alpm_event_database_missing_t event = { + .type = ALPM_EVENT_DATABASE_MISSING, + .dbname = db->treename + }; db->status &= ~DB_STATUS_EXISTS; db->status |= DB_STATUS_MISSING; - EVENT(db->handle, ALPM_EVENT_DATABASE_MISSING, db->treename, NULL); + EVENT(db->handle, &event); goto valid; } db->status |= DB_STATUS_EXISTS; |