diff options
author | Karel Zak <kzak@redhat.com> | 2010-09-27 12:16:59 +0200 |
---|---|---|
committer | Karel Zak <kzak@redhat.com> | 2011-01-03 12:28:43 +0100 |
commit | a5106adb7647b421f9a42e0b972d5a1f5e3a554c (patch) | |
tree | a4906834cbf8f4f311a070094e7508ffb783aed6 | |
parent | 4796b46d69f30237db0a0788b4df511d3112a0b8 (diff) | |
download | util-linux-old-a5106adb7647b421f9a42e0b972d5a1f5e3a554c.tar.gz |
libmount: minor cleanup in optstr.c
Signed-off-by: Karel Zak <kzak@redhat.com>
-rw-r--r-- | shlibs/mount/src/optstr.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/shlibs/mount/src/optstr.c b/shlibs/mount/src/optstr.c index dd8b5451..bb361324 100644 --- a/shlibs/mount/src/optstr.c +++ b/shlibs/mount/src/optstr.c @@ -312,7 +312,7 @@ int mnt_optstr_remove_option_at(char **optstr, char *begin, char *end) } /* insert 'substr' or '=substr' to @str on position @pos */ -static int insert_substring(char **str, char *pos, const char *substr, char **next) +static int insert_value(char **str, char *pos, const char *substr, char **next) { size_t subsz = strlen(substr); /* substring size */ size_t strsz = strlen(*str); @@ -392,7 +392,7 @@ int mnt_optstr_set_option(char **optstr, const char *name, const char *value) else if (value && ol.value == NULL) /* insert "=value" */ - rc = insert_substring(optstr, nameend, value, NULL); + rc = insert_value(optstr, nameend, value, NULL); else if (value && ol.value && strlen(value) == ol.valsz) /* simply replace =value */ @@ -400,7 +400,7 @@ int mnt_optstr_set_option(char **optstr, const char *name, const char *value) else if (value && ol.value) { mnt_optstr_remove_option_at(optstr, nameend, ol.end); - rc = insert_substring(optstr, nameend, value, NULL); + rc = insert_value(optstr, nameend, value, NULL); } return rc; } @@ -597,7 +597,7 @@ int mnt_optstr_get_userspace_mountflags(const char *optstr, unsigned long *flags } /** - * mnt_optstr_apply_flags: + * mnt_optstr_apply_mountflags: * @optstr: string with comma separated list of options * @flags: returns mount flags * @map: options map @@ -738,7 +738,7 @@ int mnt_optstr_fix_secontext(char **optstr, char *value, size_t valsz, char **ne /* set new context */ mnt_optstr_remove_option_at(optstr, begin, end); - rc = insert_substring(optstr, begin, val, next); + rc = insert_value(optstr, begin, val, next); free(val); #endif return rc; @@ -751,7 +751,7 @@ static int set_uint_value(char **optstr, unsigned int num, snprintf(buf, sizeof(buf), "%u", num); mnt_optstr_remove_option_at(optstr, begin, end); - return insert_substring(optstr, begin, buf, next); + return insert_value(optstr, begin, buf, next); } /** @@ -880,7 +880,7 @@ int mnt_optstr_fix_user(char **optstr, char *value, size_t valsz, char **next) /* remove old value */ mnt_optstr_remove_option_at(optstr, value, value + valsz); - rc = insert_substring(optstr, value, username, next); + rc = insert_value(optstr, value, username, next); } free(username); |