xfsprogs/xfsprogs-c99.patch

105 lines
2.9 KiB
Diff

Patch posted upstream: https://marc.info/?l=linux-xfs&m=167584946813673
From: Arjun Shankar <arjun@redhat.com>
Date: Wed, 8 Feb 2023 10:35:05 +0100
Subject: [PATCH] Remove several implicit function declarations
During configure, several ioctl checks omit the correspondig include
and a pwritev2 check uses the wrong feature test macro. Also,
scrub/unicrash.c omits the appropriate include for u_init/u_cleanup.
All of the above lead to implicit function declarations at build time.
This commit fixes the same.
Signed-off-by: Arjun Shankar <arjun@redhat.com>
diff --git a/configure b/configure
index cee6a7f8f844cbb7..0de77850b9cff273 100755
--- a/configure
+++ b/configure
@@ -14839,6 +14839,7 @@ $as_echo_n "checking for fiemap... " >&6; }
#define _GNU_SOURCE
#include <linux/fs.h>
#include <linux/fiemap.h>
+#include <sys/ioctl.h>
int
main ()
@@ -14869,7 +14870,7 @@ $as_echo_n "checking for pwritev2... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#define _BSD_SOURCE
+#define _GNU_SOURCE
#include <sys/uio.h>
int
@@ -15619,6 +15620,7 @@ $as_echo_n "checking for struct sg_io_hdr ... " >&6; }
/* end confdefs.h. */
#include <scsi/sg.h>
+#include <sys/ioctl.h>
int
main ()
@@ -15648,7 +15650,8 @@ $as_echo_n "checking for struct hd_geometry ... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <linux/hdreg.h>,
+#include <linux/hdreg.h>
+#include <sys/ioctl.h>
int
main ()
diff --git a/m4/package_libcdev.m4 b/m4/package_libcdev.m4
index bb1ab49c11e49cd0..f987aa4ab7b5b8de 100644
--- a/m4/package_libcdev.m4
+++ b/m4/package_libcdev.m4
@@ -117,6 +117,7 @@ AC_DEFUN([AC_HAVE_FIEMAP],
#define _GNU_SOURCE
#include <linux/fs.h>
#include <linux/fiemap.h>
+#include <sys/ioctl.h>
]], [[
struct fiemap *fiemap;
ioctl(0, FS_IOC_FIEMAP, (unsigned long)fiemap);
@@ -153,7 +154,7 @@ AC_DEFUN([AC_HAVE_PWRITEV2],
[ AC_MSG_CHECKING([for pwritev2])
AC_LINK_IFELSE(
[ AC_LANG_PROGRAM([[
-#define _BSD_SOURCE
+#define _GNU_SOURCE
#include <sys/uio.h>
]], [[
pwritev2(0, 0, 0, 0, 0);
@@ -454,6 +455,7 @@ AC_DEFUN([AC_HAVE_SG_IO],
AC_COMPILE_IFELSE(
[ AC_LANG_PROGRAM([[
#include <scsi/sg.h>
+#include <sys/ioctl.h>
]], [[
struct sg_io_hdr hdr;
ioctl(0, SG_IO, &hdr);
@@ -471,7 +473,8 @@ AC_DEFUN([AC_HAVE_HDIO_GETGEO],
[ AC_MSG_CHECKING([for struct hd_geometry ])
AC_COMPILE_IFELSE(
[ AC_LANG_PROGRAM([[
-#include <linux/hdreg.h>,
+#include <linux/hdreg.h>
+#include <sys/ioctl.h>
]], [[
struct hd_geometry hdr;
ioctl(0, HDIO_GETGEO, &hdr);
diff --git a/scrub/unicrash.c b/scrub/unicrash.c
index cb0880c1040a73ae..3be0718afa883a19 100644
--- a/scrub/unicrash.c
+++ b/scrub/unicrash.c
@@ -13,6 +13,7 @@
#include <unicode/ustring.h>
#include <unicode/unorm2.h>
#include <unicode/uspoof.h>
+#include <unicode/uclean.h>
#include "libfrog/paths.h"
#include "xfs_scrub.h"
#include "common.h"