1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

ctdb-common: Rename pidfile_create() -> pidfile_context_create()

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
This commit is contained in:
Martin Schwenke 2017-07-31 15:16:45 +10:00 committed by Martin Schwenke
parent 4dbfc16bdd
commit 59ebb29e6a
5 changed files with 14 additions and 14 deletions

View File

@ -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;

View File

@ -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__ */

View File

@ -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;

View File

@ -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",

View File

@ -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);