2007-06-08 [paul] 2.9.2cvs46
authorPaul Mangan <paul@claws-mail.org>
Fri, 8 Jun 2007 09:01:01 +0000 (09:01 +0000)
committerPaul Mangan <paul@claws-mail.org>
Fri, 8 Jun 2007 09:01:01 +0000 (09:01 +0000)
* src/common/utils.c
use gethostname() instead of uname()
based on a patch by Michael Hughes
<Sylpheed-Claws_user@thehugheslogcabin.net>

ChangeLog
PATCHSETS
configure.ac
src/common/utils.c

index 449c02557e91b4b5214f9be2bec8b2b4dc6b0440..d43e77f27d793f01c11a81cea8eaecf803cc7ddf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-06-08 [paul]      2.9.2cvs46
+
+       * src/common/utils.c
+               use gethostname() instead of uname()
+               based on a patch by Michael Hughes
+               <Sylpheed-Claws_user@thehugheslogcabin.net>
+
 2007-06-07 [wwp]       2.9.2cvs45
 
        * src/prefs_common.c
index 465b188fadecd317273f1b6149bf52c04fa931c9..ab9f219f4c6329451ea8403f45adf9c20a00e228 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.1.2.5 -r 1.1.2.6 src/ldapupdate.c;  ) > 2.9.2cvs43.patchset
 ( cvs diff -u -r 1.1.2.6 -r 1.1.2.7 src/ldapupdate.c;  ) > 2.9.2cvs44.patchset
 ( cvs diff -u -r 1.204.2.135 -r 1.204.2.136 src/prefs_common.c;  ) > 2.9.2cvs45.patchset
+( cvs diff -u -r 1.36.2.103 -r 1.36.2.104 src/common/utils.c;  ) > 2.9.2cvs46.patchset
index a6e47b376785a8df4ae6bbb532f88bb092415ee5..2d5f7d01a38f5c186b42587c8e008a538a340b13 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=2
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=45
+EXTRA_VERSION=46
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 930592f3cb4a836b3980db95441708779d70a2aa..f0a5c9fec1e6c263f25c29cd4a3f3b1c568c3174 100644 (file)
@@ -31,6 +31,7 @@
 #include <string.h>
 #include <ctype.h>
 #include <errno.h>
+#include <sys/param.h>
 
 #if (HAVE_WCTYPE_H && HAVE_WCHAR_H)
 #  include <wchar.h>
@@ -2040,20 +2041,20 @@ const gchar *get_domain_name(void)
 
        if (!domain_name) {
                struct hostent *hp;
-               struct utsname uts;
+               char hostname[256];
 
-               if (uname(&uts) < 0) {
-                       perror("uname");
+               if (gethostname(hostname, sizeof(hostname)) != 0) {
+                       perror("gethostname");
                        domain_name = "unknown";
                } else {
-                       if ((hp = my_gethostbyname(uts.nodename)) == NULL) {
+                       hostname[sizeof(hostname) - 1] = '\0';
+                       if ((hp = my_gethostbyname(hostname)) == NULL) {
                                perror("gethostbyname");
-                               domain_name = g_strdup(uts.nodename);
+                               domain_name = g_strdup(hostname);
                        } else {
                                domain_name = g_strdup(hp->h_name);
                        }
                }
-
                debug_print("domain name = %s\n", domain_name);
        }