From 59ebb29e6a597586338c610b22927e5bd8a7628c Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Mon, 31 Jul 2017 15:16:45 +1000 Subject: [PATCH] ctdb-common: Rename pidfile_create() -> pidfile_context_create() Signed-off-by: Martin Schwenke Reviewed-by: Volker Lendecke --- ctdb/common/pidfile.c | 4 ++-- ctdb/common/pidfile.h | 4 ++-- ctdb/common/sock_daemon.c | 2 +- ctdb/server/ctdb_daemon.c | 4 ++-- ctdb/tests/src/pidfile_test.c | 14 +++++++------- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/ctdb/common/pidfile.c b/ctdb/common/pidfile.c index 51c0c25c92e..03fe60130e1 100644 --- a/ctdb/common/pidfile.c +++ b/ctdb/common/pidfile.c @@ -34,8 +34,8 @@ struct pidfile_context { static int pidfile_context_destructor(struct pidfile_context *pid_ctx); -int pidfile_create(TALLOC_CTX *mem_ctx, const char *pidfile, - struct pidfile_context **result) +int pidfile_context_create(TALLOC_CTX *mem_ctx, const char *pidfile, + struct pidfile_context **result) { struct pidfile_context *pid_ctx; struct flock lck; diff --git a/ctdb/common/pidfile.h b/ctdb/common/pidfile.h index 145013497b9..bc4e3a7339f 100644 --- a/ctdb/common/pidfile.h +++ b/ctdb/common/pidfile.h @@ -45,7 +45,7 @@ struct pidfile_context; * * Freeing the pidfile_context, will delete the pidfile. */ -int pidfile_create(TALLOC_CTX *mem_ctx, const char *pidfile, - struct pidfile_context **result); +int pidfile_context_create(TALLOC_CTX *mem_ctx, const char *pidfile, + struct pidfile_context **result); #endif /* __CTDB_PIDFILE_H__ */ diff --git a/ctdb/common/sock_daemon.c b/ctdb/common/sock_daemon.c index b53b4d85333..a6d430119a9 100644 --- a/ctdb/common/sock_daemon.c +++ b/ctdb/common/sock_daemon.c @@ -477,7 +477,7 @@ int sock_daemon_setup(TALLOC_CTX *mem_ctx, const char *daemon_name, } if (pidfile != NULL) { - ret = pidfile_create(sockd, pidfile, &sockd->pid_ctx); + ret = pidfile_context_create(sockd, pidfile, &sockd->pid_ctx); if (ret != 0) { talloc_free(sockd); return EEXIST; diff --git a/ctdb/server/ctdb_daemon.c b/ctdb/server/ctdb_daemon.c index b5cee615e91..1030406d7bb 100644 --- a/ctdb/server/ctdb_daemon.c +++ b/ctdb/server/ctdb_daemon.c @@ -1158,8 +1158,8 @@ static void ctdb_remove_pidfile(void) static void ctdb_create_pidfile(TALLOC_CTX *mem_ctx) { if (ctdbd_pidfile != NULL) { - int ret = pidfile_create(mem_ctx, ctdbd_pidfile, - &ctdbd_pidfile_ctx); + int ret = pidfile_context_create(mem_ctx, ctdbd_pidfile, + &ctdbd_pidfile_ctx); if (ret != 0) { DEBUG(DEBUG_ERR, ("Failed to create PID file %s\n", diff --git a/ctdb/tests/src/pidfile_test.c b/ctdb/tests/src/pidfile_test.c index 00b64cac65f..592fc2b934a 100644 --- a/ctdb/tests/src/pidfile_test.c +++ b/ctdb/tests/src/pidfile_test.c @@ -34,7 +34,7 @@ static void test1(const char *pidfile) FILE *fp; pid_t pid; - ret = pidfile_create(NULL, pidfile, &pid_ctx); + ret = pidfile_context_create(NULL, pidfile, &pid_ctx); assert(ret == 0); assert(pid_ctx != NULL); @@ -77,7 +77,7 @@ static void test2(const char *pidfile) close(fd[0]); - ret = pidfile_create(NULL, pidfile, &pid_ctx); + ret = pidfile_context_create(NULL, pidfile, &pid_ctx); assert(ret == 0); assert(pid_ctx != NULL); @@ -107,14 +107,14 @@ static void test2(const char *pidfile) assert(pid == pid2); fclose(fp); - ret = pidfile_create(NULL, pidfile, &pid_ctx); + ret = pidfile_context_create(NULL, pidfile, &pid_ctx); assert(ret != 0); nread = read(fd[0], &ret, sizeof(ret)); assert(nread == sizeof(ret)); assert(ret == 0); - ret = pidfile_create(NULL, pidfile, &pid_ctx); + ret = pidfile_context_create(NULL, pidfile, &pid_ctx); assert(ret == 0); assert(pid_ctx != NULL); @@ -134,7 +134,7 @@ static void test3(const char *pidfile) size_t nread; struct stat st; - ret = pidfile_create(NULL, pidfile, &pid_ctx); + ret = pidfile_context_create(NULL, pidfile, &pid_ctx); assert(ret == 0); assert(pid_ctx != NULL); @@ -192,7 +192,7 @@ static void test4(const char *pidfile) close(fd[0]); - ret = pidfile_create(NULL, pidfile, &pid_ctx); + ret = pidfile_context_create(NULL, pidfile, &pid_ctx); nwritten = write(fd[1], &ret, sizeof(ret)); assert(nwritten == sizeof(ret)); @@ -216,7 +216,7 @@ static void test4(const char *pidfile) pid2 = waitpid(pid, &ret, 0); assert(pid2 == pid); - ret = pidfile_create(NULL, pidfile, &pid_ctx); + ret = pidfile_context_create(NULL, pidfile, &pid_ctx); assert(ret == 0); assert(pid_ctx != NULL);