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
This commit is contained in:
Mark Johnston 2019-08-30 15:40:31 +00:00
parent cf955ebf6f
commit 7da9377b0d

View File

@ -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
/*