]> xenbits.xensource.com Git - libvirt.git/commit
Make sure sys/types.h is included after sys/sysmacros.h
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 6 Sep 2016 12:20:04 +0000 (14:20 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 6 Sep 2016 15:49:36 +0000 (17:49 +0200)
commitf3f15cc2403a71b668e74f38e52314a9d49343a8
treeb9a1c0cb5fa3fb9addb4e569c311dc0ea8b4edb1
parentcbbaa17faf2e8dd92455d69daaa05178be4dce05
Make sure sys/types.h is included after sys/sysmacros.h

In the latest glibc, major() and minor() functions are marked as
deprecated (glibc commit dbab6577):

  CC       util/libvirt_util_la-vircgroup.lo
util/vircgroup.c: In function 'virCgroupGetBlockDevString':
util/vircgroup.c:768:5: error: '__major_from_sys_types' is deprecated:
  In the GNU C Library, `major' is defined by <sys/sysmacros.h>.
  For historical compatibility, it is currently defined by
  <sys/types.h> as well, but we plan to remove this soon.
  To use `major', include <sys/sysmacros.h> directly.
  If you did not intend to use a system-defined macro `major',
  you should #undef it after including <sys/types.h>.
  [-Werror=deprecated-declarations]
     if (virAsprintf(&ret, "%d:%d ", major(sb.st_rdev), minor(sb.st_rdev)) < 0)
     ^~
In file included from /usr/include/features.h:397:0,
                 from /usr/include/bits/libc-header-start.h:33,
                 from /usr/include/stdio.h:28,
                 from ../gnulib/lib/stdio.h:43,
                 from util/vircgroup.c:26:
/usr/include/sys/sysmacros.h:87:1: note: declared here
 __SYSMACROS_DEFINE_MAJOR (__SYSMACROS_FST_IMPL_TEMPL)
 ^

Moreover, in the glibc commit, there's suggestion to keep
ordering of including of header files as implemented here.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/conf/domain_audit.c
src/lxc/lxc_controller.c
src/lxc/lxc_driver.c
src/util/vircgroup.c
src/util/virutil.c