diff options
author | comex | 2015-07-11 14:52:03 -0400 |
---|---|---|
committer | comex | 2015-07-11 14:52:03 -0400 |
commit | 324d1437fbe6a9daf11137b00f9b1efd9df7399f (patch) | |
tree | e3b2cf9228a4f66b183b0572c08780b96edb8ede /darwin-bootstrap/posixspawn-hook.c | |
parent | better fix (diff) | |
download | substitute-324d1437fbe6a9daf11137b00f9b1efd9df7399f.tar.gz |
be safe in case the dylibs are missing
Diffstat (limited to 'darwin-bootstrap/posixspawn-hook.c')
-rw-r--r-- | darwin-bootstrap/posixspawn-hook.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/darwin-bootstrap/posixspawn-hook.c b/darwin-bootstrap/posixspawn-hook.c index 03d063c..4920d0a 100644 --- a/darwin-bootstrap/posixspawn-hook.c +++ b/darwin-bootstrap/posixspawn-hook.c @@ -224,6 +224,13 @@ static int hook_posix_spawn_generic(__typeof__(posix_spawn) *old, dylib_to_add = bl_dylib; } + if (access(dylib_to_add, R_OK)) { + /* Substitute must have been uninstalled or something. In the future + * we'll be able to actually unload from launchd, but this is still + * useful as a safety measure. */ + goto skip; + } + if (attrp) { posix_spawnattr_t attr = *attrp; size_t size = malloc_size(attr); |