]> xenbits.xensource.com Git - libvirt.git/commitdiff
build: use gnulib's uname
authorEric Blake <eblake@redhat.com>
Thu, 29 Apr 2010 03:06:46 +0000 (21:06 -0600)
committerEric Blake <eblake@redhat.com>
Thu, 6 May 2010 20:35:37 +0000 (14:35 -0600)
* bootstrap.conf (gnulib_modules): Add uname.
* configure.ac: Drop uname and sys/utsname.h checks.
* src/nodeinfo.c (nodeGetInfo): Use uname unconditionally.

bootstrap.conf
configure.ac
src/nodeinfo.c

index da7cc9ce78721c18a112351dfa70e0584e3b9fc1..e85f869c70695682180f7d3afbf49290079fd611 100644 (file)
@@ -59,6 +59,7 @@ strtok_r
 sys_stat
 time_r
 timegm
+uname
 useless-if-before-free
 usleep
 vasprintf
index 93eb654e5cbed4c0af1ad1f1eea1f221b68477ba..18da6067301ab3c447207c7584c6a7c7803cdd18 100644 (file)
@@ -106,7 +106,7 @@ dnl Use --disable-largefile if you don't want this.
 AC_SYS_LARGEFILE
 
 dnl Availability of various common functions (non-fatal if missing).
-AC_CHECK_FUNCS_ONCE([cfmakeraw regexec uname sched_getaffinity getuid getgid \
+AC_CHECK_FUNCS_ONCE([cfmakeraw regexec sched_getaffinity getuid getgid \
  posix_fallocate mmap])
 
 dnl Availability of various not common threadsafe functions
@@ -121,7 +121,7 @@ AC_CHECK_FUNCS([pthread_sigmask pthread_mutexattr_init])
 LIBS=$old_libs
 
 dnl Availability of various common headers (non-fatal if missing).
-AC_CHECK_HEADERS([pwd.h paths.h regex.h sys/syslimits.h sys/utsname.h \
+AC_CHECK_HEADERS([pwd.h paths.h regex.h sys/syslimits.h \
   sys/wait.h sched.h termios.h sys/poll.h syslog.h mntent.h net/ethernet.h])
 
 dnl Where are the XDR functions?
index 4d7fac1d26955ed900936aa2504a96e2033eed43..5ec1bcf8f1d1c988c8bbb78d6b734de4cfe98f8d 100644 (file)
 #include <stdint.h>
 #include <errno.h>
 #include <dirent.h>
+#include <sys/utsname.h>
 
 #if HAVE_NUMACTL
 # define NUMA_VERSION1_COMPATIBILITY 1
 # include <numa.h>
 #endif
 
-#ifdef HAVE_SYS_UTSNAME_H
-# include <sys/utsname.h>
-#endif
-
 #include "c-ctype.h"
 #include "memory.h"
 #include "nodeinfo.h"
@@ -273,18 +270,13 @@ int linuxNodeInfoCPUPopulate(FILE *cpuinfo,
 #endif
 
 int nodeGetInfo(virConnectPtr conn ATTRIBUTE_UNUSED, virNodeInfoPtr nodeinfo) {
-    memset(nodeinfo, 0, sizeof(*nodeinfo));
-
-#ifdef HAVE_UNAME
-    {
     struct utsname info;
 
+    memset(nodeinfo, 0, sizeof(*nodeinfo));
     uname(&info);
 
     if (virStrcpyStatic(nodeinfo->model, info.machine) == NULL)
         return -1;
-    }
-#endif /* !HAVE_UNAME */
 
 #ifdef __linux__
     {