This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Mount always succeeds!?


Hi,

I'm a bit puzzled... Why should the mount system call (located
in packages/io/fileio/current/src/misc.cxx) always return ENOERR,
even when the mount of the filesystem failed?

In other words: why is the result of the filesystem mount (the
function I mean here is the function that is called when the mount
system call executes f->mount (f, m)) only used to set m->valid
when the valid field of a mount table entry is not used anywhere?

I would expect that if the filesystem mount failed, the mount system
call returns -1 and sets errno to the value returned by the filesystem
mount (see attached patch). Otherwise the caller of the mount system
call can never find out if the mount succeeded.

Please enlighten me,
Martin.


__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/
--- io/fileio/current/src/misc.cxx.orig	Fri Dec 22 03:37:29 2000
+++ io/fileio/current/src/misc.cxx	Wed Mar 14 15:39:57 2001
@@ -252,7 +252,8 @@
     
     cyg_mtab_entry *m;
     cyg_fstab_entry *f;
-    
+    int result = ENOERR;
+
     // Search the mount table for an empty entry
     for( m = &mtab[0]; m != &mtab_end; m++ )
     {
@@ -289,7 +290,7 @@
     m->fsname = fsname;
     m->devname = devname;
     
-    if( f->mount( f, m ) == 0 )
+    if( (result = f->mount( f, m )) == 0 )
     {
         m->valid    = true;
         m->fs       = f;
@@ -301,7 +302,7 @@
         m->name = NULL;
     }
                 
-    FILEIO_RETURN(ENOERR);
+    FILEIO_RETURN(result);
 }
 
 //==========================================================================

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]