diff --git a/jectl.h b/jectl.h index a956fdb..0ece2f2 100644 --- a/jectl.h +++ b/jectl.h @@ -45,7 +45,7 @@ extern libzfs_handle_t *lzh; extern const char *jepool; extern const char *jeroot; -int get_property(zfs_handle_t *, const char *, char **); +int get_property(zfs_handle_t *, const char *, const char **); zfs_handle_t * get_jail_dataset(const char *); zfs_handle_t * get_active_je(zfs_handle_t *); diff --git a/jectl_dump.c b/jectl_dump.c index 99a5800..630ca8d 100644 --- a/jectl_dump.c +++ b/jectl_dump.c @@ -35,7 +35,7 @@ static void print_je(zfs_handle_t *je) { char *name; - char *value; + const char *value; char buffer[ZFS_MAXPROPLEN]; name = strdup(zfs_get_name(je)); diff --git a/jectl_import.c b/jectl_import.c index c810f1c..0e86b87 100644 --- a/jectl_import.c +++ b/jectl_import.c @@ -43,7 +43,7 @@ je_import(const char *import_name) zfs_handle_t *zhp; recvflags_t flags = { .nomount = 1 }; char name[ZFS_MAXPROPLEN]; - char *default_je; + const char *default_je; struct renameflags rflags = { 0 }; snprintf(name, sizeof(name), "%s/jectl.XXXXXX", jeroot); diff --git a/jectl_update.c b/jectl_update.c index 057fc92..d3aeeca 100644 --- a/jectl_update.c +++ b/jectl_update.c @@ -39,7 +39,7 @@ struct compare_info { static bool is_equal(zfs_handle_t *a, zfs_handle_t *b, const char *property) { - char *astr, *bstr; + const char *astr, *bstr; int error1, error2; error1 = get_property(a, property, &astr); @@ -60,7 +60,7 @@ compare_je(zfs_handle_t *zhp, void *arg) { struct compare_info *ci __unused; zfs_handle_t *je; - char *v1, *v2; + const char *v1, *v2; ci = arg; diff --git a/jectl_util.c b/jectl_util.c index 6c9c1c5..da33ef1 100644 --- a/jectl_util.c +++ b/jectl_util.c @@ -47,7 +47,7 @@ get_jail_dataset(const char *jailname) zfs_handle_t * get_active_je(zfs_handle_t *jds) { - char *je_name; + const char *je_name; if (get_property(jds, "je:active", &je_name) != 0) return (NULL); @@ -56,7 +56,7 @@ get_active_je(zfs_handle_t *jds) } int -get_property(zfs_handle_t *zhp, const char *property, char **val) +get_property(zfs_handle_t *zhp, const char *property, const char **val) { int error; nvlist_t *nvl, *propval; @@ -85,7 +85,7 @@ je_copy_user_props(zfs_handle_t *src, zfs_handle_t *target) { struct nvpair *nvp; nvlist_t *nvl, *propval, *nnvl; - char *value; + const char *value; if (nvlist_alloc(&nnvl, NV_UNIQUE_NAME, 0) != 0) return (ENOMEM);