From 1f9f439922c80e3a3d7315802951fb06a1d84f65 Mon Sep 17 00:00:00 2001 From: Kristóf Marussy Date: Mon, 27 Jan 2020 21:53:14 +0100 Subject: Do not declare variable in for loop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Caused build failure in Travis (due to lack of C99 mode): sbox.c: In function ‘sbox_run_v’: sbox.c:185:3: error: ‘for’ loop initial declarations are only allowed in C99 mode for (int i = 3; i < max; i++) ^ sbox.c:185:3: note: use option -std=c99 or -std=gnu99 to compile your code --- src/firejail/sbox.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/firejail/sbox.c b/src/firejail/sbox.c index 9e4cd1da9..203c0fc03 100644 --- a/src/firejail/sbox.c +++ b/src/firejail/sbox.c @@ -182,7 +182,8 @@ int sbox_run_v(unsigned filtermask, char * const arg[]) { // close all other file descriptors int max = 20; // getdtablesize() is overkill for a firejail process - for (int i = 3; i < max; i++) + int i = 3; + for (i = 3; i < max; i++) close(i); // close open files umask(027); -- cgit v1.2.3-54-g00ecf