void-packages/srcpkgs/quota/patches/reallocarray.patch

30 lines
789 B
Diff

Index: configure.ac
===================================================================
--- configure.ac.orig
+++ configure.ac
@@ -38,6 +38,9 @@ AC_C_INLINE
AC_CHECK_FUNC([nl_langinfo], [
AC_DEFINE([HAVE_NL_LANGINFO], 1, [Use nl_langinfo for querying locale])
])
+AC_CHECK_DECLS([reallocarray],[
+ AC_DEFINE([HAVE_REALLOCARRAY], 1, [Have reallocarray])
+])
# ===============
# Gettext support
Index: quota.c
===================================================================
--- quota.c.orig
+++ quota.c
@@ -48,6 +48,10 @@
#define FL_SHOW_DEVICE 32768
#define FL_PROJECT 65536
+#ifndef HAVE_REALLOCARRAY
+#define reallocarray(o,n,s) realloc(o,n*s)
+#endif
+
static int flags, fmt = -1;
static enum s2s_unit spaceunit = S2S_NONE, inodeunit = S2S_NONE;
char *progname;