[PATCH 2/2] memkind: configure.ac fix obsolete macro usage warnings
by Rafael Aquini
This patch adjusts memkind's configure.ac file to get rid of the following
warnings when autotools are executed with '-Wobsolete' flag
-- >8 --
$ ./autogen.sh
~/rpmbuild/BUILD/memkind-a0dfc8ad94960babcdaf99063164f9b64b1092e4/jemalloc ~/rpmbuild/BUILD/memkind-a0dfc8ad94960babcdaf99063164f9b64b1092e4
~/rpmbuild/BUILD/memkind-a0dfc8ad94960babcdaf99063164f9b64b1092e4
configure.ac:140: warning: The macro `AC_PROG_LIBTOOL' is obsolete.
configure.ac:140: You should run autoupdate.
m4/libtool.m4:107: AC_PROG_LIBTOOL is expanded from...
configure.ac:140: the top level
configure.ac:178: warning: AC_OUTPUT should be used without arguments.
configure.ac:178: You should run autoupdate.
libtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: putting macros in `m4'.
libtoolize: copying file `m4/libtool.m4'
libtoolize: copying file `m4/ltoptions.m4'
libtoolize: copying file `m4/ltsugar.m4'
libtoolize: copying file `m4/ltversion.m4'
libtoolize: copying file `m4/lt~obsolete.m4'
libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.ac and
libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.
libtoolize: `AC_PROG_RANLIB' is rendered obsolete by `LT_INIT'
configure.ac:140: warning: The macro `AC_PROG_LIBTOOL' is obsolete.
configure.ac:140: You should run autoupdate.
m4/libtool.m4:107: AC_PROG_LIBTOOL is expanded from...
configure.ac:140: the top level
configure.ac:178: warning: AC_OUTPUT should be used without arguments.
configure.ac:178: You should run autoupdate.
-- 8< --
Signed-off-by: Rafael Aquini <aquini(a)redhat.com>
---
configure.ac | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/configure.ac b/configure.ac
index 465eba9..24c7840 100644
--- a/configure.ac
+++ b/configure.ac
@@ -30,6 +30,7 @@ AC_INIT([memkind],m4_esyscmd([tr -d '\n' < VERSION]),[christopher.m.cantalupo@in
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects tar-pax])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_HEADERS([config_tls.h])
+AC_CONFIG_MACRO_DIR([m4])
memkind_abi_version=0:1:0
AC_SUBST(memkind_abi_version)
@@ -137,8 +138,7 @@ AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
-AC_PROG_LIBTOOL
-AC_PROG_RANLIB
+LT_INIT
AM_PROG_CC_C_O
# Checks for libraries.
@@ -175,7 +175,8 @@ AC_FUNC_MMAP
AC_FUNC_REALLOC
AC_CHECK_FUNCS([gettimeofday memset mkdir munmap setenv strtol strtoul])
-AC_OUTPUT(Makefile)
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
# ============================================================================
# Print out the results of configuration.
--
2.1.0
7 years, 1 month
[PATCH] memkind-pmtt: stop nuking sysconfdir and contents
by Rafael Aquini
memkind-pmtt tool should not be nuking the sysconfdir -- /etc/memkind --
in order to not overlap content ownership with package managers such RPM
as well as to avoid crazy havocs of racy file and dir unlinks with concurrent
usage from the libs or other parses via parallel memkind-pmtt invocations.
This patch removes the sysconfdir nuking points for the memkind-pmtt tool and
its sysv init script as well as it delegates the 'MEMKIND_FILE' file deletion
control only to the sysv init script for procedural consistency.
Signed-off-by: Rafael Aquini <aquini(a)redhat.com>
---
init.d/memkind | 8 --------
src/memkind_pmtt.c | 7 -------
2 files changed, 15 deletions(-)
diff --git a/init.d/memkind b/init.d/memkind
index 1be0954..2ba6745 100755
--- a/init.d/memkind
+++ b/init.d/memkind
@@ -90,14 +90,6 @@ stop() {
if [ $err -eq 0 ] && [ ! -f $MEMKIND_FILE ]
then
echo_success "deleted file: $MEMKIND_FILE"
- rmdir $MEMKIND_DIR
- err=$?
- if [ $err -eq 0 ] && [ ! -d $MEMKIND_DIR ]
- then
- echo_success "deleted directory: $MEMKIND_DIR"
- else
- echo_failure "could not delete directory: $MEMKIND_DIR"
- fi
else
echo_failure "could not delete file: $MEMKIND_FILE"
fi
diff --git a/src/memkind_pmtt.c b/src/memkind_pmtt.c
index ebabafd..9d9296c 100644
--- a/src/memkind_pmtt.c
+++ b/src/memkind_pmtt.c
@@ -220,7 +220,6 @@ int memkind_pmtt(char *pmtt_path, char *bandwidth_path)
err = errno ? -errno : 1;
goto exit;
}
- unlink(bandwidth_path);
fd = open(bandwidth_path, O_CREAT | O_EXCL | O_WRONLY, 0644);
if (fd == -1) {
fprintf(stderr, "ERROR: <memkind_pmtt> opening %s for writing\n", bandwidth_path);
@@ -252,12 +251,6 @@ exit:
if (bandwidth != NULL) {
free(bandwidth);
}
- if (err) {
- unlink(bandwidth_path);
- if(*dir) {
- rmdir(dir);
- }
- }
return err;
}
--
2.1.0
7 years, 1 month