Skip to content

Commit de0504e

Browse files
authored
sshfs.c: fix build with gcc 4.8 (#233)
Fix the following build failure with gcc 4.8: ../sshfs.c:1092:2: error: 'for' loop initial declarations are only allowed in C99 mode for (int i = 0; i < sshfs.max_conns; i++) { ^ This build failure has been added with 8822b60 Fixes: - http://autobuild.buildroot.org/results/2dbdc579c55543175716d5f739cabe2ad0864ed6 Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
1 parent 6625146 commit de0504e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

sshfs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1068,6 +1068,7 @@ static struct conn* get_conn(const struct sshfs_file *sf,
10681068
const char *path)
10691069
{
10701070
struct conntab_entry *ce;
1071+
int i;
10711072

10721073
if (sshfs.max_conns == 1)
10731074
return &sshfs.conns[0];
@@ -1089,7 +1090,7 @@ static struct conn* get_conn(const struct sshfs_file *sf,
10891090

10901091
int best_index = 0;
10911092
uint64_t best_score = ~0ULL; /* smaller is better */
1092-
for (int i = 0; i < sshfs.max_conns; i++) {
1093+
for (i = 0; i < sshfs.max_conns; i++) {
10931094
uint64_t score = ((uint64_t) sshfs.conns[i].req_count << 43) +
10941095
((uint64_t) sshfs.conns[i].dir_count << 22) +
10951096
((uint64_t) sshfs.conns[i].file_count << 1) +

0 commit comments

Comments
 (0)