about summary refs log tree commit diff
path: root/src/ldso/dynlink.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2012-09-29 17:59:50 -0400
committerRich Felker <dalias@aerifal.cx>2012-09-29 17:59:50 -0400
commitf2d08cf7558176af7ef36cf5b5213e676b02d7ac (patch)
treedc3d0d1d9d1a29864c1278828bb0e16b7482d708 /src/ldso/dynlink.c
parent3609e019f352912e882b91b7a856c7b30569f2de (diff)
downloadmusl-f2d08cf7558176af7ef36cf5b5213e676b02d7ac.tar.gz
musl-f2d08cf7558176af7ef36cf5b5213e676b02d7ac.tar.xz
musl-f2d08cf7558176af7ef36cf5b5213e676b02d7ac.zip
fix some more O_CLOEXEC/SOCK_CLOEXEC issues
Diffstat (limited to 'src/ldso/dynlink.c')
-rw-r--r--src/ldso/dynlink.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ldso/dynlink.c b/src/ldso/dynlink.c
index 1c181339..d0b57e8d 100644
--- a/src/ldso/dynlink.c
+++ b/src/ldso/dynlink.c
@@ -376,7 +376,7 @@ static int path_open(const char *name, const char *search, char *buf, size_t buf
 		z = strchr(s, ':');
 		l = z ? z-s : strlen(s);
 		snprintf(buf, buf_size, "%.*s/%s", l, s, name);
-		if ((fd = open(buf, O_RDONLY))>=0) return fd;
+		if ((fd = open(buf, O_RDONLY|O_CLOEXEC))>=0) return fd;
 		s += l;
 	}
 }
@@ -423,7 +423,7 @@ static struct dso *load_library(const char *name)
 	}
 	if (strchr(name, '/')) {
 		pathname = name;
-		fd = open(name, O_RDONLY);
+		fd = open(name, O_RDONLY|O_CLOEXEC);
 	} else {
 		/* Search for the name to see if it's already loaded */
 		for (p=head->next; p; p=p->next) {