]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: improve ifdef HAVE_LIBSELINUX stuff
authorKarel Zak <kzak@redhat.com>
Tue, 19 Jun 2012 14:19:18 +0000 (16:19 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 19 Jun 2012 14:19:18 +0000 (16:19 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/optstr.c

index cc1bef84fd8822c7ca701ca9811c1b58f59eab32..08c12150eb20e3392beb1b527de1f7ed97881149 100644 (file)
@@ -774,14 +774,22 @@ err:
  *
  * Returns: 0 on success, negative number in case of error.
  */
+#ifndef HAVE_LIBSELINUX
 int mnt_optstr_fix_secontext(char **optstr __attribute__ ((__unused__)),
                             char *value   __attribute__ ((__unused__)),
                             size_t valsz  __attribute__ ((__unused__)),
                             char **next   __attribute__ ((__unused__)))
+{
+       return 0;
+}
+#else
+int mnt_optstr_fix_secontext(char **optstr,
+                            char *value,
+                            size_t valsz,
+                            char **next)
 {
        int rc = 0;
 
-#ifdef HAVE_LIBSELINUX
        security_context_t raw = NULL;
        char *p, *val, *begin, *end;
        size_t sz;
@@ -839,9 +847,10 @@ int mnt_optstr_fix_secontext(char **optstr __attribute__ ((__unused__)),
        mnt_optstr_remove_option_at(optstr, begin, end);
        rc = insert_value(optstr, begin, val, next);
        free(val);
-#endif
+
        return rc;
 }
+#endif
 
 static int set_uint_value(char **optstr, unsigned int num,
                        char *begin, char *end, char **next)