Skip to content

Commit 681a5aa

Browse files
committed
fix build with musl
`sys/types.h` is indirectly included with `glibc`, but needs to be specified explicitly on musl. The symbol collisions on `__attr_dealloc_free` require including auparse first for some reason.
1 parent 1e19b77 commit 681a5aa

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

auplugin/auplugin.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
* Steve Grubb <sgrubb@redhat.com>
2121
*/
2222

23+
#include "auplugin.h" // needs to happen before other audit includes or musl explodes when __attr_dealloc_free is used from libaudit.h
24+
2325
#include "config.h"
2426
#include <pthread.h>
2527
#include <signal.h>
@@ -34,7 +36,6 @@
3436
AUDIT_HIDDEN_START
3537
#include "queue.h"
3638
AUDIT_HIDDEN_END
37-
#include "auplugin.h"
3839

3940
/*
4041
* The library maintains global state for its queue and worker threads.

auplugin/auplugin.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
#define _AUPLUGIN_H_
2626

2727
#include <stddef.h>
28-
#include <libaudit.h>
2928
#include <auparse.h>
29+
#include <libaudit.h>
3030

3131
#ifndef __attr_access
3232
# define __attr_access(x)

lib/audit_logging.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
// Next include is to pick up the function attribute macros
2727
#include <features.h>
28+
#include <sys/types.h>
2829
#include <audit-records.h>
2930

3031
#ifdef __cplusplus

0 commit comments

Comments
 (0)