summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--hpec/hpec_zaptel.h9
2 files changed, 10 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index f9f7502..ae99e1e 100644
--- a/Makefile
+++ b/Makefile
@@ -164,7 +164,7 @@ ifeq ($(ARCH),x86_64)
ZAPTEL_HPEC:=hpec/hpec_x86_64.o_shipped
endif
-CFLAGS+=-DECHO_CAN_HPEC -I$(PWD)/hpec
+KFLAGS+=-DECHO_CAN_HPEC -I$(PWD)/hpec
zaptel-base.o: hpec/hpec_zaptel.h hpec/hpec_user.h
endif
diff --git a/hpec/hpec_zaptel.h b/hpec/hpec_zaptel.h
index 1de9a85..b03bfe6 100644
--- a/hpec/hpec_zaptel.h
+++ b/hpec/hpec_zaptel.h
@@ -33,9 +33,18 @@ static int __attribute__((regparm(0))) __attribute__((format (printf, 1, 2))) lo
int res;
va_list args;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
va_start(args, format);
res = vprintk(format, args);
va_end(args);
+#else
+ char buf[256];
+
+ va_start(args, format);
+ res = vsnprintf(buf, sizeof(buf), format, args);
+ va_end(args);
+ printk(buf);
+#endif
return res;
}