diff options
author | Karel Zak | 2011-01-25 00:26:47 +0100 |
---|---|---|
committer | Karel Zak | 2011-01-25 00:26:47 +0100 |
commit | f501724264bec87ecf717b5ab2e0ccafc50039d3 (patch) | |
tree | 53292335e4ad5cc447624a9e89725ba5d5c91e12 /shlibs/mount/src/context.c | |
parent | include: [tt] enlarge output buffer (diff) | |
download | kernel-qcow2-util-linux-f501724264bec87ecf717b5ab2e0ccafc50039d3.tar.gz kernel-qcow2-util-linux-f501724264bec87ecf717b5ab2e0ccafc50039d3.tar.xz kernel-qcow2-util-linux-f501724264bec87ecf717b5ab2e0ccafc50039d3.zip |
libmount: improve status check, minor cleanups
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'shlibs/mount/src/context.c')
-rw-r--r-- | shlibs/mount/src/context.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/shlibs/mount/src/context.c b/shlibs/mount/src/context.c index bfa0292fa..ed9f223ae 100644 --- a/shlibs/mount/src/context.c +++ b/shlibs/mount/src/context.c @@ -1292,7 +1292,7 @@ int mnt_context_update_tabs(struct libmnt_context *cxt) return 0; } if (cxt->syscall_status) { - DBG(CXT, mnt_debug_h(cxt, "don't update: syscall failed")); + DBG(CXT, mnt_debug_h(cxt, "don't update: syscall failed/not called")); return 0; } @@ -1471,7 +1471,7 @@ int mnt_context_apply_fstab(struct libmnt_context *cxt) * mnt_context_get_status: * @cxt: mount context * - * Returns: 1 if /sbin/mount.type or mount(2) syscall was successfull or 0. + * Returns: 0 if /sbin/mount.type or mount(2) syscall was successfull or -errno. */ int mnt_context_get_status(struct libmnt_context *cxt) { @@ -1479,6 +1479,25 @@ int mnt_context_get_status(struct libmnt_context *cxt) } /** + * mnt_context_set_syscall_status: + * @cxt: mount context + * @status: mount(2) return code + * + * This function should be used if [u]mount(2) syscall was NOT called by + * libmount (mnt_mount_context() or mnt_context_do_mount()) only. + * + * Returns: 0 or negative number in case of error. + */ +int mnt_context_set_syscall_status(struct libmnt_context *cxt, int status) +{ + if (!cxt) + return -EINVAL; + + cxt->syscall_status = status; + return 0; +} + +/** * mnt_context_strerror * @cxt: context * @buf: buffer @@ -1514,6 +1533,8 @@ int mnt_context_init_helper(struct libmnt_context *cxt, int flags) if (!rc) return set_flag(cxt, MNT_FL_HELPER, 1); + + DBG(CXT, mnt_debug_h(cxt, "initialized for [u]mount.<type> helper")); return rc; } |