* mnt_context_get_status:
* @cxt: mount context
*
- * Returns: 0 if /sbin/mount.type or mount(2) syscall was successfull or -errno.
+ * Returns: 0 if /sbin/mount.type or mount(2) syscall was successfull.
*/
int mnt_context_get_status(struct libmnt_context *cxt)
{
* @cxt: mount context
* @status: mount(2) return code
*
+ * The @status should be 0 on succcess, or negative number on error (-1 or
+ * -errno).
+ *
* This function should be used if [u]mount(2) syscall was NOT called by
* libmount (by mnt_context_mount() or mnt_context_do_mount()) only.
*
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;
*
* 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)
{
*
* 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)
{
DBG(CXT, mnt_debug_h(cxt, "read-only re-mount(2) failed "
"[errno=%d]",
-cxt->syscall_status));
- return cxt->syscall_status;
+ return -cxt->syscall_status;
}
cxt->syscall_status = 0;
DBG(CXT, mnt_debug_h(cxt, "read-only re-mount(2) success"));
*
* See also mnt_context_disable_helpers().
*
- * Returns: 0 on success, and negative number in case of error.
+ * WARNING: non-zero return code does not mean that umount(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 umount(2) error (returns syscall errno),
+ * <0 in case of other errors.
*/
int mnt_context_do_umount(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 umount(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 umount(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 umount(2) error (returns syscall errno),
+ * <0 in case of other errors.
*/
int mnt_context_umount(struct libmnt_context *cxt)
{