From 4ccbb23971f6e8b41073509fb4934f1dd1ea1e7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= Date: Mon, 28 Feb 2022 13:37:06 +0100 Subject: [PATCH] libshare: interface: {=> const} char * MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Brian Behlendorf Signed-off-by: Ahelenia ZiemiaƄska Closes #13165 --- lib/libshare/libshare.c | 10 +++++----- lib/libspl/include/libshare.h | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/libshare/libshare.c b/lib/libshare/libshare.c index 7bc31d7a68..f4684cc691 100644 --- a/lib/libshare/libshare.c +++ b/lib/libshare/libshare.c @@ -77,7 +77,7 @@ libshare_init(void) int sa_enable_share(const char *zfsname, const char *mountpoint, - const char *shareopts, char *protocol) + const char *shareopts, const char *protocol) { int rc, ret = SA_OK; boolean_t found_protocol = B_FALSE; @@ -111,7 +111,7 @@ sa_enable_share(const char *zfsname, const char *mountpoint, } int -sa_disable_share(const char *mountpoint, char *protocol) +sa_disable_share(const char *mountpoint, const char *protocol) { int rc, ret = SA_OK; boolean_t found_protocol = B_FALSE; @@ -140,7 +140,7 @@ sa_disable_share(const char *mountpoint, char *protocol) } boolean_t -sa_is_shared(const char *mountpoint, char *protocol) +sa_is_shared(const char *mountpoint, const char *protocol) { sa_fstype_t *fstype; boolean_t ret = B_FALSE; @@ -177,7 +177,7 @@ sa_commit_shares(const char *protocol) * * convert an error value to an error string */ -char * +const char * sa_errorstr(int err) { static char errstr[32]; @@ -295,7 +295,7 @@ sa_errorstr(int err) } int -sa_validate_shareopts(char *options, char *proto) +sa_validate_shareopts(const char *options, const char *proto) { sa_fstype_t *fstype; diff --git a/lib/libspl/include/libshare.h b/lib/libspl/include/libshare.h index 0395c28154..01a203538b 100644 --- a/lib/libspl/include/libshare.h +++ b/lib/libspl/include/libshare.h @@ -73,16 +73,16 @@ #define SA_SHARE_EXISTS 33 /* path or file is already shared */ /* initialization */ -_LIBSPL_LIBSHARE_H char *sa_errorstr(int); +_LIBSPL_LIBSHARE_H const char *sa_errorstr(int); /* share control */ _LIBSPL_LIBSHARE_H int sa_enable_share(const char *, const char *, const char *, - char *); -_LIBSPL_LIBSHARE_H int sa_disable_share(const char *, char *); -_LIBSPL_LIBSHARE_H boolean_t sa_is_shared(const char *, char *); + const char *); +_LIBSPL_LIBSHARE_H int sa_disable_share(const char *, const char *); +_LIBSPL_LIBSHARE_H boolean_t sa_is_shared(const char *, const char *); _LIBSPL_LIBSHARE_H void sa_commit_shares(const char *); /* protocol specific interfaces */ -_LIBSPL_LIBSHARE_H int sa_validate_shareopts(char *, char *); +_LIBSPL_LIBSHARE_H int sa_validate_shareopts(const char *, const char *); #endif /* _LIBSPL_LIBSHARE_H */