summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPrzemyslaw Pawelczyk <przemoc@gmail.com>2018-02-19 01:41:15 +0100
committerPrzemyslaw Pawelczyk <przemoc@gmail.com>2018-02-19 01:41:15 +0100
commitee36104279f55c26a0ec71abbe8cccbbd0bc3966 (patch)
tree97f34af490c40d58bf3475c03349bf165e80246c /src
parentc7e0264a71d3101cf660a9da354a33792914fd76 (diff)
Support building with empty -DNO_XATTR= (equivalent to -DNO_XATTR=0).
Diffstat (limited to 'src')
-rw-r--r--src/metaentry.c10
-rw-r--r--src/metastore.c14
2 files changed, 12 insertions, 12 deletions
diff --git a/src/metaentry.c b/src/metaentry.c
index 6c5bc84..da28723 100644
--- a/src/metaentry.c
+++ b/src/metaentry.c
@@ -26,7 +26,7 @@
#include <sys/stat.h>
#include <unistd.h>
-#if !defined(NO_XATTR) || !NO_XATTR
+#if !defined(NO_XATTR) || !(NO_XATTR+0)
# include <sys/xattr.h>
#endif /* !NO_XATTR */
@@ -52,7 +52,7 @@
# define PATH_MAX 4096
#endif
-#if !defined(NO_XATTR) || !NO_XATTR
+#if !defined(NO_XATTR) || !(NO_XATTR+0)
/* Free's a metaentry and all its parameters */
static void
mentry_free(struct metaentry *m)
@@ -195,14 +195,14 @@ mentries_print(const struct metahash *mhash)
struct metaentry *
mentry_create(const char *path)
{
-#if !defined(NO_XATTR) || !NO_XATTR
+#if !defined(NO_XATTR) || !(NO_XATTR+0)
ssize_t lsize, vsize;
char *list, *attr;
#endif /* !NO_XATTR */
struct stat sbuf;
struct passwd *pbuf;
struct group *gbuf;
-#if !defined(NO_XATTR) || !NO_XATTR
+#if !defined(NO_XATTR) || !(NO_XATTR+0)
int i;
#endif /* !NO_XATTR */
struct metaentry *mentry;
@@ -240,7 +240,7 @@ mentry_create(const char *path)
if (S_ISLNK(mentry->mode))
return mentry;
-#if !defined(NO_XATTR) || !NO_XATTR
+#if !defined(NO_XATTR) || !(NO_XATTR+0)
lsize = listxattr(path, NULL, 0);
if (lsize < 0) {
/* Perhaps the FS doesn't support xattrs? */
diff --git a/src/metastore.c b/src/metastore.c
index 9f01a8c..e262a18 100644
--- a/src/metastore.c
+++ b/src/metastore.c
@@ -26,7 +26,7 @@
#include <getopt.h>
#include <utime.h>
-#if !defined(NO_XATTR) || !NO_XATTR
+#if !defined(NO_XATTR) || !(NO_XATTR+0)
# include <sys/xattr.h>
#endif /* !NO_XATTR */
@@ -127,7 +127,7 @@ compare_print(struct metaentry *real, struct metaentry *stored, int cmp)
msg(MSG_QUIET, "xattr ");
msg(MSG_QUIET, "\n");
- if (NO_XATTR && cmp & DIFF_XATTR) {
+ if ((NO_XATTR+0) && cmp & DIFF_XATTR) {
msg(MSG_WARNING, "%s:\txattr difference may be bogus: %s\n",
real->path, NO_XATTR_MSG);
}
@@ -244,11 +244,11 @@ compare_fix(struct metaentry *real, struct metaentry *stored, int cmp)
msg(MSG_NORMAL, "%s:\tremoving xattr %s\n",
real->path, real->xattr_names[i]);
- if (NO_XATTR) {
+ if ((NO_XATTR+0)) {
msg(MSG_WARNING, "%s:\tremoving xattr %s failed: %s\n",
real->path, real->xattr_names[i], NO_XATTR_MSG);
}
-#if !defined(NO_XATTR) || !NO_XATTR
+#if !defined(NO_XATTR) || !(NO_XATTR+0)
else
if (lremovexattr(real->path, real->xattr_names[i]))
msg(MSG_DEBUG, "\tlremovexattr failed: %s\n",
@@ -263,11 +263,11 @@ compare_fix(struct metaentry *real, struct metaentry *stored, int cmp)
msg(MSG_NORMAL, "%s:\tadding xattr %s\n",
stored->path, stored->xattr_names[i]);
- if (NO_XATTR) {
+ if ((NO_XATTR+0)) {
msg(MSG_WARNING, "%s:\tadding xattr %s failed: %s\n",
stored->path, stored->xattr_names[i], NO_XATTR_MSG);
}
-#if !defined(NO_XATTR) || !NO_XATTR
+#if !defined(NO_XATTR) || !(NO_XATTR+0)
else
if (lsetxattr(stored->path, stored->xattr_names[i],
stored->xattr_values[i],
@@ -424,7 +424,7 @@ version(void)
{
printf("metastore %s\n", METASTORE_VER);
- if (NO_XATTR) {
+ if ((NO_XATTR+0)) {
printf("Built with %s.\n", NO_XATTR_MSG);
}