From: Jens Axboe Date: Tue, 15 Apr 2014 14:30:06 +0000 (-0600) Subject: sg: check for error in fcntl() restore of flags X-Git-Tag: fio-2.1.9~16 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=affe05a916636af786ee66925038f6f2c74cf526 sg: check for error in fcntl() restore of flags Signed-off-by: Jens Axboe --- diff --git a/engines/sg.c b/engines/sg.c index fcd9c413..87fe8835 100644 --- a/engines/sg.c +++ b/engines/sg.c @@ -142,8 +142,10 @@ re_read: } if (!min) { - for_each_file(td, f, i) - fcntl(f->fd, F_SETFL, sd->fd_flags[i]); + for_each_file(td, f, i) { + if (fcntl(f->fd, F_SETFL, sd->fd_flags[i]) < 0) + log_err("fio: sg failed to restore fcntl flags: %s\n", strerror(errno)); + } } return r;