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

Side by Side Diff: fusl/src/stdio/__stdio_exit.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 2
3 static FILE *volatile dummy_file = 0; 3 static FILE* volatile dummy_file = 0;
4 weak_alias(dummy_file, __stdin_used); 4 weak_alias(dummy_file, __stdin_used);
5 weak_alias(dummy_file, __stdout_used); 5 weak_alias(dummy_file, __stdout_used);
6 weak_alias(dummy_file, __stderr_used); 6 weak_alias(dummy_file, __stderr_used);
7 7
8 static void close_file(FILE *f) 8 static void close_file(FILE* f) {
9 { 9 if (!f)
10 » if (!f) return; 10 return;
11 » FFINALLOCK(f); 11 FFINALLOCK(f);
12 » if (f->wpos > f->wbase) f->write(f, 0, 0); 12 if (f->wpos > f->wbase)
13 » if (f->rpos < f->rend) f->seek(f, f->rpos-f->rend, SEEK_CUR); 13 f->write(f, 0, 0);
14 if (f->rpos < f->rend)
15 f->seek(f, f->rpos - f->rend, SEEK_CUR);
14 } 16 }
15 17
16 void __stdio_exit(void) 18 void __stdio_exit(void) {
17 { 19 FILE* f;
18 » FILE *f; 20 for (f = *__ofl_lock(); f; f = f->next)
19 » for (f=*__ofl_lock(); f; f=f->next) close_file(f); 21 close_file(f);
20 » close_file(__stdin_used); 22 close_file(__stdin_used);
21 » close_file(__stdout_used); 23 close_file(__stdout_used);
22 } 24 }
23 25
24 weak_alias(__stdio_exit, __stdio_exit_needed); 26 weak_alias(__stdio_exit, __stdio_exit_needed);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698