summaryrefslogtreecommitdiff
path: root/src/librc-depend.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-10-04 16:54:29 +0000
committerRoy Marples <roy@marples.name>2007-10-04 16:54:29 +0000
commit87ea3e9e3bfa8e96b31d682f29fc7959bdd1b39e (patch)
tree78680e84573e0ef6d81ff46fa33c968d8f43f6da /src/librc-depend.c
parente2e40afddef5253d5d669002b9afbea6bf3d6c66 (diff)
downloadopenrc-87ea3e9e3bfa8e96b31d682f29fc7959bdd1b39e.tar.gz
openrc-87ea3e9e3bfa8e96b31d682f29fc7959bdd1b39e.tar.bz2
openrc-87ea3e9e3bfa8e96b31d682f29fc7959bdd1b39e.tar.xz
Punt rc_is_dir
Diffstat (limited to 'src/librc-depend.c')
-rw-r--r--src/librc-depend.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/src/librc-depend.c b/src/librc-depend.c
index 150edb1..c701c21 100644
--- a/src/librc-depend.c
+++ b/src/librc-depend.c
@@ -547,6 +547,10 @@ static bool is_newer_than (const char *file, const char *target)
{
struct stat buf;
time_t mtime;
+ char **targets;
+ char *t;
+ int i;
+ bool newer = true;
if (stat (file, &buf) != 0 || buf.st_size == 0)
return (false);
@@ -560,25 +564,17 @@ static bool is_newer_than (const char *file, const char *target)
if (mtime < buf.st_mtime)
return (false);
- if (rc_is_dir (target))
+ targets = rc_ls_dir (target, 0);
+ STRLIST_FOREACH (targets, t, i)
{
- char **targets = rc_ls_dir (target, 0);
- char *t;
- int i;
- bool newer = true;
- STRLIST_FOREACH (targets, t, i)
- {
- char *path = rc_strcatpaths (target, t, (char *) NULL);
- newer = is_newer_than (file, path);
- free (path);
- if (! newer)
- break;
- }
- rc_strlist_free (targets);
- return (newer);
+ char *path = rc_strcatpaths (target, t, (char *) NULL);
+ newer = is_newer_than (file, path);
+ free (path);
+ if (! newer)
+ break;
}
-
- return (true);
+ rc_strlist_free (targets);
+ return (newer);
}
typedef struct deppair