mirror of
https://github.com/troglobit/finit.git
synced 2026-10-18 10:59:34 +00:00
keventd: rename fgetln() -> fgetline()
Apparently fgetln() is available in musl libc, but not glibc. This is a funciton that first appeared in 4.4BSD. We take a risk that fgetline() is free in all libc's, getline() is not. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
d08cbd77aa
commit
e706300b6d
1 file changed
+3
-3
+3
-3
@@ -80,7 +80,7 @@ static void sys_cond(char *cond, int set)
|
||||
}
|
||||
}
|
||||
|
||||
static int fgetln(char *path, char *buf, size_t len)
|
||||
static int fgetline(char *path, char *buf, size_t len)
|
||||
{
|
||||
FILE *fp;
|
||||
|
||||
@@ -155,11 +155,11 @@ static void init(void)
|
||||
char buf[10];
|
||||
|
||||
snprintf(path, sizeof(path), "%s/%s/type", _PATH_SYSFS_PWR, nm);
|
||||
if (!fgetln(path, buf, sizeof(buf)) && is_ac(buf)) {
|
||||
if (!fgetline(path, buf, sizeof(buf)) && is_ac(buf)) {
|
||||
num_ac++;
|
||||
|
||||
snprintf(path, sizeof(path), "%s/%s/online", _PATH_SYSFS_PWR, nm);
|
||||
if (!fgetln(path, buf, sizeof(buf))) {
|
||||
if (!fgetline(path, buf, sizeof(buf))) {
|
||||
if (check_online(buf))
|
||||
num_ac_online++;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user