cryptdisks(8): The 'ok' variable is only needed in #ifdef DEBUG.
authorSascha Wildner <saw@online.de>
Tue, 16 Oct 2012 07:58:08 +0000 (09:58 +0200)
committerSascha Wildner <saw@online.de>
Tue, 16 Oct 2012 08:26:05 +0000 (10:26 +0200)
Found-by: gcc47
sbin/cryptdisks/safe_mem.c

index 43ada09..906f3fd 100644 (file)
@@ -149,13 +149,16 @@ check_and_purge_safe_mem(void)
 {
        struct safe_mem_hdr *hdr;
        char *mem;
-       int __unused ok;
+#ifdef DEBUG
+       int ok;
+#endif
 
        if (safe_mem_hdr_first == NULL)
                return;
 
        hdr = safe_mem_hdr_first;
        while ((hdr = safe_mem_hdr_first) != NULL) {
+#ifdef DEBUG
                if ((hdr->alloc_sz > 0) &&
                    (memcmp(hdr->sig, "SAFEMEM\0", 8) == 0) &&
                    (memcmp(hdr->tail->sig, "SAFEMEM\0", 8) == 0))
@@ -163,7 +166,6 @@ check_and_purge_safe_mem(void)
                else
                        ok = 0;
 
-#ifdef DEBUG
                fprintf(stderr, "un-freed safe_mem: %#lx (%s:%d) [integrity=%s]\n",
                    (unsigned long)(void *)hdr, hdr->file, hdr->line,
                    ok? "ok" : "failed");