projects
/
yaffs2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix error in conditional define (and move it after header)
[yaffs2.git]
/
direct
/
yaffsfs.c
diff --git
a/direct/yaffsfs.c
b/direct/yaffsfs.c
index 9d7804c153d1e113aa6b987cf861de53f188b4e3..dc6dab9640858117c6d139337c0405a2830a3010 100644
(file)
--- a/
direct/yaffsfs.c
+++ b/
direct/yaffsfs.c
@@
-1,15
+1,14
@@
/*
/*
- * YAFFS: Yet another FFS. A NAND-flash specific file system.
- * yaffsfs.c The interface functions for using YAFFS via a "direct" interface.
+ * YAFFS: Yet Another Flash File System. A NAND-flash specific file system.
*
*
- * Copyright (C) 2002 Aleph One Ltd.
+ * Copyright (C) 2002-2007 Aleph One Ltd.
+ * for Toby Churchill Ltd and Brightstar Engineering
*
* Created by Charles Manning <charles@aleph1.co.uk>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* Created by Charles Manning <charles@aleph1.co.uk>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
- *
*/
#include "yaffsfs.h"
*/
#include "yaffsfs.h"
@@
-25,7
+24,7
@@
#endif
#endif
-const char *yaffsfs_c_version="$Id: yaffsfs.c,v 1.1
3 2006-10-03 10:13:03
charles Exp $";
+const char *yaffsfs_c_version="$Id: yaffsfs.c,v 1.1
8 2007-07-18 19:40:38
charles Exp $";
// configurationList is the list of devices that are supported
static yaffsfs_DeviceConfiguration *yaffsfs_configurationList;
// configurationList is the list of devices that are supported
static yaffsfs_DeviceConfiguration *yaffsfs_configurationList;
@@
-39,6
+38,9
@@
static void yaffsfs_RemoveObjectCallback(yaffs_Object *obj);
// Handle management.
//
// Handle management.
//
+
+unsigned int yaffs_wr_attempts;
+
typedef struct
{
__u8 inUse:1; // this handle is in use
typedef struct
{
__u8 inUse:1; // this handle is in use
@@
-729,10
+731,6
@@
int yaffsfs_DoUnlink(const char *path,int isDirectory)
{
yaffsfs_SetError(-ENOTDIR);
}
{
yaffsfs_SetError(-ENOTDIR);
}
- else if(isDirectory && obj->variantType != YAFFS_OBJECT_TYPE_DIRECTORY)
- {
- yaffsfs_SetError(-ENOTDIR);
- }
else
{
result = yaffs_Unlink(dir,name);
else
{
result = yaffs_Unlink(dir,name);
@@
-1302,8
+1300,14
@@
struct yaffs_dirent *yaffs_readdir(yaffs_DIR *dirp)
yaffsfs_SetError(0);
if(dsc->nextReturn){
dsc->de.d_ino = yaffs_GetEquivalentObject(dsc->nextReturn)->objectId;
yaffsfs_SetError(0);
if(dsc->nextReturn){
dsc->de.d_ino = yaffs_GetEquivalentObject(dsc->nextReturn)->objectId;
+ dsc->de.d_dont_use = (unsigned)dsc->nextReturn;
dsc->de.d_off = dsc->offset++;
dsc->de.d_off = dsc->offset++;
- yaffs_GetObjectName(dsc->nextReturn,dsc->de.d_name,NAME_MAX+1);
+ yaffs_GetObjectName(dsc->nextReturn,dsc->de.d_name,NAME_MAX);
+ if(strlen(dsc->de.d_name) == 0)
+ {
+ // this should not happen!
+ strcpy(dsc->de.d_name,"zz");
+ }
dsc->de.d_reclen = sizeof(struct yaffs_dirent);
retVal = &dsc->de;
yaffsfs_DirAdvance(dsc);
dsc->de.d_reclen = sizeof(struct yaffs_dirent);
retVal = &dsc->de;
yaffsfs_DirAdvance(dsc);