projects
/
yaffs2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
18fcce7
)
Change yaffs_DeleteFile to yaffs_DeleteObject and improve symlink handling
author
charles
<charles>
Thu, 5 Mar 2009 01:47:17 +0000
(
01:47
+0000)
committer
charles
<charles>
Thu, 5 Mar 2009 01:47:17 +0000
(
01:47
+0000)
direct/yaffsfs.c
patch
|
blob
|
history
diff --git
a/direct/yaffsfs.c
b/direct/yaffsfs.c
index a0961904ef1def831117843b58edb0767587d0c1..3be1ea7d13a83a521b2ec4f78c551519730f5d9d 100644
(file)
--- a/
direct/yaffsfs.c
+++ b/
direct/yaffsfs.c
@@
-24,7
+24,7
@@
#endif
#endif
-const char *yaffsfs_c_version="$Id: yaffsfs.c,v 1.2
4 2008-11-11 01:47:46
charles Exp $";
+const char *yaffsfs_c_version="$Id: yaffsfs.c,v 1.2
5 2009-03-05 01:47:17
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;
@@
-630,7
+630,7
@@
int yaffs_close(int fd)
h->obj->inUse--;
if(h->obj->inUse <= 0 && h->obj->unlinked)
{
h->obj->inUse--;
if(h->obj->inUse <= 0 && h->obj->unlinked)
{
- yaffs_Delete
File
(h->obj);
+ yaffs_Delete
Object
(h->obj);
}
yaffsfs_PutHandle(fd);
retVal = 0;
}
yaffsfs_PutHandle(fd);
retVal = 0;
@@
-1849,14
+1849,19
@@
int yaffs_symlink(const YCHAR *oldpath, const YCHAR *newpath)
yaffsfs_Lock();
parent = yaffsfs_FindDirectory(NULL,newpath,&name,0);
yaffsfs_Lock();
parent = yaffsfs_FindDirectory(NULL,newpath,&name,0);
- obj = yaffs_MknodSymLink(parent,name,mode,0,0,oldpath);
- if(obj)
- {
- retVal = 0;
- }
- else
- {
- yaffsfs_SetError(-ENOSPC); // just assume no space for now
+ if(parent){
+ obj = yaffs_MknodSymLink(parent,name,mode,0,0,oldpath);
+ if(obj)
+ {
+ retVal = 0;
+ }
+ else
+ {
+ yaffsfs_SetError(-ENOSPC); // just assume no space for now
+ retVal = -1;
+ }
+ } else {
+ yaffsfs_SetError(-EINVAL);
retVal = -1;
}
retVal = -1;
}