Skip to content

Commit

Permalink
sshfs.c: fix build with gcc 4.8 (#233)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
ffontaine committed Nov 2, 2020
1 parent 6625146 commit de0504e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sshfs.c
Expand Up @@ -1068,6 +1068,7 @@ static struct conn* get_conn(const struct sshfs_file *sf,
const char *path)
{
struct conntab_entry *ce;
int i;

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

int best_index = 0;
uint64_t best_score = ~0ULL; /* smaller is better */
for (int i = 0; i < sshfs.max_conns; i++) {
for (i = 0; i < sshfs.max_conns; i++) {
uint64_t score = ((uint64_t) sshfs.conns[i].req_count << 43) +
((uint64_t) sshfs.conns[i].dir_count << 22) +
((uint64_t) sshfs.conns[i].file_count << 1) +
Expand Down

0 comments on commit de0504e

Please sign in to comment.