src: Fix an error for the loop initialization declaration
authorYang Xu <xuyang2018.jy@fujitsu.com>
Sun, 25 Apr 2021 10:02:38 +0000 (18:02 +0800)
committerEryu Guan <guaneryu@gmail.com>
Sun, 9 May 2021 13:49:33 +0000 (21:49 +0800)
commit51b3e9ece6c832fe8ee1c21103844fd6ee58f68b
treea9cf0e43915c61c6a0b280f3e83ded6387dec69d
parent40818883aecd19581a71cc096d07eb9106c11b10
src: Fix an error for the loop initialization declaration

When compile them old gcc, get the following error
mount-idmapped.c: In function 'parse_map':
mount-idmapped.c:154:2: error: 'for' loop initial declarations are only allowed in C99 mode
  for (int i = 0; i < 2; i++) {

Fix them by declaring them at the beggining instead of in loop.

Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
Reviewed-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
src/detached_mounts_propagation.c
src/idmapped-mounts/mount-idmapped.c