aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Fu <vincent.fu@samsung.com>2023-09-29 10:04:50 -0400
committerVincent Fu <vincent.fu@samsung.com>2023-09-29 11:51:10 -0400
commit1353b1b9bbd6717c89e32883e87aa5cfe4cb04dc (patch)
treecdd638f6c1c06ee4ef0df1e081b87428c172c311
parent06812a4f0e4ff4847076e742557ab406a0e96848 (diff)
downloadfio-1353b1b9bbd6717c89e32883e87aa5cfe4cb04dc.tar.gz
workqueue: handle nice better
nice returns the program's schedule priority. This can be a negative value when there is no error condition. To check if nice is triggering an error we have to check errno. The most recent three macOS test failures appear to be due to this problem. https://github.com/axboe/fio/actions/runs/6347762639/job/17243247222 https://github.com/axboe/fio/actions/runs/6346019205/job/17239370410 https://github.com/axboe/fio/actions/runs/6241934089/job/16944981876 Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
-rw-r--r--workqueue.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/workqueue.c b/workqueue.c
index 9e6c41ff2..3636bc3a8 100644
--- a/workqueue.c
+++ b/workqueue.c
@@ -136,7 +136,8 @@ static void *worker_thread(void *data)
sk_out_assign(sw->sk_out);
if (wq->ops.nice) {
- if (nice(wq->ops.nice) < 0) {
+ errno = 0;
+ if (nice(wq->ops.nice) == -1 && errno != 0) {
log_err("workqueue: nice %s\n", strerror(errno));
ret = 1;
}