Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(871)

Unified Diff: fusl/src/dirent/fdopendir.c

Issue 1714623002: [fusl] clang-format fusl (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: headers too Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
}

Powered by Google App Engine
This is Rietveld 408576698