]>
Commit | Line | Data |
---|---|---|
f4407f8b AM |
1 | --- watchdog-5.6.orig/src/wd_keepalive.c |
2 | +++ watchdog-5.6/src/wd_keepalive.c | |
3 | @@ -138,9 +138,10 @@ | |
4 | } | |
5 | ||
6 | while ( !feof(wc) ) { | |
7 | - char line[CONFIG_LINE_LEN]; | |
8 | + char *line = NULL; | |
9 | + size_t n; | |
10 | ||
11 | - if ( fgets(line, CONFIG_LINE_LEN, wc) == NULL ) { | |
12 | + if (getline(&line, &n, wc) == -1) { | |
13 | if ( !ferror(wc) ) | |
14 | break; | |
15 | else { | |
16 | --- watchdog-5.6.orig/src/watchdog.c | |
17 | +++ watchdog-5.6/src/watchdog.c | |
18 | @@ -25,6 +25,7 @@ | |
19 | #include <sys/wait.h> | |
20 | #include <sys/stat.h> | |
21 | #include <sys/types.h> | |
22 | +#include <sys/ioctl.h> | |
23 | #include <linux/watchdog.h> | |
24 | #define __USE_GNU | |
25 | #include <string.h> | |
26 | @@ -253,9 +254,10 @@ | |
27 | } | |
28 | ||
29 | while (!feof(wc)) { | |
30 | - char line[CONFIG_LINE_LEN]; | |
31 | + char *line = NULL; | |
32 | + size_t n; | |
33 | ||
34 | - if (fgets(line, CONFIG_LINE_LEN, wc) == NULL) { | |
35 | + if (getline(&line, &n, wc) == -1) { | |
36 | if (!ferror(wc)) | |
37 | break; | |
38 | else { | |
39 | @@ -690,7 +692,7 @@ | |
40 | driver default) */ | |
41 | if (ioctl(watchdog, WDIOC_SETTIMEOUT, &devtimeout) < 0) { | |
42 | #if USE_SYSLOG | |
43 | - syslog(LOG_ERR, "cannot set timeout %s (errno = %d = '%m')", strerror(errno), devtimeout, errno); | |
44 | + syslog(LOG_ERR, "cannot set timeout %d (errno = %d = '%m')", devtimeout, errno); | |
45 | #else | |
46 | perror(progname); | |
47 | #endif | |
48 |