Author: kevans
Date: Sat Nov 14 15:26:18 2020
New Revision: 367683
URL: https://svnweb.freebsd.org/changeset/base/367683

Log:
  MFC r366819: 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.

Modified:
  stable/12/lib/libbe/be.h
  stable/12/lib/libbe/be_access.c
  stable/12/lib/libbe/be_info.c
  stable/12/lib/libbe/libbe.3
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/lib/libbe/be.h
==============================================================================
--- stable/12/lib/libbe/be.h    Sat Nov 14 15:21:20 2020        (r367682)
+++ stable/12/lib/libbe/be.h    Sat Nov 14 15:26:18 2020        (r367683)
@@ -111,8 +111,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 */
@@ -124,7 +124,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);

Modified: stable/12/lib/libbe/be_access.c
==============================================================================
--- stable/12/lib/libbe/be_access.c     Sat Nov 14 15:21:20 2020        
(r367682)
+++ stable/12/lib/libbe/be_access.c     Sat Nov 14 15:26:18 2020        
(r367683)
@@ -232,8 +232,8 @@ be_mounted_at(libbe_handle_t *lbh, const char *path, n
  * 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 *mou
  * 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];

Modified: stable/12/lib/libbe/be_info.c
==============================================================================
--- stable/12/lib/libbe/be_info.c       Sat Nov 14 15:21:20 2020        
(r367682)
+++ stable/12/lib/libbe/be_info.c       Sat Nov 14 15:26:18 2020        
(r367683)
@@ -294,7 +294,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];
 

Modified: stable/12/lib/libbe/libbe.3
==============================================================================
--- stable/12/lib/libbe/libbe.3 Sat Nov 14 15:21:20 2020        (r367682)
+++ stable/12/lib/libbe/libbe.3 Sat Nov 14 15:26:18 2020        (r367683)
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 16, 2019
+.Dd November 14, 2020
 .Dt LIBBE 3
 .Os
 .Sh NAME
@@ -93,13 +93,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"
@@ -120,7 +120,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"
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to