[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

r1091 - trunk/glibc-2.3-head/sysdeps/kfreebsd



Author: aurel32
Date: 2006-01-22 18:48:06 +0000 (Sun, 22 Jan 2006)
New Revision: 1091

Modified:
   trunk/glibc-2.3-head/sysdeps/kfreebsd/uname.c
Log:
uname.c: also fill the domainname field. It is a GNU extension, but as 
we can easily have the information using getdomainname(), we can support it.



Modified: trunk/glibc-2.3-head/sysdeps/kfreebsd/uname.c
===================================================================
--- trunk/glibc-2.3-head/sysdeps/kfreebsd/uname.c	2006-01-22 08:20:14 UTC (rev 1090)
+++ trunk/glibc-2.3-head/sysdeps/kfreebsd/uname.c	2006-01-22 18:48:06 UTC (rev 1091)
@@ -21,6 +21,7 @@
 #include <sys/sysctl.h>
 #include <errno.h>
 #include <string.h>
+#include <unistd.h>	/* For getdomainname() */
 
 #define SYSNAME                "GNU/kFreeBSD"
 #define SYSNAME_LEN    13
@@ -94,6 +95,13 @@
         name->machine[len] = '\0';
     }
 
+  /* Fill domainname.  Use getdomainname(). */
+  if (getdomainname(name->domainname, sizeof(name->domainname)) == -1)
+    {
+      if (errno != EINVAL)
+        strncpy (name->domainname, UNAME_DOMAINNAME, sizeof (name->domainname));
+    }
+  
   return 0;
 }
 libc_hidden_def (__uname)



Reply to: