aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-01-06 21:06:47 +0000
committerRoy Marples <roy@marples.name>2008-01-06 21:06:47 +0000
commit16a2c82bd194a41cab45021799b4251cf926a051 (patch)
treecbf636599b999cddf4fd60011e9338eda70230c8
parentb1540cba5b88a1ef625b66990af66fbb6aa15e62 (diff)
We should check we resolved a service before stating it's existance.
-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);