1
0
forked from pool/util-linux
util-linux/libmount-add-MNT_ERR_LOOPDEV.patch
Petr Uzel 5b9d0884d3 - improve error messages from new mount (bnc#767208)
- backport patches from upstream git:
  - mount-new-add-loopdev-specific-error-message.patch
  - mount-new-use-MNT_ERR-for-error-messages.patch
  - libmount-add-special-MNT_ERR-codes.patch
  - mount-new-improve-error-messages.patch
  - libmount-add-MNT_ERR_LOOPDEV.patch

OBS-URL: https://build.opensuse.org/package/show/Base:System/util-linux?expand=0&rev=139
2012-06-15 13:00:49 +00:00

60 lines
2.0 KiB
Diff

From 82756a747e4bcfc13a27b7618d889af080649584 Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
Date: Mon, 28 May 2012 12:26:36 +0200
Subject: [PATCH] libmount: add MNT_ERR_LOOPDEV
Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
---
lib/loopdev.c | 4 ++++
libmount/src/context_loopdev.c | 1 +
libmount/src/libmount.h.in | 1 +
3 files changed, 6 insertions(+), 0 deletions(-)
Index: util-linux-2.21.2/lib/loopdev.c
===================================================================
--- util-linux-2.21.2.orig/lib/loopdev.c
+++ util-linux-2.21.2/lib/loopdev.c
@@ -173,6 +173,8 @@ int loopcxt_init(struct loopdev_cxt *lc,
*/
void loopcxt_deinit(struct loopdev_cxt *lc)
{
+ int errsv = errno;
+
if (!lc)
return;
@@ -183,6 +185,8 @@ void loopcxt_deinit(struct loopdev_cxt *
loopcxt_set_device(lc, NULL);
loopcxt_deinit_iterator(lc);
+
+ errno = errsv;
}
/*
Index: util-linux-2.21.2/libmount/src/context_loopdev.c
===================================================================
--- util-linux-2.21.2.orig/libmount/src/context_loopdev.c
+++ util-linux-2.21.2/libmount/src/context_loopdev.c
@@ -261,6 +261,7 @@ int mnt_context_setup_loopdev(struct lib
if (loopdev || rc != -EBUSY) {
DBG(CXT, mnt_debug_h(cxt, "failed to setup device"));
+ rc = -MNT_ERR_LOOPDEV;
goto done;
}
DBG(CXT, mnt_debug_h(cxt, "loopdev stolen...trying again"));
Index: util-linux-2.21.2/libmount/src/libmount.h.in
===================================================================
--- util-linux-2.21.2.orig/libmount/src/libmount.h.in
+++ util-linux-2.21.2/libmount/src/libmount.h.in
@@ -126,6 +126,7 @@ enum {
#define MNT_ERR_NOFSTAB 5000 /* not found required entry in fstab */
#define MNT_ERR_NOFSTYPE 5001 /* failed to detect filesystem type */
#define MNT_ERR_NOSOURCE 5002 /* required mount source undefined */
+#define MNT_ERR_LOOPDEV 5003 /* loopdev setup failed, errno set by libc */
/* init.c */
extern void mnt_init_debug(int mask);