aboutsummaryrefslogtreecommitdiff
path: root/src/librc.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-10-04 16:21:53 +0000
committerRoy Marples <roy@marples.name>2007-10-04 16:21:53 +0000
commitd65c484f3a1b210048045613c524c29fdfcb470c (patch)
tree5363e0d68a597eb38f1fd71b57b6ec0fa2c5a4e9 /src/librc.c
parentbb9ad38de2dab93c5cdb0745b055c3346b6684c9 (diff)
punt rc_is_link
Diffstat (limited to 'src/librc.c')
-rw-r--r--src/librc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/librc.c b/src/librc.c
index 2c0cdcdf..dcbc9872 100644
--- a/src/librc.c
+++ b/src/librc.c
@@ -131,12 +131,13 @@ bool rc_runlevel_exists (const char *runlevel)
}
librc_hidden_def(rc_runlevel_exists)
- /* Resolve a service name to it's full path */
+/* Resolve a service name to it's full path */
char *rc_service_resolve (const char *service)
{
char buffer[PATH_MAX];
char *file;
int r = 0;
+ struct stat buf;
if (! service)
return (NULL);
@@ -145,10 +146,10 @@ char *rc_service_resolve (const char *service)
return (rc_xstrdup (service));
file = rc_strcatpaths (RC_SVCDIR, "started", service, (char *) NULL);
- if (! rc_is_link (file)) {
+ if (lstat (file, &buf) || ! S_ISLNK (buf.st_mode)) {
free (file);
file = rc_strcatpaths (RC_SVCDIR, "inactive", service, (char *) NULL);
- if (! rc_is_link (file)) {
+ if (lstat (file, &buf) || ! S_ISLNK (buf.st_mode)) {
free (file);
file = NULL;
}