]> git.ipfire.org Git - thirdparty/libvirt.git/commit
build: include correct header for time()
authorEric Blake <eblake@redhat.com>
Tue, 14 Apr 2015 19:15:06 +0000 (13:15 -0600)
committerEric Blake <eblake@redhat.com>
Tue, 14 Apr 2015 19:24:51 +0000 (13:24 -0600)
commite4ab08481399a90eeb123df75f26234a924d7c3b
treeb07c3f1abad53f007d6eabb65a0cf070d2446348
parent49ed6cff997bb893dafc805c868c9e772a04696d
build: include correct header for time()

Found by ./autobuild.sh during a mingw cross-compile:

Commit 8a96e87 was not innocuous - glibc happens to leak the
definition of time() through other headers, so that even without
<sys/select.h>, virrandom.c compiled just fine.  But on mingw,
we were not so lucky; <sys/select.h> was important for its side
effect of dragging in <time.h>, and we now have nothing providing
the declaration of time():

../../src/util/virrandom.c: In function 'virRandomOnceInit':
../../src/util/virrandom.c:65:5: error: implicit declaration of function 'time' [-Werror=implicit-function-declaration]
     unsigned int seed = time(NULL) ^ getpid();
          ^
  ../../src/util/virrandom.c:65:5: error: nested extern declaration of 'time' [-Werror=nested-externs]

Signed-off-by: Eric Blake <eblake@redhat.com>
src/util/virrandom.c