]> granicus.if.org Git - strace/blobdiff - loop.c
Check for SA_RESTORER definition in <asm/signal.h>
[strace] / loop.c
diff --git a/loop.c b/loop.c
index a350135491d7d7be52c9469549cc44602b78569c..495e3e2b96fc99bde2aa96ec8f3b7941160b2a30 100644 (file)
--- a/loop.c
+++ b/loop.c
 #include <linux/loop.h>
 
 static const struct xlat loop_flags_options[] = {
-       { LO_FLAGS_READ_ONLY,   "LO_FLAGS_READ_ONLY"    },
-       { LO_FLAGS_AUTOCLEAR,   "LO_FLAGS_AUTOCLEAR"    },
-#ifdef LO_FLAGS_PARTSCAN
-       { LO_FLAGS_PARTSCAN,    "LO_FLAGS_PARTSCAN"     },
+       XLAT(LO_FLAGS_READ_ONLY),
+#if HAVE_DECL_LO_FLAGS_AUTOCLEAR
+       XLAT(LO_FLAGS_AUTOCLEAR),
 #endif
-       { 0,                    NULL                    },
+#if HAVE_DECL_LO_FLAGS_PARTSCAN
+       XLAT(LO_FLAGS_PARTSCAN),
+#endif
+       XLAT_END
 };
 
 static const struct xlat loop_crypt_type_options[] = {
-       { LO_CRYPT_NONE,        "LO_CRYPT_NONE"         },
-       { LO_CRYPT_XOR,         "LO_CRYPT_XOR"          },
-       { LO_CRYPT_DES,         "LO_CRYPT_DES"          },
-       { LO_CRYPT_FISH2,       "LO_CRYPT_FISH2"        },
-       { LO_CRYPT_BLOW,        "LO_CRYPT_BLOW"         },
-       { LO_CRYPT_CAST128,     "LO_CRYPT_CAST128"      },
-       { LO_CRYPT_IDEA,        "LO_CRYPT_IDEA"         },
-       { LO_CRYPT_DUMMY,       "LO_CRYPT_DUMMY"        },
-       { LO_CRYPT_SKIPJACK,    "LO_CRYPT_SKIPJACK"     },
-       { LO_CRYPT_CRYPTOAPI,   "LO_CRYPT_CRYPTOAPI"    },
-       { 0,                    NULL                    },
+       XLAT(LO_CRYPT_NONE),
+       XLAT(LO_CRYPT_XOR),
+       XLAT(LO_CRYPT_DES),
+       XLAT(LO_CRYPT_FISH2),
+       XLAT(LO_CRYPT_BLOW),
+       XLAT(LO_CRYPT_CAST128),
+       XLAT(LO_CRYPT_IDEA),
+       XLAT(LO_CRYPT_DUMMY),
+       XLAT(LO_CRYPT_SKIPJACK),
+       XLAT(LO_CRYPT_CRYPTOAPI),
+       XLAT_END
 };
 
 int loop_ioctl(struct tcb *tcp, long code, long arg)
@@ -70,7 +72,7 @@ int loop_ioctl(struct tcb *tcp, long code, long arg)
                if (!verbose(tcp) || umove(tcp, arg, &info) < 0)
                        return 0;
 
-               tprintf(", {number=%i", info.lo_number);
+               tprintf(", {number=%d", info.lo_number);
 
                if (!abbrev(tcp)) {
                        tprintf(", device=%#lx, inode=%lu, rdevice=%#lx",
@@ -85,7 +87,7 @@ int loop_ioctl(struct tcb *tcp, long code, long arg)
                        tprints(", encrypt_type=");
                        printxval(loop_crypt_type_options, info.lo_encrypt_type,
                                "LO_CRYPT_???");
-                       tprintf(", encrypt_key_size=%i", info.lo_encrypt_key_size);
+                       tprintf(", encrypt_key_size=%d", info.lo_encrypt_key_size);
                }
 
                tprints(", flags=");
@@ -164,7 +166,9 @@ int loop_ioctl(struct tcb *tcp, long code, long arg)
                return 1;
 
        case LOOP_CLR_FD:
+#ifdef LOOP_SET_CAPACITY
        case LOOP_SET_CAPACITY:
+#endif
 #ifdef LOOP_CTL_GET_FREE
        /* newer loop-control stuff */
        case LOOP_CTL_GET_FREE: