[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] FreeMiNT & MiNTlib patchset - add new support



On Wed, 2008-08-20 at 08:25 +0100, Alan Hourihane wrote:
> On Tue, 2008-08-19 at 23:21 +0200, Frank Naumann wrote:
> > Hello!
> > 
> > >> The patch adds the following support...
> > >>
> > >> Functions.
> > >> fdopendir()
> > >> fchdir()
> > >> dirfd()
> > >>
> > >> New flags.
> > >> O_NOATIME
> > >> O_NOFOLLOW
> > >> O_DIRECTORY
> > >>
> > >> I've been testing extensively with GNU tools and have fixed problems
> > >> along the way since my last patches were sent on this and they seem good
> > >> now. I've used coreutils, sed, m4, python, file, make and the list goes
> > >> on successfully with these.
> > >
> > > Any questions/suggestions on these ?
> > 
> > Yes, I took a deeper look into the code. It looks good.
> > 
> > A question about this (I don't checked it): it is possible to catch 
> > read/write request at a igher level instead inside the xfs? This make much 
> > more sense (and avoid the problem if a newer kernel load an older xfs).
> 
> It already is, but I've added extra checks inside the xfs to double
> check.

Whoops. I thought I'd included it in the patchset but I hadn't. Here's
the extra part that's required.

Alan.
Index: sys/k_fds.c
===================================================================
RCS file: /mint/freemint/sys/k_fds.c,v
retrieving revision 1.20
diff -u -r1.20 k_fds.c
--- sys/k_fds.c	13 Jul 2007 21:32:48 -0000	1.20
+++ sys/k_fds.c	20 Aug 2008 07:39:53 -0000
@@ -362,9 +366,9 @@
 
 	DEBUG(("do_open(%s): mode 0x%x", name, xattr.mode));
 
-	/* we don't do directories
+	/* we don't do directories other than read-only
 	 */
-	if (S_ISDIR(xattr.mode))
+	if (S_ISDIR(xattr.mode) && ((rwmode & O_RWMODE) != O_RDONLY))
 	{
 		DEBUG(("do_open(%s): file is a directory", name));
 		release_cookie (&dir);