Lines Matching refs:pidfile
35 static char *pidfile; variable
88 if (pidfile) in mu_daemon_create_pidfile()
89 free (pidfile); in mu_daemon_create_pidfile()
90 pidfile = strdup (filename); in mu_daemon_create_pidfile()
91 if (!pidfile) in mu_daemon_create_pidfile()
95 p = strrchr (pidfile, '/'); in mu_daemon_create_pidfile()
96 if (pidfile == p) in mu_daemon_create_pidfile()
98 free (pidfile); in mu_daemon_create_pidfile()
99 pidfile = NULL; in mu_daemon_create_pidfile()
105 rc = access_dir (pidfile, &uid); in mu_daemon_create_pidfile()
109 free (pidfile); in mu_daemon_create_pidfile()
110 pidfile = NULL; in mu_daemon_create_pidfile()
117 unlink (pidfile); in mu_daemon_create_pidfile()
120 if ((fd = open (pidfile, O_WRONLY | O_CREAT | O_TRUNC | O_EXCL, 0644)) != -1) in mu_daemon_create_pidfile()
126 free (pidfile); in mu_daemon_create_pidfile()
139 free (pidfile); in mu_daemon_create_pidfile()
140 pidfile = NULL; in mu_daemon_create_pidfile()
159 char *p = strrchr (pidfile, '/'); in mu_daemon_remove_pidfile()
160 if (pidfile == p) in mu_daemon_remove_pidfile()
167 rc = access_dir (pidfile, &uid); in mu_daemon_remove_pidfile()
171 if (unlink (pidfile) && errno != ENOENT) in mu_daemon_remove_pidfile()
179 pidfile, mu_strerror (rc)); in mu_daemon_remove_pidfile()
181 free (pidfile); in mu_daemon_remove_pidfile()
182 pidfile = NULL; in mu_daemon_remove_pidfile()