fix some more O_CLOEXEC/SOCK_CLOEXEC issues

This commit is contained in:
Rich Felker
2012-09-29 17:59:50 -04:00
parent 3609e019f3
commit f2d08cf755
4 changed files with 5 additions and 7 deletions
+2 -2
View File
@@ -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) {