From 321d4d4441ccfcad54727d5b55f62d885cd6777e Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Mon, 2 Dec 2024 11:05:05 +0100 Subject: [PATCH] lib/fs/readlink/: readlinknul(): Fix return type Fixes: 419ce14b6f72 (2024-11-01, "lib/fs/readlink/: readlinknul(): Add function") Cc: Serge Halyn Signed-off-by: Alejandro Colomar --- lib/fs/readlink/readlinknul.c | 3 ++- lib/fs/readlink/readlinknul.h | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/fs/readlink/readlinknul.c b/lib/fs/readlink/readlinknul.c index 4baea0d01..b0fc2a786 100644 --- a/lib/fs/readlink/readlinknul.c +++ b/lib/fs/readlink/readlinknul.c @@ -7,7 +7,8 @@ #include "fs/readlink/readlinknul.h" #include +#include -extern inline int readlinknul(const char *restrict link, char *restrict buf, +extern inline ssize_t readlinknul(const char *restrict link, char *restrict buf, size_t size); diff --git a/lib/fs/readlink/readlinknul.h b/lib/fs/readlink/readlinknul.h index 495fc71ef..d3634588c 100644 --- a/lib/fs/readlink/readlinknul.h +++ b/lib/fs/readlink/readlinknul.h @@ -22,12 +22,12 @@ ATTR_STRING(1) -inline int readlinknul(const char *restrict link, char *restrict buf, +inline ssize_t readlinknul(const char *restrict link, char *restrict buf, size_t size); // Similar to readlink(2), but terminate the string. -inline int +inline ssize_t readlinknul(const char *restrict link, char *restrict buf, size_t size) { size_t len;