fs/vfs: Proper use of sigisemptyset

Use sigandset function instead of & operation,
because the sigset_t structure has been changed.

This PR is to adapt to the changes made in #8885.

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
This commit is contained in:
zhangyuan21 2023-06-05 23:10:20 +08:00 committed by Alan Carvalho de Assis
parent d492823128
commit c71007323e

View File

@ -175,8 +175,9 @@ static ssize_t signalfd_file_read(FAR struct file *filep,
return -EINVAL; return -EINVAL;
} }
pendmask = nxsig_pendingset(NULL) & dev->sigmask; pendmask = nxsig_pendingset(NULL);
if (pendmask == 0) sigandset(&pendmask, &pendmask, &dev->sigmask);
if (sigisemptyset(&pendmask))
{ {
if (filep->f_oflags & O_NONBLOCK) if (filep->f_oflags & O_NONBLOCK)
{ {
@ -208,9 +209,10 @@ static ssize_t signalfd_file_read(FAR struct file *filep,
siginfo->ssi_int = info.si_value.sival_int; siginfo->ssi_int = info.si_value.sival_int;
siginfo->ssi_ptr = (uint64_t)(uintptr_t)info.si_value.sival_ptr; siginfo->ssi_ptr = (uint64_t)(uintptr_t)info.si_value.sival_ptr;
siginfo++; siginfo++;
pendmask = nxsig_pendingset(NULL) & dev->sigmask; pendmask = nxsig_pendingset(NULL);
sigandset(&pendmask, &pendmask, &dev->sigmask);
} }
while (--count != 0 && pendmask != 0); while (--count != 0 && !sigisemptyset(&pendmask));
errout: errout:
len = (FAR char *)siginfo - buffer; len = (FAR char *)siginfo - buffer;
@ -221,6 +223,7 @@ static int signalfd_file_poll(FAR struct file *filep,
FAR struct pollfd *fds, bool setup) FAR struct pollfd *fds, bool setup)
{ {
FAR struct signalfd_priv_s *dev = filep->f_priv; FAR struct signalfd_priv_s *dev = filep->f_priv;
sigset_t mask;
int ret = 0; int ret = 0;
int i; int i;
@ -264,7 +267,9 @@ static int signalfd_file_poll(FAR struct file *filep,
/* Notify the POLLIN event if the counter is not zero */ /* Notify the POLLIN event if the counter is not zero */
if ((nxsig_pendingset(NULL) & dev->sigmask) != 0) mask = nxsig_pendingset(NULL);
sigandset(&mask, &mask, &dev->sigmask);
if (!sigisemptyset(&mask))
{ {
poll_notify(dev->fds, CONFIG_SIGNAL_FD_NPOLLWAITERS, POLLIN); poll_notify(dev->fds, CONFIG_SIGNAL_FD_NPOLLWAITERS, POLLIN);
} }