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

Side by Side Diff: sandbox/linux/suid/process_util_linux.c

Issue 10353020: Fix Mario (32-bit) build. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // The following is the C version of code from base/process_utils_linux.cc. 5 // The following is the C version of code from base/process_utils_linux.cc.
6 // We shouldn't link against C++ code in a setuid binary. 6 // We shouldn't link against C++ code in a setuid binary.
7 7
8 #define _GNU_SOURCE // needed for O_DIRECTORY 8 #define _GNU_SOURCE // needed for O_DIRECTORY
9 9
10 #include "process_util.h" 10 #include "process_util.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 char value[21]; 87 char value[21];
88 switch (margin_mb) { 88 switch (margin_mb) {
89 case -1L: 89 case -1L:
90 snprintf(value, sizeof(value), "off"); 90 snprintf(value, sizeof(value), "off");
91 break; 91 break;
92 case 0L: 92 case 0L:
93 case 25L: 93 case 25L:
94 case 50L: 94 case 50L:
95 case 100L: 95 case 100L:
96 case 200L: 96 case 200L:
97 snprintf(value, sizeof(value), "%zu", margin_mb); 97 snprintf(value, sizeof(value), "%lld", (long long int)margin_mb);
98 break; 98 break;
99 default: 99 default:
100 return false; 100 return false;
101 } 101 }
102 102
103 bool success = (write(file_descriptor, value, strlen(value)) >= 0); 103 bool success = (write(file_descriptor, value, strlen(value)) >= 0);
104 close(file_descriptor); 104 close(file_descriptor);
105 return success; 105 return success;
106 } 106 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698