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

Side by Side Diff: fusl/src/linux/signalfd.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 unified diff | Download patch
OLDNEW
1 #include <sys/signalfd.h> 1 #include <sys/signalfd.h>
2 #include <signal.h> 2 #include <signal.h>
3 #include <errno.h> 3 #include <errno.h>
4 #include <fcntl.h> 4 #include <fcntl.h>
5 #include "syscall.h" 5 #include "syscall.h"
6 6
7 int signalfd(int fd, const sigset_t *sigs, int flags) 7 int signalfd(int fd, const sigset_t* sigs, int flags) {
8 { 8 int ret = __syscall(SYS_signalfd4, fd, sigs, _NSIG / 8, flags);
9 » int ret = __syscall(SYS_signalfd4, fd, sigs, _NSIG/8, flags);
10 #ifdef SYS_signalfd 9 #ifdef SYS_signalfd
11 » if (ret != -ENOSYS) return __syscall_ret(ret); 10 if (ret != -ENOSYS)
12 » ret = __syscall(SYS_signalfd, fd, sigs, _NSIG/8); 11 return __syscall_ret(ret);
13 » if (ret >= 0) { 12 ret = __syscall(SYS_signalfd, fd, sigs, _NSIG / 8);
14 » » if (flags & SFD_CLOEXEC) 13 if (ret >= 0) {
15 » » » __syscall(SYS_fcntl, ret, F_SETFD, FD_CLOEXEC); 14 if (flags & SFD_CLOEXEC)
16 » » if (flags & SFD_NONBLOCK) 15 __syscall(SYS_fcntl, ret, F_SETFD, FD_CLOEXEC);
17 » » » __syscall(SYS_fcntl, ret, F_SETFL, O_NONBLOCK); 16 if (flags & SFD_NONBLOCK)
18 » } 17 __syscall(SYS_fcntl, ret, F_SETFL, O_NONBLOCK);
18 }
19 #endif 19 #endif
20 » return __syscall_ret(ret); 20 return __syscall_ret(ret);
21 } 21 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698