From dae3dd10986d209f116197c0d8d5fabf46dbe364 Mon Sep 17 00:00:00 2001 From: Jennifer Averett Date: Thu, 7 Nov 2002 15:45:09 +0000 Subject: 2002-11-07 * src/mount.c: Per PR297, correct fs_mountme failure paths. --- cpukit/libcsupport/src/mount.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/cpukit/libcsupport/src/mount.c b/cpukit/libcsupport/src/mount.c index ed10d9e749..16aca0daed 100644 --- a/cpukit/libcsupport/src/mount.c +++ b/cpukit/libcsupport/src/mount.c @@ -101,6 +101,13 @@ int mount( return -1; } + /* Do they support being mounted at all ? */ + if ( !fs_ops->fsmount_me_h ) { + errno = ENOTSUP; + goto cleanup_and_bail; + } + + /* * Allocate a mount table entry */ @@ -207,14 +214,14 @@ int mount( temp_mt_entry->mt_point_node.mt_entry = NULL; } - if ( !fs_ops->fsmount_me_h ) { - errno = ENOTSUP; + if ( fs_ops->fsmount_me_h( temp_mt_entry ) ) { + /* try to undo the mount operation */ + if ( loc.ops->unmount_h ) { + loc.ops->unmount_h( temp_mt_entry ); + } goto cleanup_and_bail; } - if ( fs_ops->fsmount_me_h( temp_mt_entry ) ) - goto cleanup_and_bail; - /* * Add the mount table entry to the mount table chain */ -- cgit v1.2.3