From e31b272d277f772adda649270b713aab3572c4e2 Mon Sep 17 00:00:00 2001 From: Nicholas Lydeen Date: Fri, 27 Mar 2015 21:38:48 -0500 Subject: [PATCH] Altered kernel version check to allow 4.x.x kernels --- src/mbpfan.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mbpfan.c b/src/mbpfan.c index 42f0178..17dd759 100755 --- a/src/mbpfan.c +++ b/src/mbpfan.c @@ -71,9 +71,9 @@ bool is_legacy_kernel() char *str_kernel_version; str_kernel_version = strtok(kernel.release, "."); - if (atoi(str_kernel_version) != 3){ - syslog(LOG_INFO, "mbpfan detected a non 3.x.x linux kernel. Detected version: %s. Exiting.\n", kernel.release); - printf("mbpfan detected a non 3.x.x linux kernel. Detected version: %s. Exiting.\n", kernel.release); + if (atoi(str_kernel_version) < 3){ + syslog(LOG_INFO, "mbpfan detected a pre-3.x.x linux kernel. Detected version: %s. Exiting.\n", kernel.release); + printf("mbpfan detected a pre-3.x.x linux kernel. Detected version: %s. Exiting.\n", kernel.release); exit(EXIT_FAILURE); } @@ -90,7 +90,7 @@ bool is_legacy_kernel() } } - return (kernel_version < 15); + return (atoi(kernel.release) == 3 && kernel_version < 15); }