The statx.c test program uses a bunch of GNU-specific xstr*
functions that have very little, if any, benefit to the code.
They allocate copies of static format strings, but those
strings are not modified, and are never freed. Since the
use of xstr* drags in libiberty and associated build issues
on a variety of platforms, instead avoid those functions.
Remove the use of this library completely from the statx.c
test tool, with minimal replacements to keep the build happy.
Remove the corresponding configure checks.
Fixes:
3f7853b31ef6 ("LU-10934 llite: integrate statx() API with Lustre")
Test-Parameters: trivial testlist=sanityn env=ONLY=106 clientdistro=ubuntu2004
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I2c11bac8e2a4b4754ee78caabfa9cbdba98bffff
Reviewed-on: https://review.whamcloud.com/40802
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Yingjin Qian <qian@ddn.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
AM_CONDITIONAL([SUSE], [test -f /etc/SUSE-brand -o -f /etc/SuSE-release])
AM_CONDITIONAL([UBUNTU], [test x$UBUNTU_KERNEL = xyes])
AM_CONDITIONAL([BUILD_LUTF], [test x$enable_lutf = xyes])
-AM_CONDITIONAL([LIBIBERTY_SUBDIR], [test -d /usr/include/libiberty])
LN_CONDITIONALS
LC_CONDITIONALS
Maintainer: Brian J. Murrell <brian.murrell@intel.com>
Uploaders: Brian J. Murrell <brian.murrell@intel.com>
Standards-Version: 3.8.3
-Build-Depends: module-assistant, libreadline-dev, debhelper (>=9.0.0), dpatch, automake (>=1.7) | automake1.7 | automake1.8 | automake1.9, pkg-config, libtool, libyaml-dev, libselinux-dev, libsnmp-dev, mpi-default-dev, bzip2, quilt, linux-headers-generic | linux-headers | linux-headers-amd64, rsync, libssl-dev, libiberty-dev
+Build-Depends: module-assistant, libreadline-dev, debhelper (>=9.0.0), dpatch, automake (>=1.7) | automake1.7 | automake1.8 | automake1.9, pkg-config, libtool, libyaml-dev, libselinux-dev, libsnmp-dev, mpi-default-dev, bzip2, quilt, linux-headers-generic | linux-headers | linux-headers-amd64, rsync, libssl-dev
Homepage: https://wiki.whamcloud.com/
Vcs-Git: git://git.whamcloud.com/fs/lustre-release.git
Maintainer: Brian J. Murrell <brian.murrell@intel.com>
Uploaders: Brian J. Murrell <brian.murrell@intel.com>
Standards-Version: 3.8.3
-Build-Depends: module-assistant, libreadline-dev, debhelper (>=9.0.0), dpatch, automake (>=1.7) | automake1.7 | automake1.8 | automake1.9, pkg-config, libtool, libyaml-dev, libselinux-dev, libsnmp-dev, mpi-default-dev, bzip2, quilt, linux-headers-generic | linux-headers | linux-headers-amd64, rsync, libssl-dev, libiberty-dev
+Build-Depends: module-assistant, libreadline-dev, debhelper (>=9.0.0), dpatch, automake (>=1.7) | automake1.7 | automake1.8 | automake1.9, pkg-config, libtool, libyaml-dev, libselinux-dev, libsnmp-dev, mpi-default-dev, bzip2, quilt, linux-headers-generic | linux-headers | linux-headers-amd64, rsync, libssl-dev
Homepage: https://wiki.whamcloud.com/
Vcs-Git: git://git.whamcloud.com/fs/lustre-release.git
if LIBAIO
aiocp_LDADD= -laio
endif
-if LIBIBERTY_SUBDIR
-statx_CPPFLAGS := -I/usr/include/libiberty
-endif
-statx_LDADD = $(SELINUX) -liberty
+statx_LDADD = $(SELINUX)
endif # TESTS
#include <inttypes.h>
#include <fcntl.h>
#include <locale.h>
-#include <libiberty.h>
#include <linux/lustre/lustre_user.h>
#ifdef HAVE_SELINUX
}
#endif /* HAVE_STATX */
+#define xstrdup(str) strdup(str)
+static inline
+char *xasprintf(const char *fmt, const char *old_fmt, const char *str)
+{
+ char *tmp = NULL;
+
+ if (asprintf(&tmp, fmt, old_fmt, str) < 0) {
+ fprintf(stderr, "asprintf allocation failed\n");
+ exit(1);
+ }
+
+ return tmp;
+}
+
+
/* coreutils/lib/intprops.h */
#define _GL_SIGNED_TYPE_OR_EXPR(t) TYPE_SIGNED(__typeof__(t))