aboutsummaryrefslogtreecommitdiff
path: root/src/librc-daemon.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-10-08 11:16:22 +0000
committerRoy Marples <roy@marples.name>2007-10-08 11:16:22 +0000
commitcd4bce7e8da691b8be0a88292eee13852b826b7e (patch)
tree26ab1fb49a790b8855b0dc60781551896c065931 /src/librc-daemon.c
parenta89ceb7e2c994e2a3907d9c906d99021a6e15788 (diff)
Wups, should be xstrdup
Diffstat (limited to 'src/librc-daemon.c')
-rw-r--r--src/librc-daemon.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/librc-daemon.c b/src/librc-daemon.c
index ca1a39ef..112f4c9c 100644
--- a/src/librc-daemon.c
+++ b/src/librc-daemon.c
@@ -304,7 +304,7 @@ bool rc_service_daemon_set (const char *service, const char *exec,
errno = EINVAL;
return (false);
}
- svc = strdup (service);
+ svc = xstrdup (service);
dirpath = rc_strcatpaths (RC_SVCDIR, "daemons",
basename (svc), (char *) NULL);
free (svc);
@@ -314,21 +314,21 @@ bool rc_service_daemon_set (const char *service, const char *exec,
mexec = xmalloc (sizeof (char *) * i);
snprintf (mexec, i, "exec=%s", exec);
} else
- mexec = strdup ("exec=");
+ mexec = xstrdup ("exec=");
if (name) {
i = strlen (name) + 6;
mname = xmalloc (sizeof (char *) * i);
snprintf (mname, i, "name=%s", name);
} else
- mname = strdup ("name=");
+ mname = xstrdup ("name=");
if (pidfile) {
i = strlen (pidfile) + 9;
mpidfile = xmalloc (sizeof (char *) * i);
snprintf (mpidfile, i, "pidfile=%s", pidfile);
} else
- mpidfile = strdup ("pidfile=");
+ mpidfile = xstrdup ("pidfile=");
/* Regardless, erase any existing daemon info */
if ((dp = opendir (dirpath))) {
@@ -398,7 +398,7 @@ bool rc_service_started_daemon (const char *service, const char *exec,
if (! service || ! exec)
return (false);
- svc = strdup (service);
+ svc = xstrdup (service);
dirpath = rc_strcatpaths (RC_SVCDIR, "daemons", basename (svc),
(char *) NULL);
free (svc);
@@ -453,7 +453,7 @@ bool rc_service_daemons_crashed (const char *service)
if (! service)
return (false);
- svc = strdup (service);
+ svc = xstrdup (service);
dirpath = rc_strcatpaths (RC_SVCDIR, "daemons", basename (svc),
(char *) NULL);
free (svc);
@@ -488,15 +488,15 @@ bool rc_service_daemons_crashed (const char *service)
if (strcmp (token, "exec") == 0) {
if (exec)
free (exec);
- exec = strdup (p);
+ exec = xstrdup (p);
} else if (strcmp (token, "name") == 0) {
if (name)
free (name);
- name = strdup (p);
+ name = xstrdup (p);
} else if (strcmp (token, "pidfile") == 0) {
if (pidfile)
free (pidfile);
- pidfile = strdup (p);
+ pidfile = xstrdup (p);
}
}
fclose (fp);