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

Unified Diff: fusl/src/network/accept4.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/network/accept4.c
diff --git a/fusl/src/network/accept4.c b/fusl/src/network/accept4.c
index 285d85887eff2201f71645f5448c25a9d802da99..11f627c7b902684b85554da43a6f16a7581516a7 100644
--- a/fusl/src/network/accept4.c
+++ b/fusl/src/network/accept4.c
@@ -5,16 +5,21 @@
#include "syscall.h"
#include "libc.h"
-int accept4(int fd, struct sockaddr *restrict addr, socklen_t *restrict len, int flg)
-{
- if (!flg) return accept(fd, addr, len);
- int ret = socketcall_cp(accept4, fd, addr, len, flg, 0, 0);
- if (ret>=0 || (errno != ENOSYS && errno != EINVAL)) return ret;
- ret = accept(fd, addr, len);
- if (ret<0) return ret;
- if (flg & SOCK_CLOEXEC)
- __syscall(SYS_fcntl, ret, F_SETFD, FD_CLOEXEC);
- if (flg & SOCK_NONBLOCK)
- __syscall(SYS_fcntl, ret, F_SETFL, O_NONBLOCK);
- return ret;
+int accept4(int fd,
+ struct sockaddr* restrict addr,
+ socklen_t* restrict len,
+ int flg) {
+ if (!flg)
+ return accept(fd, addr, len);
+ int ret = socketcall_cp(accept4, fd, addr, len, flg, 0, 0);
+ if (ret >= 0 || (errno != ENOSYS && errno != EINVAL))
+ return ret;
+ ret = accept(fd, addr, len);
+ if (ret < 0)
+ return ret;
+ if (flg & SOCK_CLOEXEC)
+ __syscall(SYS_fcntl, ret, F_SETFD, FD_CLOEXEC);
+ if (flg & SOCK_NONBLOCK)
+ __syscall(SYS_fcntl, ret, F_SETFL, O_NONBLOCK);
+ return ret;
}

Powered by Google App Engine
This is Rietveld 408576698