From: Karel Zak Date: Thu, 14 Jun 2007 11:55:37 +0000 (+0200) Subject: mkfs.cramfs: cleanup HAVE_ macros usage X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=94ed908c8d2ef5bfb1d6119babc3d00f52a27ca7;p=util-linux mkfs.cramfs: cleanup HAVE_ macros usage It's bad to use any HAVE_* macros for anything other than for build-system (autotools) stuff. Signed-off-by: Karel Zak --- diff --git a/disk-utils/mkfs.cramfs.c b/disk-utils/mkfs.cramfs.c index 23878248..ca9335a3 100644 --- a/disk-utils/mkfs.cramfs.c +++ b/disk-utils/mkfs.cramfs.c @@ -83,15 +83,17 @@ static int warn_uid = 0; # define MIN(_a,_b) ((_a) < (_b) ? (_a) : (_b)) #endif +/* entry.flags */ +#define CRAMFS_EFLAG_MD5 1 +#define CRAMFS_EFLAG_INVALID 2 + /* In-core version of inode / directory entry. */ struct entry { /* stats */ unsigned char *name; unsigned int mode, size, uid, gid; unsigned char md5sum[16]; - unsigned char flags; -#define HAVE_MD5 1 -#define INVALID 2 + unsigned char flags; /* CRAMFS_EFLAG_* */ /* FS data */ char *path; @@ -203,7 +205,7 @@ mdfile(struct entry *e) { start = do_mmap(e->path, e->size, e->mode); if (start == NULL) { - e->flags |= INVALID; + e->flags |= CRAMFS_EFLAG_INVALID; } else { MD5Init(&ctx); MD5Update(&ctx, start, e->size); @@ -211,7 +213,7 @@ mdfile(struct entry *e) { do_munmap(start, e->size, e->mode); - e->flags |= HAVE_MD5; + e->flags |= CRAMFS_EFLAG_MD5; } } @@ -255,7 +257,8 @@ static int find_identical_file(struct entry *orig, struct entry *new) if (!new->flags) mdfile(new); - if ((orig->flags & HAVE_MD5) && (new->flags & HAVE_MD5) && + if ((orig->flags & CRAMFS_EFLAG_MD5) && + (new->flags & CRAMFS_EFLAG_MD5) && !memcmp(orig->md5sum, new->md5sum, 16) && identical_file(orig, new)) { new->same = orig;