aboutsummaryrefslogtreecommitdiffstats
path: root/libmount/src/context_mount.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmount/src/context_mount.c')
-rw-r--r--libmount/src/context_mount.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libmount/src/context_mount.c b/libmount/src/context_mount.c
index 783244a61c..53918c3fca 100644
--- a/libmount/src/context_mount.c
+++ b/libmount/src/context_mount.c
@@ -1433,6 +1433,11 @@ int mnt_context_get_mount_excode(
mnt_context_get_user_mflags(cxt, &uflags); /* userspace flags */
if (!mnt_context_syscall_called(cxt)) {
+ if (buf && cxt->errmsg) {
+ xstrncpy(buf, cxt->errmsg, bufsz);
+ return MNT_EX_USAGE;
+ }
+
/*
* libmount errors (extra library checks)
*/