Fix DEBUG output (thanks to Ivan Stankovic)
authorMilan Broz <gmazyland@gmail.com>
Thu, 30 Jul 2009 14:46:20 +0000 (14:46 +0000)
committerMilan Broz <gmazyland@gmail.com>
Thu, 30 Jul 2009 14:46:20 +0000 (14:46 +0000)
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@75 36d66b0a-2a48-0410-832c-cd162a569da5

ChangeLog
lib/setup.c

index a6c5f50..2f1aec1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2009-07-30  Milan Broz  <mbroz@redhat.com>
+       * Fix errors when compiled with LUKS_DEBUG.
+
 2009-07-28  Milan Broz  <mbroz@redhat.com>
        * Pad luks header to 512 sector size.
        * Rework read/write blockwise to not split operation to many pieces.
index b30d49c..7c3641b 100644 (file)
@@ -457,9 +457,14 @@ static int __crypt_luks_format(int arg, struct setup_backend *backend, struct cr
        if(NULL == mk) return -ENOMEM; // FIXME This may be misleading, since we don't know what went wrong
 
 #ifdef LUKS_DEBUG
-#define printoffset(entry) logger(options, CRYPT_LOG_ERROR, ("offset of " #entry " = %d\n", (char *)(&header.entry)-(char *)(&header))
+#define printoffset(entry) \
+       logger(options, CRYPT_LOG_ERROR, \
+               "offset of " #entry " = %d\n", (char *)(&header.entry)-(char *)(&header))
 
-       logger(options, CRYPT_LOG_ERROR, "sizeof phdr %d, key slot %d\n",sizeof(struct luks_phdr),sizeof(header.keyblock[0]));
+       logger(options, CRYPT_LOG_ERROR,
+               "sizeof phdr %d, sizeof key slot %d\n",
+               sizeof(struct luks_phdr),
+               sizeof(header.keyblock[0]));
 
        printoffset(magic);
        printoffset(version);
@@ -491,7 +496,7 @@ static int __crypt_luks_format(int arg, struct setup_backend *backend, struct cr
        PBKDF2perSecond = LUKS_benchmarkt_iterations();
        header.keyblock[keyIndex].passwordIterations = at_least_one(PBKDF2perSecond * ((float)options->iteration_time / 1000.0));
 #ifdef LUKS_DEBUG
-       logger(options->icb->log,CRYPT_LOG_ERROR, "pitr %d\n", header.keyblock[0].passwordIterations);
+       logger(optionsCRYPT_LOG_ERROR, "pitr %d\n", header.keyblock[0].passwordIterations);
 #endif
        get_key("Enter LUKS passphrase: ",&password,&passwordLen, 0, options->new_key_file, options->passphrase_fd, options->timeout, options->flags);
        if(!password) {