More basename compliance.
This commit is contained in:
parent
2714263040
commit
6ff4a83d59
@ -284,7 +284,8 @@ void rc_set_service_daemon (const char *service, const char *exec,
|
|||||||
const char *name, const char *pidfile,
|
const char *name, const char *pidfile,
|
||||||
bool started)
|
bool started)
|
||||||
{
|
{
|
||||||
char *dirpath = rc_strcatpaths (RC_SVCDIR, "daemons", basename (service),
|
char *svc = rc_xstrdup (service);
|
||||||
|
char *dirpath = rc_strcatpaths (RC_SVCDIR, "daemons", basename (svc),
|
||||||
(char *) NULL);
|
(char *) NULL);
|
||||||
char **files = NULL;
|
char **files = NULL;
|
||||||
char *file;
|
char *file;
|
||||||
@ -295,6 +296,7 @@ void rc_set_service_daemon (const char *service, const char *exec,
|
|||||||
char *mpidfile;
|
char *mpidfile;
|
||||||
int nfiles = 0;
|
int nfiles = 0;
|
||||||
|
|
||||||
|
free (svc);
|
||||||
if (! exec && ! name && ! pidfile)
|
if (! exec && ! name && ! pidfile)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -379,12 +381,16 @@ bool rc_service_started_daemon (const char *service, const char *exec,
|
|||||||
int i;
|
int i;
|
||||||
char *mexec;
|
char *mexec;
|
||||||
bool retval = false;
|
bool retval = false;
|
||||||
|
char *svc;
|
||||||
|
|
||||||
if (! service || ! exec)
|
if (! service || ! exec)
|
||||||
return (false);
|
return (false);
|
||||||
|
|
||||||
dirpath = rc_strcatpaths (RC_SVCDIR, "daemons", basename (service),
|
svc = rc_xstrdup (service);
|
||||||
|
dirpath = rc_strcatpaths (RC_SVCDIR, "daemons", basename (svc),
|
||||||
(char *) NULL);
|
(char *) NULL);
|
||||||
|
free (svc);
|
||||||
|
|
||||||
if (! rc_is_dir (dirpath)) {
|
if (! rc_is_dir (dirpath)) {
|
||||||
free (dirpath);
|
free (dirpath);
|
||||||
return (false);
|
return (false);
|
||||||
@ -432,12 +438,16 @@ bool rc_service_daemons_crashed (const char *service)
|
|||||||
char *p;
|
char *p;
|
||||||
char *token;
|
char *token;
|
||||||
bool retval = false;
|
bool retval = false;
|
||||||
|
char *svc;
|
||||||
|
|
||||||
if (! service)
|
if (! service)
|
||||||
return (false);
|
return (false);
|
||||||
|
|
||||||
dirpath = rc_strcatpaths (RC_SVCDIR, "daemons", basename (service),
|
svc = rc_xstrdup (service);
|
||||||
|
dirpath = rc_strcatpaths (RC_SVCDIR, "daemons", basename (svc),
|
||||||
(char *) NULL);
|
(char *) NULL);
|
||||||
|
free (svc);
|
||||||
|
|
||||||
if (! rc_is_dir (dirpath)) {
|
if (! rc_is_dir (dirpath)) {
|
||||||
free (dirpath);
|
free (dirpath);
|
||||||
return (false);
|
return (false);
|
||||||
|
Loading…
Reference in New Issue
Block a user