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]
Other format: [Raw text]

Re: cyg_mtab_lookup()


On Tuesday, 25. June 2002 20:12, Nick Garnett wrote:
> Roland Caßebohm <roland.cassebohm@visionsystems.de> writes:
> > Ooops, I haven't seen this. My problem seems to be that the current
> > directory is not initialized. It is a NULL pointer.
> > I think in the constructor
> >
> > Cyg_Fileio_Init_Class::Cyg_Fileio_Init_Class()
> > {
> >     cyg_fd_init();
> >
> >     cyg_mtab_init();
> >
> >     chdir("/");
> > }
> >
> > the current directory should be initialized. I haven't a real filesystem,
> > so chdir() can't find the "/" entry and left cdir_mtab_entry at NULL.
>
> Which is fine. With no file systems there can be no current
> directory. You cannot use relative filenames, because there is nothing
> for them to be relative to.
>
> What exactly are you trying to do that trips over the NULL current
> directory?

I wanted to open a serial line ("/dev/ser0") but if somebody type a wrong 
pathname of it or maybe nothing ("") open() cause a hardware exception  
because of the NULL-pointer.
I think in this case open() should return an error but should not cause an 
hardware exception.

Roland

-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


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