[DGD] DGD n00bie Question #1

Martyn Ashworth m.ashworth at ukonline.co.uk
Sun Aug 24 19:29:43 CEST 2003


> I was not able to reproduce the error.
>
> Perhaps something could be found if you copied and pasted more of the
> code.

OK. I won't bore you with the header file.

Here is the "initd.c" file. ALL elements work if i remove the offending line
"TWG_SYS_LOGD->log_system_message("boo",1);"

# include <twg_config.h>
# include <kernel/access.h>
# include <kernel/user.h>
# include <kernel/rsrc.h>

inherit access API_ACCESS;
inherit rsrc API_RSRC;

static int create(varargs int clone) {
 object telnet_manager,binary_manager;

 /* Compile system objects that are needed immediately
 if(!find_object(TWG_SYS_LOGD)) { compile_object(TWG_SYS_LOGD); }
 if(!find_object(TWG_OBJ_USER)) { compile_object(TWG_OBJ_USER); }
 if(!find_object(TWG_SYS_ERRORD)) { compile_object(TWG_SYS_ERRORD); }

 telnet_manager = compile_object(TWG_SYS_TELNETM);
 binary_manager = compile_object(TWG_SYS_BINARYM);
 TWG_KER_USERD->set_binary_manager(binary_manager);
 TWG_KER_USERD->set_telnet_manager(telnet_manager);


find_object(TWG_KER_DRIVER)->set_error_manager(find_object(TWG_SYS_ERRORD));

 TWG_SYS_LOGD->log_system_message("boo",1);
}

and here is the LOGD file.



# include <twg_config.h>

void log_system_message(string logtext, int cheese);

void log_system_message(string logtext, int cheese)
{
  write_file("/log/test.log", logtext);
}

static void create(varargs int clone)
{
  if(clone)
    error("Can't clone LOGD!\n");
}

-=[MJ]=-
Feed them grass. They will grow.

_________________________________________________________________
List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list