From 6fcdc552ffdca93334ffe2d044745c83de0722fa Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Sun, 28 Feb 2021 13:50:57 +0100 Subject: Cleanup handling of optional dependencies Don't use super pedantic parsing of the argument and work with the generated variable instead of assigning it to our own and set it to "check" if not value is assigned. Then search for a dependency if the with variable is anything other than "no" and fail if it was set to "yes". In addition, the WITHOUT_xxx defines are replaced with WITH_xxx defines. Signed-off-by: David Oberhollenzer --- jffsX-utils/mkfs.jffs2.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'jffsX-utils/mkfs.jffs2.c') diff --git a/jffsX-utils/mkfs.jffs2.c b/jffsX-utils/mkfs.jffs2.c index bd67634..b9dd96b 100644 --- a/jffsX-utils/mkfs.jffs2.c +++ b/jffsX-utils/mkfs.jffs2.c @@ -65,7 +65,7 @@ #include #include #include -#ifndef WITHOUT_XATTR +#ifdef WITH_XATTR #include #include #endif @@ -978,7 +978,7 @@ static void write_special_file(struct filesystem_entry *e) padword(); } -#ifndef WITHOUT_XATTR +#ifdef WITH_XATTR typedef struct xattr_entry { struct xattr_entry *next; uint32_t xid; @@ -1209,7 +1209,7 @@ static void write_xattr_entry(struct filesystem_entry *e) } } -#else /* WITHOUT_XATTR */ +#else /* WITH_XATTR */ #define write_xattr_entry(x) #endif @@ -1380,7 +1380,7 @@ static struct option long_options[] = { {"test-compression", 0, NULL, 't'}, {"compressor-priority", 1, NULL, 'y'}, {"incremental", 1, NULL, 'i'}, -#ifndef WITHOUT_XATTR +#ifdef WITH_XATTR {"with-xattr", 0, NULL, 1000 }, {"with-selinux", 0, NULL, 1001 }, {"with-posix-acl", 0, NULL, 1002 }, @@ -1420,7 +1420,7 @@ static const char helptext[] = " -q, --squash Squash permissions and owners making all files be owned by root\n" " -U, --squash-uids Squash owners making all files be owned by root\n" " -P, --squash-perms Squash permissions on all files\n" -#ifndef WITHOUT_XATTR +#ifdef WITH_XATTR " --with-xattr stuff all xattr entries into image\n" " --with-selinux stuff only SELinux Labels into jffs2 image\n" " --with-posix-acl stuff only POSIX ACL entries into jffs2 image\n" @@ -1745,7 +1745,7 @@ int main(int argc, char **argv) sys_errmsg_die("cannot open (incremental) file"); } break; -#ifndef WITHOUT_XATTR +#ifdef WITH_XATTR case 1000: /* --with-xattr */ enable_xattr |= (1 << JFFS2_XPREFIX_USER) | (1 << JFFS2_XPREFIX_SECURITY) -- cgit v1.2.3