X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fmisc%2Frealpath.c;h=183351462519b99912265da7a87a11489dd8f1b9;hb=31a55f233b313030a787240b76c06f2d08cde29f;hp=ef156fcf8aaf1cb808e4a3760a46df3855676ce8;hpb=d43ff110bcb258df61448d21da3b1a89088388f6;p=musl diff --git a/src/misc/realpath.c b/src/misc/realpath.c index ef156fcf..18335146 100644 --- a/src/misc/realpath.c +++ b/src/misc/realpath.c @@ -6,7 +6,7 @@ #include #include -char *realpath(const char *filename, char *resolved) +char *realpath(const char *restrict filename, char *restrict resolved) { int fd; ssize_t r; @@ -19,7 +19,7 @@ char *realpath(const char *filename, char *resolved) return 0; } - fd = open(filename, O_RDONLY|O_NONBLOCK); + fd = open(filename, O_RDONLY|O_NONBLOCK|O_CLOEXEC); if (fd < 0) return 0; snprintf(buf, sizeof buf, "/proc/self/fd/%d", fd);