libpacketmark: fix call of initialization function

Rather than using the internal symbol _init, simply let the compiler handle
it by marking it as a constructor. This fixes running the initialization on
some architectures like ARM.
This commit is contained in:
Matthias Schiffer 2017-10-25 14:10:09 +02:00
parent 6d2b807fba
commit 5249974a3c
No known key found for this signature in database
GPG Key ID: 16EF3F64CB201D9C
2 changed files with 3 additions and 4 deletions

View File

@ -1,9 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libpacketmark
PKG_VERSION:=1
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
PKG_VERSION:=2
include $(INCLUDE_DIR)/package.mk

View File

@ -38,7 +38,8 @@ static int mark;
static int (*socket_real)(int domain, int type, int protocol);
void _init(void) {
__attribute__((constructor))
static void init(void) {
const char *str = getenv("LIBPACKETMARK_MARK");
if (str)
mark = atoi(str);