Skip to content

Commit 051a223

Browse files
committed
tests: keep the rename-flags helper compiling off Linux
renameat2 and its flags are Linux-only; the integration tests are skipped elsewhere, so the helper just reports the commands as unsupported.
1 parent 55020c2 commit 051a223

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

tests/helpers/fsops_helper.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ int main(int argc, char **argv)
3131
}
3232

3333
if (!strcmp(argv[1], "noreplace") || !strcmp(argv[1], "exchange")) {
34+
#ifdef __linux__
3435
unsigned int flags = !strcmp(argv[1], "noreplace") ?
3536
RENAME_NOREPLACE : RENAME_EXCHANGE;
3637

@@ -39,6 +40,12 @@ int main(int argc, char **argv)
3940
return 2;
4041
}
4142
return 0;
43+
#else
44+
/* The integration tests only run on Linux; keep the helper
45+
* compiling on the other platforms. */
46+
fprintf(stderr, "rename flags are not supported on this platform\n");
47+
return 3;
48+
#endif
4249
}
4350

4451
if (!strcmp(argv[1], "ftruncate")) {

0 commit comments

Comments
 (0)