Marius Onica wrote:
> > AFAICT the result of gethostbyname (used in mgd_init) is handled
> > correctly... yet this is the only place I can imagine this is happening.
> > Maybe the strace would yield more information.
>
> I've attached a strace output
I see nothing odd here. If you want to you can try the attached patch
(on lib/src/midgard.c). I see nothing in the manpages about the state of
the gethostname parameter; maybe it does something funky when it fails.
Emile
Index: midgard.c
===================================================================
RCS file: /usr/local/cvs/midgard/lib/src/midgard.c,v
retrieving revision 1.22
diff -u -u -r1.22 midgard.c
--- midgard.c 2001/11/06 20:55:18 1.22
+++ midgard.c 2001/11/19 13:32:13
@@ -72,11 +72,15 @@
hs = gethostbyname(hostname);
if(hs) hsaddr = g_strdup(hs->h_addr);
endhostent();
- };
+ } else {
+ /*[eeh] not sure gethostname doesn't touch the
+ * parameter if it returns false */
+ hostname[0]=0;
+ }
if(hsaddr == NULL) {
hsaddr = g_strdup_printf("127.0.0.%d", rand()%255);
}
- if(!uname(&data)) {
+ if(uname(&data) == 0) {
repligard_magic_string =
g_strdup_printf("%s|%s|%s|%s|%s|%s|%s",
data.sysname,data.nodename,hostname,
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]