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

Side by Side Diff: fusl/src/stdio/__fopen_rb_ca.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 "stdio_impl.h" 1 #include "stdio_impl.h"
2 #include <fcntl.h> 2 #include <fcntl.h>
3 #include <string.h> 3 #include <string.h>
4 4
5 FILE *__fopen_rb_ca(const char *filename, FILE *f, unsigned char *buf, size_t le n) 5 FILE* __fopen_rb_ca(const char* filename,
6 { 6 FILE* f,
7 » memset(f, 0, sizeof *f); 7 unsigned char* buf,
8 size_t len) {
9 memset(f, 0, sizeof *f);
8 10
9 » f->fd = sys_open(filename, O_RDONLY|O_CLOEXEC); 11 f->fd = sys_open(filename, O_RDONLY | O_CLOEXEC);
10 » if (f->fd < 0) return 0; 12 if (f->fd < 0)
11 » __syscall(SYS_fcntl, f->fd, F_SETFD, FD_CLOEXEC); 13 return 0;
14 __syscall(SYS_fcntl, f->fd, F_SETFD, FD_CLOEXEC);
12 15
13 » f->flags = F_NOWR | F_PERM; 16 f->flags = F_NOWR | F_PERM;
14 » f->buf = buf + UNGET; 17 f->buf = buf + UNGET;
15 » f->buf_size = len - UNGET; 18 f->buf_size = len - UNGET;
16 » f->read = __stdio_read; 19 f->read = __stdio_read;
17 » f->seek = __stdio_seek; 20 f->seek = __stdio_seek;
18 » f->close = __stdio_close; 21 f->close = __stdio_close;
19 » f->lock = -1; 22 f->lock = -1;
20 23
21 » return f; 24 return f;
22 } 25 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698