Mon, Sep 14, 2015 at 02:49:06PM CEST, pwieczorkiewicz(a)suse.de wrote:
Signed-off-by: Pawel Wieczorkiewicz <pwieczorkiewicz(a)suse.de>
Signed-off-by: Sebastian Krahmer <krahmer(a)suse.com>
---
configure.ac | 8 ++++++++
teamd/teamd.c | 8 ++++----
teamd/teamd.h | 2 ++
teamd/teamd_usock.c | 4 ----
4 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/configure.ac b/configure.ac
index 1115e95..302a11a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -101,6 +101,14 @@ AC_ARG_ENABLE([zmq],
fi
fi
+AC_ARG_WITH([run-dir],
+ [AS_HELP_STRING([--with-run-dir@<:@=DIR@:>@], [Teamd run time directory
@<:@default=${localstatedir}@:>@])],
+ [case "$withval" in
+ yes|no|"") ;;
+ *) AC_DEFINE_UNQUOTED(TEAMD_RUN_DIR, "${withval}/", [TEAMD RUN DIR.]) ;;
+ esac]
+)
+
AC_CHECK_PROGS([DOXYGEN], [doxygen])
if test -z "$DOXYGEN";
then AC_MSG_WARN([Doxygen not found - continuing without Doxygen support])
diff --git a/teamd/teamd.c b/teamd/teamd.c
index 764e4f6..cdf1fc3 100644
--- a/teamd/teamd.c
+++ b/teamd/teamd.c
@@ -1621,10 +1621,6 @@ static int teamd_set_default_pid_file(struct teamd_context *ctx)
if (ctx->pid_file)
return 0;
- err = teamd_make_rundir();
- if (err)
- return err;
-
err = asprintf(&ctx->pid_file, TEAMD_RUN_DIR"%s.pid",
ctx->team_devname);
if (err == -1) {
teamd_log_err("Failed allocate memory for PID file string.");
@@ -1676,6 +1672,10 @@ int main(int argc, char **argv)
int err;
struct teamd_context *ctx;
+ err = teamd_make_rundir();
+ if (err)
+ return ret;
+
What's up with the teamd_make_rundir call move? Any comments to that at
least? I think is should be rather in a separate patch.