| Index: fusl/src/dirent/fdopendir.c
|
| diff --git a/fusl/src/dirent/fdopendir.c b/fusl/src/dirent/fdopendir.c
|
| index c377271da53919acb39f5929ded9d77f874f7e55..8cdbc7a40e848daebc1b250f4d77c0c89277281f 100644
|
| --- a/fusl/src/dirent/fdopendir.c
|
| +++ b/fusl/src/dirent/fdopendir.c
|
| @@ -5,23 +5,22 @@
|
| #include <stdlib.h>
|
| #include "__dirent.h"
|
|
|
| -DIR *fdopendir(int fd)
|
| -{
|
| - DIR *dir;
|
| - struct stat st;
|
| +DIR* fdopendir(int fd) {
|
| + DIR* dir;
|
| + struct stat st;
|
|
|
| - if (fstat(fd, &st) < 0) {
|
| - return 0;
|
| - }
|
| - if (!S_ISDIR(st.st_mode)) {
|
| - errno = ENOTDIR;
|
| - return 0;
|
| - }
|
| - if (!(dir = calloc(1, sizeof *dir))) {
|
| - return 0;
|
| - }
|
| + if (fstat(fd, &st) < 0) {
|
| + return 0;
|
| + }
|
| + if (!S_ISDIR(st.st_mode)) {
|
| + errno = ENOTDIR;
|
| + return 0;
|
| + }
|
| + if (!(dir = calloc(1, sizeof *dir))) {
|
| + return 0;
|
| + }
|
|
|
| - fcntl(fd, F_SETFD, FD_CLOEXEC);
|
| - dir->fd = fd;
|
| - return dir;
|
| + fcntl(fd, F_SETFD, FD_CLOEXEC);
|
| + dir->fd = fd;
|
| + return dir;
|
| }
|
|
|