aboutsummaryrefslogtreecommitdiff
path: root/src/librc
diff options
context:
space:
mode:
Diffstat (limited to 'src/librc')
-rw-r--r--src/librc/librc-depend.c1
-rw-r--r--src/librc/librc.c4
2 files changed, 4 insertions, 1 deletions
diff --git a/src/librc/librc-depend.c b/src/librc/librc-depend.c
index 902d012f..0ce95e60 100644
--- a/src/librc/librc-depend.c
+++ b/src/librc/librc-depend.c
@@ -283,6 +283,7 @@ static char **get_provided (const rc_depinfo_t *deptree,
if (! deptree || ! depinfo)
return (NULL);
+
if (rc_service_exists (depinfo->service))
return (NULL);
diff --git a/src/librc/librc.c b/src/librc/librc.c
index 15309f87..dbabdc03 100644
--- a/src/librc/librc.c
+++ b/src/librc/librc.c
@@ -289,7 +289,9 @@ bool rc_service_exists (const char *service)
service[len - 1] == 'h')
return (false);
- file = rc_service_resolve (service);
+ if (! (file = rc_service_resolve (service)))
+ return (false);
+
if (stat (file, &buf) == 0 && buf.st_mode & S_IXUGO)
retval = true;
free (file);