0001-sshfs.c-fix-build-with-gcc-4.8.patch 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. From 35ff9ed71b89f34e5462de1ee63f88edf98aeb69 Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Sat, 31 Oct 2020 21:08:53 +0100
  4. Subject: [PATCH] sshfs.c: fix build with gcc 4.8
  5. Fix the following build failure with gcc 4.8:
  6. ../sshfs.c:1092:2: error: 'for' loop initial declarations are only allowed in C99 mode
  7. for (int i = 0; i < sshfs.max_conns; i++) {
  8. ^
  9. This build failure has been added with
  10. https://github.com/libfuse/sshfs/commit/8822b60d9dbd9907065e7999f616b11ddce6d584
  11. Fixes:
  12. - http://autobuild.buildroot.org/results/2dbdc579c55543175716d5f739cabe2ad0864ed6
  13. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  14. [Upstream status: https://github.com/libfuse/sshfs/pull/233]
  15. ---
  16. sshfs.c | 3 ++-
  17. 1 file changed, 2 insertions(+), 1 deletion(-)
  18. diff --git a/sshfs.c b/sshfs.c
  19. index d5f2ff7..2c2db42 100644
  20. --- a/sshfs.c
  21. +++ b/sshfs.c
  22. @@ -1068,6 +1068,7 @@ static struct conn* get_conn(const struct sshfs_file *sf,
  23. const char *path)
  24. {
  25. struct conntab_entry *ce;
  26. + int i;
  27. if (sshfs.max_conns == 1)
  28. return &sshfs.conns[0];
  29. @@ -1089,7 +1090,7 @@ static struct conn* get_conn(const struct sshfs_file *sf,
  30. int best_index = 0;
  31. uint64_t best_score = ~0ULL; /* smaller is better */
  32. - for (int i = 0; i < sshfs.max_conns; i++) {
  33. + for (i = 0; i < sshfs.max_conns; i++) {
  34. uint64_t score = ((uint64_t) sshfs.conns[i].req_count << 43) +
  35. ((uint64_t) sshfs.conns[i].dir_count << 22) +
  36. ((uint64_t) sshfs.conns[i].file_count << 1) +
  37. --
  38. 2.28.0