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

Re: utime()



>>>>> On Fri, 27 Aug 93 02:44:40 +0200, Bjarne Pohlers <bjarne@GOEDEL.UNI-MUENSTER.DE> said:
|>  Hello,

|>  it seems that the utime-MiNTLIB-call does not work with MiNT 1.09 and
|>  minixfs PL6. I noticed that the Libs use a Fcntl()-call with FUTIME as
|>  a command, but I did not find any docs about FUTIME as a
|>  Fcntl()-command. However, the Minixfs *seems to know about FUTIME (in
|>  minixdev.c) but it does not work :-(

|>  Does anyone have an idea whats wrong here?

This is a bug in minixfs (i have already reported it). Here is a
patch:

--- orig/minixfs/minixdev.c	Sat Jul 24 04:12:32 1993
+++ minixfs/minixdev.c	Wed Aug  4 17:04:10 1993
@@ -561,7 +561,8 @@
 	  d_inode rip;
 	  short *timeptr = (short *) buf;
 
-	  if( !(f->flags & O_WRONLY) ) return EACCDN;
+	  if ((f->flags & O_RWMODE) == O_RDONLY)
+	    return EACCDN;
 	  read_inode (f->fc.index, &rip, f->fc.dev);
 	  rip.i_atime = Unixtime (timeptr[0], timeptr[1]);
 	  rip.i_mtime = Unixtime (timeptr[2], timeptr[3]);
@@ -575,7 +576,8 @@
 
       case FTRUNCATE:
 	{
-	  if( !(f->flags & O_WRONLY) ) return EACCDN;
+	  if ((f->flags & O_RWMODE) == O_RDONLY)
+	    return EACCDN;
 
 	  itruncate(f->fc.index,f->fc.dev,*((long *)buf));

Regards, Andreas