From dd9bff8d67f42574066f405d34f282130f0d4d06 Mon Sep 17 00:00:00 2001 From: Milan Broz Date: Sat, 12 Mar 2011 21:31:41 +0000 Subject: [PATCH] Proper handle old systems. git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@447 36d66b0a-2a48-0410-832c-cd162a569da5 --- lib/setup.c | 4 +++- lib/utils_loop.h | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/setup.c b/lib/setup.c index 909d5e3..33c17fe 100644 --- a/lib/setup.c +++ b/lib/setup.c @@ -985,6 +985,7 @@ int crypt_init(struct crypt_device **cd, const char *device) "no free loop device found", h->device ?: ""); if (!h->device) { + log_err(NULL, _("Cannot find a free loopback device.\n")); r = -ENOSYS; goto bad; } @@ -992,7 +993,8 @@ int crypt_init(struct crypt_device **cd, const char *device) /* Keep the loop open, dettached on last close. */ h->loop_fd = crypt_loop_attach(h->device, device, 0, &readonly); if (h->loop_fd == -1) { - log_dbg("Attaching loop failed."); + log_err(NULL, _("Attaching loopback device failed " + "(loop device with autoclear flag is required).\n")); r = -EINVAL; goto bad; } diff --git a/lib/utils_loop.h b/lib/utils_loop.h index 54b533e..9b97a3e 100644 --- a/lib/utils_loop.h +++ b/lib/utils_loop.h @@ -5,6 +5,10 @@ #define LOOP_DEV_MAJOR 7 +#ifndef LO_FLAGS_AUTOCLEAR +#define LO_FLAGS_AUTOCLEAR 4 +#endif + char *crypt_loop_get_device(void); char *crypt_loop_backing_file(const char *loop); int crypt_loop_device(const char *loop); -- 2.7.4