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
Merge branch 'master' of git://git.ucc.asn.au/tpg/acess2
[tpg/acess2.git]
/
KernelLand
/
Kernel
/
vfs
/
fs
/
devfs.c
diff --git
a/KernelLand/Kernel/vfs/fs/devfs.c
b/KernelLand/Kernel/vfs/fs/devfs.c
index
9ab2b7b
..
9389822
100644
(file)
--- a/
KernelLand/Kernel/vfs/fs/devfs.c
+++ b/
KernelLand/Kernel/vfs/fs/devfs.c
@@
-15,7
+15,7
@@
void DevFS_DelDevice(tDevFS_Driver *Device);
#endif
tVFS_Node *DevFS_InitDevice(const char *Device, const char **Options);
void DevFS_Unmount(tVFS_Node *RootNode);
#endif
tVFS_Node *DevFS_InitDevice(const char *Device, const char **Options);
void DevFS_Unmount(tVFS_Node *RootNode);
-
char *DevFS_ReadDir(tVFS_Node *Node, int Pos
);
+
int DevFS_ReadDir(tVFS_Node *Node, int Pos, char Dest[FILENAME_MAX]
);
tVFS_Node *DevFS_FindDir(tVFS_Node *Node, const char *Name);
// === GLOBALS ===
tVFS_Node *DevFS_FindDir(tVFS_Node *Node, const char *Name);
// === GLOBALS ===
@@
-128,21
+128,24
@@
void DevFS_Unmount(tVFS_Node *RootNode)
/**
* \fn char *DevFS_ReadDir(tVFS_Node *Node, int Pos)
*/
/**
* \fn char *DevFS_ReadDir(tVFS_Node *Node, int Pos)
*/
-
char *DevFS_ReadDir(tVFS_Node *Node, int Pos
)
+
int DevFS_ReadDir(tVFS_Node *Node, int Pos, char Dest[FILENAME_MAX]
)
{
tDevFS_Driver *dev;
{
tDevFS_Driver *dev;
- if(Pos < 0) return
NUL
L;
+ if(Pos < 0) return
-EINVA
L;
for(dev = gDevFS_Drivers;
dev && Pos--;
dev = dev->Next
);
for(dev = gDevFS_Drivers;
dev && Pos--;
dev = dev->Next
);
- if(dev)
- return strdup(dev->Name);
- else
- return NULL;
+ if(dev) {
+ strncpy(Dest, dev->Name, FILENAME_MAX);
+ return 0;
+ }
+ else {
+ return -ENOENT;
+ }
}
/**
}
/**
UCC
git Repository :: git.ucc.asn.au