- if (td->o.odirect)
- cmd = F_SET_FILE_RW_HINT;
- else
- cmd = F_SET_RW_HINT;
-
- if (fcntl(f->fd, cmd, &hint) < 0) {
+ if (td->o.odirect) {
+ res = fcntl(f->fd, F_SET_FILE_RW_HINT, &hint);
+ if (res < 0)
+ res = fcntl(f->fd, F_SET_RW_HINT, &hint);
+ } else {
+ res = fcntl(f->fd, F_SET_RW_HINT, &hint);
+ }
+ if (res < 0) {