From: Eric Blake Date: Thu, 29 Apr 2010 03:06:46 +0000 (-0600) Subject: build: use gnulib's uname X-Git-Tag: v0.8.2~325 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5349cf1ed2711f6fe180352afce22f4af7089f7b;p=thirdparty%2Flibvirt.git build: use gnulib's uname * bootstrap.conf (gnulib_modules): Add uname. * configure.ac: Drop uname and sys/utsname.h checks. * src/nodeinfo.c (nodeGetInfo): Use uname unconditionally. --- diff --git a/bootstrap.conf b/bootstrap.conf index da7cc9ce78..e85f869c70 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -59,6 +59,7 @@ strtok_r sys_stat time_r timegm +uname useless-if-before-free usleep vasprintf diff --git a/configure.ac b/configure.ac index 93eb654e5c..18da606730 100644 --- a/configure.ac +++ b/configure.ac @@ -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? diff --git a/src/nodeinfo.c b/src/nodeinfo.c index 4d7fac1d26..5ec1bcf8f1 100644 --- a/src/nodeinfo.c +++ b/src/nodeinfo.c @@ -29,16 +29,13 @@ #include #include #include +#include #if HAVE_NUMACTL # define NUMA_VERSION1_COMPATIBILITY 1 # include #endif -#ifdef HAVE_SYS_UTSNAME_H -# include -#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__ {