]> Dogcows Code - chaz/tar/blobdiff - src/xattrs.c
tar: imply --xattrs when --xattrs-{inc,exc}lude used
[chaz/tar] / src / xattrs.c
index 4440b340dbb6ed9a969a9d1c452e943ccd52028d..dbaa2092f5a208a280c3cb5b26f819701db235eb 100644 (file)
@@ -1,6 +1,6 @@
 /* Support for extended attributes.
 
-   Copyright (C) 2006-2013 Free Software Foundation, Inc.
+   Copyright (C) 2006-2014 Free Software Foundation, Inc.
 
    This file is part of GNU tar.
 
@@ -484,6 +484,7 @@ xattrs_xattrs_get (int parentfd, char const *file_name,
     }
 }
 
+#ifdef HAVE_XATTRS
 static void
 xattrs__fd_set (struct tar_stat_info const *st,
                 char const *file_name, char typeflag,
@@ -509,6 +510,7 @@ xattrs__fd_set (struct tar_stat_info const *st,
                  sysname, attr, file_name));
     }
 }
+#endif
 
 /* lgetfileconat is called against FILE_NAME iff the FD parameter is set to
    zero, otherwise the fgetfileconat is used against correct file descriptor */
@@ -693,7 +695,7 @@ xattrs_print_char (struct tar_stat_info const *st, char *output)
   if (selinux_context_option > 0 && st->cntx_name)
     *output = '.';
 
-  if (acls_option && (st->acls_a_len || st->acls_d_len))
+  if (acls_option > 0 && (st->acls_a_len || st->acls_d_len))
     *output = '+';
 }
 
@@ -704,11 +706,11 @@ xattrs_print (struct tar_stat_info const *st)
     return;
 
   /* selinux */
-  if (selinux_context_option && st->cntx_name)
+  if (selinux_context_option > 0 && st->cntx_name)
     fprintf (stdlis, "  s: %s\n", st->cntx_name);
 
   /* acls */
-  if (acls_option && (st->acls_a_len || st->acls_d_len))
+  if (acls_option > 0 && (st->acls_a_len || st->acls_d_len))
     {
       fprintf (stdlis, "  a: ");
       acls_one_line ("", ',', st->acls_a_ptr, st->acls_a_len);
@@ -717,7 +719,7 @@ xattrs_print (struct tar_stat_info const *st)
     }
 
   /* xattrs */
-  if (xattrs_option && st->xattr_map_size)
+  if (xattrs_option > 0 && st->xattr_map_size)
     {
       int i;
 
This page took 0.023709 seconds and 4 git commands to generate.