X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=direct%2Fyaffsfs.c;h=9109da7f1df5d635de725d95b590a4806159e65e;hb=21283903b8863d2c27d1320c0f6a1c1ea0c90ef3;hp=1c73c99471a76cb2fd5e8788c4107f9d7fdd515b;hpb=2e51ed27a28a076ee9eb870ba8c0eb09b8114b01;p=yaffs2.git diff --git a/direct/yaffsfs.c b/direct/yaffsfs.c index 1c73c99..9109da7 100644 --- a/direct/yaffsfs.c +++ b/direct/yaffsfs.c @@ -25,7 +25,7 @@ #endif -const char *yaffsfs_c_version="$Id: yaffsfs.c,v 1.1 2004-11-03 08:29:28 charles Exp $"; +const char *yaffsfs_c_version="$Id: yaffsfs.c,v 1.4 2005-07-03 05:48:11 charles Exp $"; // configurationList is the list of devices that are supported static yaffsfs_DeviceConfiguration *yaffsfs_configurationList; @@ -180,7 +180,7 @@ static yaffs_Device *yaffsfs_FindDevice(const char *path, char **restOfPath) p++; leftOver++; } - if(!*p) + if(!*p && (!*leftOver || *leftOver == '/')) { // Matched prefix *restOfPath = (char *)leftOver; @@ -578,6 +578,7 @@ int yaffs_write(int fd, const void *buf, unsigned int nbyte) yaffs_Object *obj = NULL; int pos = 0; int nWritten = -1; + int writeThrough = 0; yaffsfs_Lock(); h = yaffsfs_GetHandlePointer(fd); @@ -603,7 +604,7 @@ int yaffs_write(int fd, const void *buf, unsigned int nbyte) pos = h->position; } - nWritten = yaffs_WriteDataToFile(obj,buf,pos,nbyte); + nWritten = yaffs_WriteDataToFile(obj,buf,pos,nbyte,writeThrough); if(nWritten >= 0) { @@ -1124,7 +1125,7 @@ off_t yaffs_freespace(const char *path) yaffsfs_Lock(); dev = yaffsfs_FindDevice(path,&dummy); - if(dev) + if(dev && dev->isMounted) { retVal = yaffs_GetNumberOfFreeChunks(dev); retVal *= dev->nBytesPerChunk;