[9063] in The GTK GIMP ToolKit mailing list archive

home help back first fref pref prev next nref lref last post

[gtk-list] Re: another GDK segfault...

daemon@ATHENA.MIT.EDU (Luyseyal)
Mon Oct 5 17:19:50 1998

Date: Mon, 05 Oct 1998 16:16:51 -0500
From: Luyseyal <luyseyal@austin.cc.tx.us>
To: gtk-list@redhat.com
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com

ok, figured out why it's segfaulting... null pointer b/c it's a
redhat system and they don't use /etc/hosts and stuff like that.

now that that's out of the way, any suggestions as to what calls
to use to find out similar host info?

thanks,

-l


Luyseyal wrote:
> 
> working on a RH5.1 box w/ all updates:
> glibc 2.0.7
> glib 1.1.3
> glib 1.0.5
> glib10 1.0.6
> gtk+ 1.1.2
> gtk+ 1.0.5
> glib10 1.0.6
> 
> (the g*10's are for gnome).
> 
> i've got a little snippet of code that segfaults everytime i call it.
> if this is a stupid error, i'm sorry, i'm still learning C.
> 
> <snip-snip>
> 
> #define _GNU_SOURCE
> #include <stdlib.h>
> #include <stdio.h>
> #include <unistd.h>
> #include <gtk/gtk.h>
> #include <sys/socket.h>
> #include <netinet/in.h>
> #include <netdb.h>
> 
> gchar
> *thishostname()
> {
>         struct hostent *thishost;
>         sethostent(0);
>         thishost = gethostent() ;
>         endhostent();
>         return thishost->h_name;
> 
> }
> 
> void
> main
> {
>         g_print("hostname: %s \n", thishostname());
> }
> 
> <snip-snip>
> 
> it bombs every time w/o fail. what is it that i'm missing?
> 
> thanks,
> 
> -l
> 
> --
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null

-- 
How to become an international arms trafficker:
http://online.offshore.com.ai/arms-trafficker/
#!/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj
$/=unpack('H*',$_);$_=`echo 16dio\U$k"SK$/SM$n\EsN0p[lN*1
lK[d2%Sa2/d0$^Ixp"|dc`;s/\W//g;$_=pack('H*',/((..)*)$/)

-- 
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null


home help back first fref pref prev next nref lref last post