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

Side by Side Diff: fusl/src/legacy/ulimit.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/resource.h> 1 #include <sys/resource.h>
2 #include <ulimit.h> 2 #include <ulimit.h>
3 #include <stdarg.h> 3 #include <stdarg.h>
4 4
5 long ulimit(int cmd, ...) 5 long ulimit(int cmd, ...) {
6 { 6 struct rlimit rl;
7 » struct rlimit rl; 7 getrlimit(RLIMIT_FSIZE, &rl);
8 » getrlimit(RLIMIT_FSIZE, &rl); 8 if (cmd == UL_SETFSIZE) {
9 » if (cmd == UL_SETFSIZE) { 9 long val;
10 » » long val; 10 va_list ap;
11 » » va_list ap; 11 va_start(ap, cmd);
12 » » va_start(ap, cmd); 12 val = va_arg(ap, long);
13 » » val = va_arg(ap, long); 13 va_end(ap);
14 » » va_end(ap); 14 rl.rlim_cur = 512ULL * val;
15 » » rl.rlim_cur = 512ULL * val; 15 if (setrlimit(RLIMIT_FSIZE, &rl))
16 » » if (setrlimit(RLIMIT_FSIZE, &rl)) return -1; 16 return -1;
17 » } 17 }
18 » return rl.rlim_cur / 512; 18 return rl.rlim_cur / 512;
19 } 19 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698