From 7da9377b0d124ad89921f89b6d5b390aac4050e1 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Fri, 30 Aug 2019 15:40:31 +0000 Subject: [PATCH] Properly check for an interrupted cv_wait_sig(). The returned error number may be EINTR or ERESTART depending on whether or not the signal is supposed to interrupt the system call. Reported and tested by: pho MFC after: 1 week Sponsored by: The FreeBSD Foundation --- sys/dev/sound/midi/sequencer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/sound/midi/sequencer.c b/sys/dev/sound/midi/sequencer.c index be370579010..f5fba6c0c77 100644 --- a/sys/dev/sound/midi/sequencer.c +++ b/sys/dev/sound/midi/sequencer.c @@ -912,7 +912,7 @@ mseq_read(struct cdev *i_dev, struct uio *uio, int ioflag) goto err1; retval = cv_wait_sig(&scp->in_cv, &scp->seq_lock); - if (retval == EINTR) + if (retval != 0) goto err1; } @@ -977,7 +977,7 @@ mseq_write(struct cdev *i_dev, struct uio *uio, int ioflag) * We slept, maybe things have changed since last * dying check */ - if (retval == EINTR) + if (retval != 0) goto err0; #if 0 /* -- 2.45.0