From f8d8aa1cea915ce115345e6e729eddc80e86f021 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Tue, 6 Apr 2010 18:50:05 +0200 Subject: libbb: add skip_dev_pfx() Signed-off-by: Denys Vlasenko --- util-linux/rtcwake.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'util-linux/rtcwake.c') diff --git a/util-linux/rtcwake.c b/util-linux/rtcwake.c index 66b08e343..b16376655 100644 --- a/util-linux/rtcwake.c +++ b/util-linux/rtcwake.c @@ -35,9 +35,8 @@ static NOINLINE bool may_wakeup(const char *rtcname) ssize_t ret; char buf[128]; - /* strip the '/dev/' from the rtcname here */ - if (!strncmp(rtcname, "/dev/", 5)) - rtcname += 5; + /* strip "/dev/" from the rtcname here */ + rtcname = skip_dev_pfx(rtcname); snprintf(buf, sizeof(buf), SYS_RTC_PATH, rtcname); ret = open_read_close(buf, buf, sizeof(buf)); -- cgit v1.2.3