Skip to content

Commit e7dd42e

Browse files
committed
changes to legacy kernel detection
1 parent 591b37a commit e7dd42e

5 files changed

Lines changed: 27 additions & 16 deletions

File tree

AUTHORS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Olivier Tilmans
1212
Yamakaky <yamakaky AT gmail DOT com>
1313
Yi Yang <ahyangyi AT gmail DOT com>
1414
Herminio Hernandez Jr <herminio.hernandezjr AT gmail DOT com>
15-
Robert Musial <rmmm AT member DOT fsf DOT org>
15+
Robert Musial <rmusial AT fastmail DOT com>
1616

1717

1818
ORIGINARY AUTHORS

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ Supported distributions:
3030
- RedHat
3131
- CentOS
3232
- Gentoo
33-
33+
- Alpine
34+
- Trisquel
3435

3536
Tested Macbook Models
3637
---------------------

src/daemon.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Copyright (C) 2012 Peter Lombardo <http://peterlombardo.wikidot.com/linux-daemon-in-c>
33
* Modifications (2012) by Ismail Khatib <ikhatib@gmail.com>
44
* Modifications (2012-present) by Daniel Graziotin <daniel@ineed.coffee>
5-
* Modifications (2017-present) by Robert Musial <rmmm@member.fsf.org>
5+
* Modifications (2017-present) by Robert Musial <rmusial@fastmail.com>
66
*
77
* This program is free software: you can redistribute it and/or modify
88
* it under the terms of the GNU General Public License as published by

src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* Copyright (C) (2012-present) Daniel Graziotin <daniel@ineed.coffee>
3-
* Modifications (2017-present) by Robert Musial <rmmm@member.fsf.org>
3+
* Modifications (2017-present) by Robert Musial <rmusial@fastmail.com>
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by

src/mbpfan.c

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Modifications by Rafael Vega <rvega@elsoftwarehamuerto.org>
55
* Modifications (2012) by Ismail Khatib <ikhatib@gmail.com>
66
* Modifications (2012-present) by Daniel Graziotin <daniel@ineed.coffee> [CURRENT MAINTAINER]
7-
* Modifications (2017-present) by Robert Musial <rmmm@member.fsf.org>
7+
* Modifications (2017-present) by Robert Musial <rmusial@fastmail.com>
88
*
99
* This program is free software: you can redistribute it and/or modify
1010
* it under the terms of the GNU General Public License as published by
@@ -75,20 +75,30 @@ bool is_legacy_kernel()
7575
exit(EXIT_FAILURE);
7676
}
7777

78-
str_kernel_version = strtok(NULL, ".");
79-
int kernel_version = atoi(str_kernel_version);
78+
79+
// thanks http://stackoverflow.com/questions/18192998/plain-c-opening-a-directory-with-fopen
80+
fopen("/sys/devices/platform/coretemp.0/hwmon", "wb");
8081

81-
if(verbose) {
82-
printf("Detected kernel version: %s\n", kernel.release);
83-
printf("Detected kernel minor revision: %s\n", str_kernel_version);
84-
85-
if(daemonize) {
86-
syslog(LOG_INFO, "Kernel version: %s", kernel.release);
87-
syslog(LOG_INFO, "Detected kernel minor revision: %s", str_kernel_version);
88-
}
82+
if (errno == EISDIR) {
83+
return 0;
84+
} else {
85+
return 1;
8986
}
9087

91-
return (atoi(kernel.release) == 3 && kernel_version < 15);
88+
// str_kernel_version = strtok(NULL, ".");
89+
// int kernel_version = atoi(str_kernel_version);
90+
91+
// if(verbose) {
92+
// printf("Detected kernel version: %s\n", kernel.release);
93+
// printf("Detected kernel minor revision: %s\n", str_kernel_version);
94+
95+
// if(daemonize) {
96+
// syslog(LOG_INFO, "Kernel version: %s", kernel.release);
97+
// syslog(LOG_INFO, "Detected kernel minor revision: %s", str_kernel_version);
98+
// }
99+
// }
100+
101+
// return (atoi(kernel.release) == 3 && kernel_version < 15);
92102
}
93103

94104

0 commit comments

Comments
 (0)