mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 15:58:59 +08:00
Merged nuttx/nuttx into master
This commit is contained in:
@@ -113,6 +113,7 @@ static int bch_open(FAR struct file *filep)
|
|||||||
{
|
{
|
||||||
FAR struct inode *inode = filep->f_inode;
|
FAR struct inode *inode = filep->f_inode;
|
||||||
FAR struct bchlib_s *bch;
|
FAR struct bchlib_s *bch;
|
||||||
|
int ret = OK;
|
||||||
|
|
||||||
DEBUGASSERT(inode && inode->i_private);
|
DEBUGASSERT(inode && inode->i_private);
|
||||||
bch = (FAR struct bchlib_s *)inode->i_private;
|
bch = (FAR struct bchlib_s *)inode->i_private;
|
||||||
@@ -122,7 +123,7 @@ static int bch_open(FAR struct file *filep)
|
|||||||
bchlib_semtake(bch);
|
bchlib_semtake(bch);
|
||||||
if (bch->refs == MAX_OPENCNT)
|
if (bch->refs == MAX_OPENCNT)
|
||||||
{
|
{
|
||||||
return -EMFILE;
|
ret = -EMFILE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -130,7 +131,7 @@ static int bch_open(FAR struct file *filep)
|
|||||||
}
|
}
|
||||||
|
|
||||||
bchlib_semgive(bch);
|
bchlib_semgive(bch);
|
||||||
return OK;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
@@ -218,7 +218,7 @@ int pipe2(int fd[2], size_t bufsize)
|
|||||||
|
|
||||||
/* Create a pathname to the pipe device */
|
/* Create a pathname to the pipe device */
|
||||||
|
|
||||||
sprintf(devname, "/dev/pipe%d", pipeno);
|
snprintf(devname, sizeof(devname), "/dev/pipe%d", pipeno);
|
||||||
|
|
||||||
/* Check if the pipe device has already been created */
|
/* Check if the pipe device has already been created */
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -547,7 +547,7 @@ static ssize_t fat_read(FAR struct file *filep, FAR char *buffer,
|
|||||||
ret = fat_currentsector(fs, ff, filep->f_pos);
|
ret = fat_currentsector(fs, ff, filep->f_pos);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
return ret;
|
goto errout_with_semaphore;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -799,7 +799,7 @@ static ssize_t fat_write(FAR struct file *filep, FAR const char *buffer,
|
|||||||
ret = fat_currentsector(fs, ff, filep->f_pos);
|
ret = fat_currentsector(fs, ff, filep->f_pos);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
return ret;
|
goto errout_with_semaphore;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user