You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2024/09/28 02:45:06 UTC

(nuttx) 01/02: fs/poll: ouput error log about poll failed

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 580bdda624b6589f55892564b715c9dca2efa6fd
Author: dongjiuzhu1 <do...@xiaomi.com>
AuthorDate: Fri Jul 26 11:24:12 2024 +0800

    fs/poll: ouput error log about poll failed
    
    Signed-off-by: dongjiuzhu1 <do...@xiaomi.com>
---
 fs/vfs/fs_poll.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/fs/vfs/fs_poll.c b/fs/vfs/fs_poll.c
index ba5f1a9920..26795e2062 100644
--- a/fs/vfs/fs_poll.c
+++ b/fs/vfs/fs_poll.c
@@ -343,12 +343,22 @@ int file_poll(FAR struct file *filep, FAR struct pollfd *fds, bool setup)
           /* Yes, it does... Setup the poll */
 
           ret = inode->u.i_ops->poll(filep, fds, setup);
+          if (ret < 0)
+            {
+              ferr("poll failed:%p, setup:%d, ret:%d\n",
+                   inode->u.i_ops->poll, setup, ret);
+            }
         }
 #ifndef CONFIG_DISABLE_MOUNTPOINT
       else if (INODE_IS_MOUNTPT(inode) && inode->u.i_mops != NULL &&
                inode->u.i_mops->poll != NULL)
         {
           ret = inode->u.i_mops->poll(filep, fds, setup);
+          if (ret < 0)
+            {
+              ferr("poll failed:%p, setup:%d, ret:%d\n",
+                   inode->u.i_ops->poll, setup, ret);
+            }
         }
 #endif