mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
syslog_dev_flush() needs to check if the inode is a mountpoint before calling the flush() method. Noted by David Sidrane.
This commit is contained in:
@@ -583,7 +583,9 @@ int syslog_dev_flush(void)
|
||||
|
||||
/* Is this a mountpoint? Does it support the sync method? */
|
||||
|
||||
if (inode && inode->u.i_mops->sync)
|
||||
if (inode != NULL && /* File opened (i.e., has inode)? */
|
||||
INODE_IS_MOUNTPT(inode) && /* Inode is a mountpoint? */
|
||||
inode->u.i_mops->sync != NULL) /* And supports synce method? */
|
||||
{
|
||||
/* Yes... synchronize to the stream */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user