+2002-03-25 [paul] 0.7.4claws41
+
+ * src/utils.c
+ get full hostname. patch submitted by
+ Bob Woodside <rwoodside1@comcast.net>
+
2002-03-25 [paul] 0.7.4claws40
* src/account.c
#include <string.h>
#include <ctype.h>
#include <errno.h>
+#include <netdb.h>
#if (HAVE_WCTYPE_H && HAVE_WCHAR_H)
# include <wchar.h>
gchar *get_domain_name(void)
{
static gchar *domain_name = NULL;
+ struct hostent *myfqdn = NULL;
if (!domain_name) {
gchar buf[BUFFSIZE] = "";
if (gethostname(buf, sizeof(buf)) < 0) {
perror("gethostname");
strcpy(buf, "unknown");
- }
+ } else {
+ myfqdn = gethostbyname(buf);
+ if (myfqdn != NULL) {
+ memset(buf, '\0', strlen(buf));
+ strcpy(buf, myfqdn->h_name);
+ } else {
+ perror("gethostbyname");
+ strcpy(buf, "unknown");
+ }
+ }
domain_name = g_strdup(buf);
}