Lines Matching refs:path
71 check_pidfile(const char *path) in check_pidfile() argument
76 printf("Validating contents of pidfile '%s'\n", path); in check_pidfile()
78 if ((file = fopen(path, "r")) == NULL) in check_pidfile()
79 errx(EXIT_FAILURE, "Cannot open expected pidfile '%s'", path); in check_pidfile()
83 path); in check_pidfile()
93 ensure_deleted(const char *path) in ensure_deleted() argument
95 printf("Ensuring pidfile %s does not exist any more\n", path); in ensure_deleted()
96 if (access(path, R_OK) != -1) { in ensure_deleted()
97 unlink(path); in ensure_deleted()
100 path); in ensure_deleted()
102 atf_tc_fail("The pidfile %s was not deleted", path); in ensure_deleted()
132 char *path; in generate_varrun_pidfile() local
134 if (asprintf(&path, "%s%s.pid", _PATH_VARRUN, in generate_varrun_pidfile()
142 return path; in generate_varrun_pidfile()
146 helper_default_path(const char *path) in helper_default_path() argument
153 check_pidfile(path); in helper_default_path()
164 char *path; in ATF_TC_BODY() local
166 path = generate_varrun_pidfile(NULL); in ATF_TC_BODY()
167 run_child(helper_default_path, path); in ATF_TC_BODY()
168 ensure_deleted(path); in ATF_TC_BODY()
169 free(path); in ATF_TC_BODY()
173 helper_custom_basename(const char *path) in helper_custom_basename() argument
180 check_pidfile(path); in helper_custom_basename()
191 char *path; in ATF_TC_BODY() local
193 path = generate_varrun_pidfile("custom-basename"); in ATF_TC_BODY()
194 run_child(helper_custom_basename, path); in ATF_TC_BODY()
195 ensure_deleted(path); in ATF_TC_BODY()
196 free(path); in ATF_TC_BODY()
200 helper_custom_path(const char *path) in helper_custom_path() argument
203 if (pidfile(path) == -1) in helper_custom_path()
204 errx(EXIT_FAILURE, "Failed to create pidfile '%s'", path); in helper_custom_path()
205 check_pidfile(path); in helper_custom_path()