Commit 5483b2b
committed
src/dio-offsets.c: fix compiler error of open()
The blktests build CI reported the error below:
gcc -O2 -Wall -Wshadow -Werror -DHAVE_LINUX_BLKZONED_H -o dio-offsets dio-offsets.c
In file included from /usr/include/fcntl.h:342,
from dio-offsets.c:14:
In function ‘open’,
inlined from ‘init_args’ at dio-offsets.c:43:12,
inlined from ‘main’ at dio-offsets.c:711:2:
/usr/include/x86_64-linux-gnu/bits/fcntl2.h:50:11: error: call to ‘__open_missing_mode’ declared with attribute error: open with O_CREAT or O_TMPFILE in second argument needs 3 arguments
50 | __open_missing_mode ();
| ^~~~~~~~~~~~~~~~~~~~~~
To avoid the error, remove the O_CREAT flag from the open() call. The
flag should not be necessary because the open target file is the test
target block device file which should exist.
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>1 parent f2a4323 commit 5483b2b
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
0 commit comments