git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Modules/USB - Fixed slight bug in UHCI
[tpg/acess2.git]
/
Kernel
/
vfs
/
dir.c
diff --git
a/Kernel/vfs/dir.c
b/Kernel/vfs/dir.c
index
43cc0b5
..
3d4018f
100644
(file)
--- a/
Kernel/vfs/dir.c
+++ b/
Kernel/vfs/dir.c
@@
-15,6
+15,7
@@
extern tVFS_Mount *gRootMount;
int VFS_MkDir(const char *Path);
#endif
int VFS_MkNod(const char *Path, Uint Flags);
int VFS_MkDir(const char *Path);
#endif
int VFS_MkNod(const char *Path, Uint Flags);
+// int VFS_Symlink(const char *Name, const char *Link);
// === CODE ===
/**
// === CODE ===
/**
@@
-59,9
+60,9
@@
int VFS_MkNod(const char *Path, Uint Flags)
// Check for root
if(absPath[0] == '\0')
// Check for root
if(absPath[0] == '\0')
- parent = VFS_ParsePath("/", NULL);
+ parent = VFS_ParsePath("/", NULL
, NULL
);
else
else
- parent = VFS_ParsePath(absPath, NULL);
+ parent = VFS_ParsePath(absPath, NULL
, NULL
);
LOG("parent = %p", parent);
LOG("parent = %p", parent);
@@
-115,35
+116,49
@@
int VFS_Symlink(const char *Name, const char *Link)
{
char *realLink;
int fp;
{
char *realLink;
int fp;
- tVFS_Node *destNode;
char *_link;
char *_link;
-
//
ENTER("sName sLink", Name, Link);
+ ENTER("sName sLink", Name, Link);
// Get absolue path name
_link = VFS_GetAbsPath( Link );
if(!_link) {
// Get absolue path name
_link = VFS_GetAbsPath( Link );
if(!_link) {
- Warning("Path '%s' is badly formed", Link);
+ Log_Warning("VFS", "Path '%s' is badly formed", Link);
+ LEAVE('i', -1);
return -1;
}
return -1;
}
+
+ LOG("_link = '%s'", _link);
+ #if 1
+ {
+ tVFS_Node *destNode = VFS_ParsePath( _link, &realLink, NULL );
+ #if 0
// Get true path and node
// Get true path and node
- destNode = VFS_ParsePath( _link, &realLink );
free(_link);
_link = NULL;
free(_link);
_link = NULL;
+ #else
+ realLink = _link;
+ #endif
// Check if destination exists
if(!destNode) {
// Check if destination exists
if(!destNode) {
-
Warning(
"File '%s' does not exist, symlink not created", Link);
+
Log_Warning("VFS",
"File '%s' does not exist, symlink not created", Link);
return -1;
}
// Derefence the destination
if(destNode->Close) destNode->Close(destNode);
return -1;
}
// Derefence the destination
if(destNode->Close) destNode->Close(destNode);
-
+ }
+ #else
+ realLink = _link;
+ #endif
+ LOG("realLink = '%s'", realLink);
+
// Make node
if( VFS_MkNod(Name, VFS_FFLAG_SYMLINK) != 0 ) {
// Make node
if( VFS_MkNod(Name, VFS_FFLAG_SYMLINK) != 0 ) {
- Warning("Unable to create link node '%s'", Name);
+ Log_Warning("VFS", "Unable to create link node '%s'", Name);
+ LEAVE('i', -2);
return -2; // Make link node
}
return -2; // Make link node
}
@@
-154,6
+169,7
@@
int VFS_Symlink(const char *Name, const char *Link)
free(realLink);
free(realLink);
+ LEAVE('i', 1);
return 1;
}
return 1;
}
UCC
git Repository :: git.ucc.asn.au