2cf40b2f98
- Add 0073-libmultipath-util-constify-function-arguments.patch - Add 0074-libmultipath-constify-file-argument-in-config-parser.patch - Add 0075-libmultipath-provide-defaults-for-get-put-_multipath.patch - Add 0076-libmpathpersist-allow-using-libmultipath-get-put-_mu.patch - Add 0077-multipath-use-get_put-_multipath_config-from-libmult.patch - Add 0078-mpathpersist-use-get-put-_multipath_config-from-libm.patch - Add 0079-libmultipath-add-udev-and-logsink-symbols.patch - Add 0080-multipath-remove-logsink-and-udev.patch - Add 0081-libmpathpersist-call-libmultipath_-init-exit.patch - Add 0082-mpathpersist-remove-logsink-and-udev.patch - Add 0083-multipathd-remove-logsink-and-udev.patch * Pull in upsteam library changes - Add 0084-libmpathvalid-use-default-_multipath_config-udev-and.patch - Add 0085-Revert-libmultipath-add-ignore_udev_uid-option.patch - Add 0086-libmultipath-change-log-level-for-null-uid_attribute.patch - Add 0087-libmultipath-orphan_paths-avoid-BUG-message.patch * update libmpathvalid to use upstream library changes. changes submitted upstream
112 lines
3.3 KiB
Diff
112 lines
3.3 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Martin Wilck <mwilck@suse.com>
|
|
Date: Wed, 8 Jul 2020 09:23:20 +0200
|
|
Subject: [PATCH] libmultipath: util: constify function arguments
|
|
|
|
Use "const" for function arguments where possible.
|
|
|
|
Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
|
|
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
|
|
---
|
|
libmultipath/dmparser.c | 2 +-
|
|
libmultipath/util.c | 12 ++++++------
|
|
libmultipath/util.h | 10 +++++-----
|
|
3 files changed, 12 insertions(+), 12 deletions(-)
|
|
|
|
diff --git a/libmultipath/dmparser.c b/libmultipath/dmparser.c
|
|
index b856a07f..27581cde 100644
|
|
--- a/libmultipath/dmparser.c
|
|
+++ b/libmultipath/dmparser.c
|
|
@@ -18,7 +18,7 @@
|
|
#define WORD_SIZE 64
|
|
|
|
static int
|
|
-merge_words(char **dst, char *word)
|
|
+merge_words(char **dst, const char *word)
|
|
{
|
|
char * p = *dst;
|
|
int len, dstlen;
|
|
diff --git a/libmultipath/util.c b/libmultipath/util.c
|
|
index 51c38c87..67e7a42f 100644
|
|
--- a/libmultipath/util.c
|
|
+++ b/libmultipath/util.c
|
|
@@ -52,7 +52,7 @@ basenamecpy (const char *src, char *dst, size_t size)
|
|
}
|
|
|
|
int
|
|
-filepresent (char * run) {
|
|
+filepresent (const char *run) {
|
|
struct stat buf;
|
|
|
|
if(!stat(run, &buf))
|
|
@@ -60,7 +60,7 @@ filepresent (char * run) {
|
|
return 0;
|
|
}
|
|
|
|
-char *get_next_string(char **temp, char *split_char)
|
|
+char *get_next_string(char **temp, const char *split_char)
|
|
{
|
|
char *token = NULL;
|
|
token = strsep(temp, split_char);
|
|
@@ -70,9 +70,9 @@ char *get_next_string(char **temp, char *split_char)
|
|
}
|
|
|
|
int
|
|
-get_word (char * sentence, char ** word)
|
|
+get_word (const char *sentence, char **word)
|
|
{
|
|
- char * p;
|
|
+ const char *p;
|
|
int len;
|
|
int skip = 0;
|
|
|
|
@@ -381,7 +381,7 @@ int get_linux_version_code(void)
|
|
return _linux_version_code;
|
|
}
|
|
|
|
-int parse_prkey(char *ptr, uint64_t *prkey)
|
|
+int parse_prkey(const char *ptr, uint64_t *prkey)
|
|
{
|
|
if (!ptr)
|
|
return 1;
|
|
@@ -398,7 +398,7 @@ int parse_prkey(char *ptr, uint64_t *prkey)
|
|
return 0;
|
|
}
|
|
|
|
-int parse_prkey_flags(char *ptr, uint64_t *prkey, uint8_t *flags)
|
|
+int parse_prkey_flags(const char *ptr, uint64_t *prkey, uint8_t *flags)
|
|
{
|
|
char *flagstr;
|
|
|
|
diff --git a/libmultipath/util.h b/libmultipath/util.h
|
|
index 56bd78c7..c19c5ac3 100644
|
|
--- a/libmultipath/util.h
|
|
+++ b/libmultipath/util.h
|
|
@@ -9,9 +9,9 @@
|
|
|
|
size_t strchop(char *);
|
|
int basenamecpy (const char *src, char *dst, size_t size);
|
|
-int filepresent (char * run);
|
|
-char *get_next_string(char **temp, char *split_char);
|
|
-int get_word (char * sentence, char ** word);
|
|
+int filepresent (const char *run);
|
|
+char *get_next_string(char **temp, const char *split_char);
|
|
+int get_word (const char * sentence, char ** word);
|
|
size_t strlcpy(char *dst, const char *src, size_t size);
|
|
size_t strlcat(char *dst, const char *src, size_t size);
|
|
int devt2devname (char *, int, char *);
|
|
@@ -20,8 +20,8 @@ char *convert_dev(char *dev, int is_path_device);
|
|
void setup_thread_attr(pthread_attr_t *attr, size_t stacksize, int detached);
|
|
int systemd_service_enabled(const char *dev);
|
|
int get_linux_version_code(void);
|
|
-int parse_prkey(char *ptr, uint64_t *prkey);
|
|
-int parse_prkey_flags(char *ptr, uint64_t *prkey, uint8_t *flags);
|
|
+int parse_prkey(const char *ptr, uint64_t *prkey);
|
|
+int parse_prkey_flags(const char *ptr, uint64_t *prkey, uint8_t *flags);
|
|
int safe_write(int fd, const void *buf, size_t count);
|
|
void set_max_fds(rlim_t max_fds);
|
|
|
|
--
|
|
2.17.2
|
|
|