summaryrefslogtreecommitdiffstats
path: root/disk-utils
diff options
context:
space:
mode:
authorKarel Zak2007-06-14 13:55:37 +0200
committerKarel Zak2007-06-14 13:55:37 +0200
commit94ed908c8d2ef5bfb1d6119babc3d00f52a27ca7 (patch)
tree4d30111410052ec313be9532f44912666d3e8a43 /disk-utils
parentbuild-sys: fix HAVE_NCURSES (diff)
downloadkernel-qcow2-util-linux-94ed908c8d2ef5bfb1d6119babc3d00f52a27ca7.tar.gz
kernel-qcow2-util-linux-94ed908c8d2ef5bfb1d6119babc3d00f52a27ca7.tar.xz
kernel-qcow2-util-linux-94ed908c8d2ef5bfb1d6119babc3d00f52a27ca7.zip
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 <kzak@redhat.com>
Diffstat (limited to 'disk-utils')
-rw-r--r--disk-utils/mkfs.cramfs.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/disk-utils/mkfs.cramfs.c b/disk-utils/mkfs.cramfs.c
index 23878248c..ca9335a37 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;