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
Makign debug functions thread safe
[tpg/acess2.git]
/
Modules
/
IPStack
/
main.c
diff --git
a/Modules/IPStack/main.c
b/Modules/IPStack/main.c
index
9b132ec
..
13bc561
100644
(file)
--- a/
Modules/IPStack/main.c
+++ b/
Modules/IPStack/main.c
@@
-97,7
+97,7
@@
int IPStack_Install(char **Arguments)
*/
int IPStack_AddFile(tSocketFile *File)
{
*/
int IPStack_AddFile(tSocketFile *File)
{
- Log
("IPStack_AddFile: %s
", File->Name);
+ Log
_Log("IPStack", "Added file '%s'
", File->Name);
File->Next = gIP_FileTemplates;
gIP_FileTemplates = File;
return 0;
File->Next = gIP_FileTemplates;
gIP_FileTemplates = File;
return 0;
@@
-122,6
+122,11
@@
char *IPStack_Root_ReadDir(tVFS_Node *Node, int Pos)
}
name = malloc(4);
}
name = malloc(4);
+ if(!name) {
+ Log_Warning("IPStack", "IPStack_Root_ReadDir - malloc error");
+ LEAVE('n');
+ return NULL;
+ }
// Create the name
Pos = iface->Node.ImplInt;
// Create the name
Pos = iface->Node.ImplInt;
@@
-170,7
+175,7
@@
tVFS_Node *IPStack_Root_FindDir(tVFS_Node *Node, char *Name)
for( iface = gIP_Interfaces; iface; iface = iface->Next )
{
for( iface = gIP_Interfaces; iface; iface = iface->Next )
{
- if( iface->Node.ImplInt == num )
+ if(
(int)
iface->Node.ImplInt == num )
{
LEAVE('p', &iface->Node);
return &iface->Node;
{
LEAVE('p', &iface->Node);
return &iface->Node;
@@
-231,7
+236,6
@@
char *IPStack_Iface_ReadDir(tVFS_Node *Node, int Pos)
{
tSocketFile *file = gIP_FileTemplates;
while(Pos-- && file) {
{
tSocketFile *file = gIP_FileTemplates;
while(Pos-- && file) {
- Log("IPStack_Iface_ReadDir: %s", file->Name);
file = file->Next;
}
file = file->Next;
}
@@
-251,7
+255,6
@@
tVFS_Node *IPStack_Iface_FindDir(tVFS_Node *Node, char *Name)
for(;file;file = file->Next)
{
if( strcmp(file->Name, Name) == 0 ) break;
for(;file;file = file->Next)
{
if( strcmp(file->Name, Name) == 0 ) break;
- Log("IPStack_Iface_FindDir: strcmp('%s', '%s')", file->Name, Name);
}
if(!file) return NULL;
}
if(!file) return NULL;
@@
-513,9
+516,12
@@
int IPStack_Iface_IOCtl(tVFS_Node *Node, int ID, void *Data)
int IPStack_AddInterface(char *Device)
{
tInterface *iface;
int IPStack_AddInterface(char *Device)
{
tInterface *iface;
+ tAdapter *card;
ENTER("sDevice", Device);
ENTER("sDevice", Device);
+ card = IPStack_GetAdapter(Device);
+
iface = malloc(sizeof(tInterface));
if(!iface) {
LEAVE('i', -2);
iface = malloc(sizeof(tInterface));
if(!iface) {
LEAVE('i', -2);
@@
-527,7
+533,6
@@
int IPStack_AddInterface(char *Device)
// Create Node
iface->Node.ImplPtr = iface;
// Create Node
iface->Node.ImplPtr = iface;
- iface->Node.ImplInt = giIP_NextIfaceId++;
iface->Node.Flags = VFS_FFLAG_DIRECTORY;
iface->Node.Size = -1;
iface->Node.NumACLs = 1;
iface->Node.Flags = VFS_FFLAG_DIRECTORY;
iface->Node.Size = -1;
iface->Node.NumACLs = 1;
@@
-535,6
+540,10
@@
int IPStack_AddInterface(char *Device)
iface->Node.ReadDir = IPStack_Iface_ReadDir;
iface->Node.FindDir = IPStack_Iface_FindDir;
iface->Node.IOCtl = IPStack_Iface_IOCtl;
iface->Node.ReadDir = IPStack_Iface_ReadDir;
iface->Node.FindDir = IPStack_Iface_FindDir;
iface->Node.IOCtl = IPStack_Iface_IOCtl;
+ iface->Node.MkNod = NULL;
+ iface->Node.Link = NULL;
+ iface->Node.Relink = NULL;
+ iface->Node.Close = NULL;
// Set Defaults
iface->TimeoutDelay = DEFAULT_TIMEOUT;
// Set Defaults
iface->TimeoutDelay = DEFAULT_TIMEOUT;
@@
-547,6
+556,10
@@
int IPStack_AddInterface(char *Device)
return -1; // Return ERR_YOUFAIL
}
return -1; // Return ERR_YOUFAIL
}
+ // Delay setting ImplInt until after the adapter is opened
+ // Keeps things simple
+ iface->Node.ImplInt = giIP_NextIfaceId++;
+
// Append to list
LOCK( &glIP_Interfaces );
if( gIP_Interfaces ) {
// Append to list
LOCK( &glIP_Interfaces );
if( gIP_Interfaces ) {
UCC
git Repository :: git.ucc.asn.au