#include <errno.h>
#endif
#include <unistd.h>
+#include <libgen.h>
#include "ext2fs/ext2fs.h"
#include "support/nls-enable.h"
__le32 magic; /* KEYBLOCK_MAGIC number */
__le32 crc; /* block checksum */
__le64 reserved; /* zero */
-
+#if __GNUC_PREREQ (4, 8)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wpedantic"
+#endif
struct undo_key keys[0]; /* keys, which come immediately after */
+#if __GNUC_PREREQ (4, 8)
+#pragma GCC diagnostic pop
+#endif
};
struct undo_key_info {
static void usage(void)
{
fprintf(stderr,
- _("Usage: %s [-f] [-h] [-n] [-v] <transaction file> <filesystem>\n"), prg_name);
+ _("Usage: %s [-f] [-h] [-n] [-o offset] [-v] [-z undo_file] <transaction file> <filesystem>\n"), prg_name);
exit(1);
}
ka = a;
kb = b;
- return ext2fs_le64_to_cpu(ka->fsblk) -
- ext2fs_le64_to_cpu(kb->fsblk);
+ return ka->fsblk - kb->fsblk;
}
static int e2undo_setup_tdb(const char *name, io_manager *io_ptr)
__u32 key_crc, blk_crc, hdr_crc;
blk64_t lblk;
ext2_filsys fs;
- __u64 offset;
+ __u64 offset = 0;
char opt_offset_string[40] = { 0 };
#ifdef ENABLE_NLS
offset = ext2fs_le64_to_cpu(undo_ctx.hdr.fs_offset);
retval = snprintf(opt_offset_string, sizeof(opt_offset_string),
"offset=%llu", offset);
- if (retval >= sizeof(opt_offset_string)) {
+ if ((size_t) retval >= sizeof(opt_offset_string)) {
/* should not happen... */
com_err(prg_name, 0, _("specified offset is too large"));
exit(1);