summaryrefslogtreecommitdiffstats
path: root/shlibs/mount/src/optstr.c
diff options
context:
space:
mode:
authorKarel Zak2010-09-27 12:16:59 +0200
committerKarel Zak2011-01-03 12:28:43 +0100
commita5106adb7647b421f9a42e0b972d5a1f5e3a554c (patch)
treea4906834cbf8f4f311a070094e7508ffb783aed6 /shlibs/mount/src/optstr.c
parentlibmount: add mnt_optstr_fix_user (diff)
downloadkernel-qcow2-util-linux-a5106adb7647b421f9a42e0b972d5a1f5e3a554c.tar.gz
kernel-qcow2-util-linux-a5106adb7647b421f9a42e0b972d5a1f5e3a554c.tar.xz
kernel-qcow2-util-linux-a5106adb7647b421f9a42e0b972d5a1f5e3a554c.zip
libmount: minor cleanup in optstr.c
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'shlibs/mount/src/optstr.c')
-rw-r--r--shlibs/mount/src/optstr.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/shlibs/mount/src/optstr.c b/shlibs/mount/src/optstr.c
index dd8b54517..bb3613247 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);