]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commit
fstests: fix compilation error in splice2pipe on old (<C99) compilers
authorAndrey Albershteyn <aalbersh@redhat.com>
Tue, 16 May 2023 10:23:03 +0000 (12:23 +0200)
committerZorro Lang <zlang@kernel.org>
Sat, 27 May 2023 18:03:49 +0000 (02:03 +0800)
commitdf0238186fe51b971aaec25371b4644753eab97c
tree1197773ae63f0dc1b0f4a29dc9053b9ed3066368
parent33144e0693b5d70c81e5cf142d02e5e6dd7bd5ce
fstests: fix compilation error in splice2pipe on old (<C99) compilers

Compilation fails on system with compiler which uses older C dialect
(e.g. RHEL7; gcc with gnu90) with:

splice2pipe.c: In function 'prepare_pipe':
splice2pipe.c:54:2: error: 'for' loop initial declarations are only allowed in C99 mode
  for (unsigned r = pipe_size; r > 0;) {

Fix it by declaring 'r' outside of the loop.

Signed-off-by: Andrey Albershteyn <aalbersh@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Zorro Lang <zlang@kernel.org>
src/splice2pipe.c