From e706300b6d6229b3a077585270279ed6ac595461 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Mon, 17 May 2021 00:44:39 +0200 Subject: [PATCH] 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 --- src/keventd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/keventd.c b/src/keventd.c index 3865e8ad..cfe09000 100644 --- a/src/keventd.c +++ b/src/keventd.c @@ -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++; }