summaryrefslogtreecommitdiffstats
path: root/shlibs/mount/src/context_mount.c
diff options
context:
space:
mode:
authorKarel Zak2011-03-14 14:33:53 +0100
committerKarel Zak2011-03-14 14:33:53 +0100
commit5982583a4e5fdba35e496a19f94fc6400d3cfeae (patch)
treeae4a0de456db06b1b792d7a3f3ded2ed9d3a7e13 /shlibs/mount/src/context_mount.c
parentmount: rename "quiet" to "silent" (MS_SILENT) (diff)
downloadkernel-qcow2-util-linux-5982583a4e5fdba35e496a19f94fc6400d3cfeae.tar.gz
kernel-qcow2-util-linux-5982583a4e5fdba35e496a19f94fc6400d3cfeae.tar.xz
kernel-qcow2-util-linux-5982583a4e5fdba35e496a19f94fc6400d3cfeae.zip
libmount: cleanup *_do_[u]mount() return codes and docs
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'shlibs/mount/src/context_mount.c')
-rw-r--r--shlibs/mount/src/context_mount.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/shlibs/mount/src/context_mount.c b/shlibs/mount/src/context_mount.c
index 5b9c0b195..eaba33c05 100644
--- a/shlibs/mount/src/context_mount.c
+++ b/shlibs/mount/src/context_mount.c
@@ -404,7 +404,7 @@ static int do_mount(struct libmnt_context *cxt, const char *try_type)
cxt->syscall_status = -errno;
DBG(CXT, mnt_debug_h(cxt, "mount(2) failed [errno=%d %m]",
-cxt->syscall_status));
- return cxt->syscall_status;
+ return -cxt->syscall_status;
}
DBG(CXT, mnt_debug_h(cxt, "mount(2) success"));
cxt->syscall_status = 0;
@@ -533,7 +533,14 @@ int mnt_context_prepare_mount(struct libmnt_context *cxt)
*
* Call mount(2) or mount.<type> helper. Unnecessary for mnt_context_mount().
*
- * Returns: negative number on error, zero on success
+ * WARNING: non-zero return code does not mean that mount(2) syscall or
+ * umount.type helper wasn't sucessfully called.
+ *
+ * Check mnt_context_get_status() after error!
+*
+ * Returns: 0 on success;
+ * >0 in case of mount(2) error (returns syscall errno),
+ * <0 in case of other errors.
*/
int mnt_context_do_mount(struct libmnt_context *cxt)
{
@@ -597,9 +604,14 @@ int mnt_context_finalize_mount(struct libmnt_context *cxt)
*
* See also mnt_context_disable_helpers().
*
- * Returns: 0 on success, and negative number in case of error. WARNING: error
- * does not mean that mount(2) syscall or mount.type helper wasn't
- * sucessfully called. Check mnt_context_get_status() after error!
+ * WARNING: non-zero return code does not mean that mount(2) syscall or
+ * mount.type helper wasn't sucessfully called.
+ *
+ * Check mnt_context_get_status() after error!
+*
+ * Returns: 0 on success;
+ * >0 in case of mount(2) error (returns syscall errno),
+ * <0 in case of other errors.
*/
int mnt_context_mount(struct libmnt_context *cxt)
{