summaryrefslogtreecommitdiff
path: root/lib/libbe
diff options
context:
space:
mode:
authorKyle Evans <kevans@FreeBSD.org>2020-10-18 23:32:47 +0000
committerKyle Evans <kevans@FreeBSD.org>2020-10-18 23:32:47 +0000
commit5773e924e791dfe8cc13049cefbf5f99aab6cc66 (patch)
tree3bbe142c129ddca176c0c48ac6ea501a2547f003 /lib/libbe
parent40ec30d45ec03c10900c9f81db1d1b4a072ab6f0 (diff)
downloadsrc-test-5773e924e791dfe8cc13049cefbf5f99aab6cc66.tar.gz
src-test-5773e924e791dfe8cc13049cefbf5f99aab6cc66.zip
libbe(3): const'ify a couple arguments
libbe will never need to mutate these as we either process them into a local buffer or we just don't touch them and write to a separate out argument. MFC after: 1 week
Notes
Notes: svn path=/head/; revision=366819
Diffstat (limited to 'lib/libbe')
-rw-r--r--lib/libbe/be.h6
-rw-r--r--lib/libbe/be_access.c6
-rw-r--r--lib/libbe/be_info.c2
-rw-r--r--lib/libbe/libbe.38
4 files changed, 11 insertions, 11 deletions
diff --git a/lib/libbe/be.h b/lib/libbe/be.h
index 960b1adf24570..87285f2d10af3 100644
--- a/lib/libbe/be.h
+++ b/lib/libbe/be.h
@@ -112,8 +112,8 @@ typedef enum {
BE_MNT_DEEP = 1 << 1,
} be_mount_opt_t;
-int be_mount(libbe_handle_t *, char *, char *, int, char *);
-int be_unmount(libbe_handle_t *, char *, int);
+int be_mount(libbe_handle_t *, const char *, const char *, int, char *);
+int be_unmount(libbe_handle_t *, const char *, int);
int be_mounted_at(libbe_handle_t *, const char *path, nvlist_t *);
/* Error related functions: be_error.c */
@@ -125,7 +125,7 @@ void libbe_print_on_error(libbe_handle_t *, bool);
int be_root_concat(libbe_handle_t *, const char *, char *);
int be_validate_name(libbe_handle_t * __unused, const char *);
int be_validate_snap(libbe_handle_t *, const char *);
-int be_exists(libbe_handle_t *, char *);
+int be_exists(libbe_handle_t *, const char *);
int be_export(libbe_handle_t *, const char *, int fd);
int be_import(libbe_handle_t *, const char *, int fd);
diff --git a/lib/libbe/be_access.c b/lib/libbe/be_access.c
index 60375d0cbc12c..74059a0a56930 100644
--- a/lib/libbe/be_access.c
+++ b/lib/libbe/be_access.c
@@ -232,8 +232,8 @@ be_mounted_at(libbe_handle_t *lbh, const char *path, nvlist_t *details)
* usage
*/
int
-be_mount(libbe_handle_t *lbh, char *bootenv, char *mountpoint, int flags,
- char *result_loc)
+be_mount(libbe_handle_t *lbh, const char *bootenv, const char *mountpoint,
+ int flags, char *result_loc)
{
char be[BE_MAXPATHLEN];
char mnt_temp[BE_MAXPATHLEN];
@@ -288,7 +288,7 @@ be_mount(libbe_handle_t *lbh, char *bootenv, char *mountpoint, int flags,
* usage
*/
int
-be_unmount(libbe_handle_t *lbh, char *bootenv, int flags)
+be_unmount(libbe_handle_t *lbh, const char *bootenv, int flags)
{
int err;
char be[BE_MAXPATHLEN];
diff --git a/lib/libbe/be_info.c b/lib/libbe/be_info.c
index 745f4f9be23be..81f3d46a7208c 100644
--- a/lib/libbe/be_info.c
+++ b/lib/libbe/be_info.c
@@ -305,7 +305,7 @@ be_prop_list_free(nvlist_t *be_list)
* Usage
*/
int
-be_exists(libbe_handle_t *lbh, char *be)
+be_exists(libbe_handle_t *lbh, const char *be)
{
char buf[BE_MAXPATHLEN];
diff --git a/lib/libbe/libbe.3 b/lib/libbe/libbe.3
index b8bbc29cf1d3d..2ace6b361e69e 100644
--- a/lib/libbe/libbe.3
+++ b/lib/libbe/libbe.3
@@ -27,7 +27,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd July 22, 2020
+.Dd August 18, 2020
.Dt LIBBE 3
.Os
.Sh NAME
@@ -94,13 +94,13 @@
.\" BE_MNT_DEEP = 1 << 1,
.\" } be_mount_opt_t
.Ft int
-.Fn be_mount "libbe_handle_t *hdl" "char *be_name" "char *mntpoint" "int flags" "char *result"
+.Fn be_mount "libbe_handle_t *hdl" "const char *be_name" "const char *mntpoint" "int flags" "char *result"
.Pp
.Ft int
.Fn be_mounted_at "libbe_handle_t *hdl" "const char *path" "nvlist_t *details"
.Pp
.Ft int
-.Fn be_unmount "libbe_handle_t *hdl" "char *be_name" "int flags"
+.Fn be_unmount "libbe_handle_t *hdl" "const char *be_name" "int flags"
.Pp
.Ft int
.Fn libbe_errno "libbe_handle_t *hdl"
@@ -121,7 +121,7 @@
.Fn be_validate_snap "libbe_handle_t *hdl" "const char *snap"
.Pp
.Ft int
-.Fn be_exists "libbe_handle_t *hdl" "char *be_name"
+.Fn be_exists "libbe_handle_t *hdl" "const char *be_name"
.Pp
.Ft int
.Fn be_export "libbe_handle_t *hdl" "const char *be_name" "int fd"