mirror of
https://github.com/apache/nuttx.git
synced 2026-05-30 21:36:28 +08:00
Rename file_close_detached() to juse file_close() for better consistency in naming.
This commit is contained in:
@@ -304,7 +304,7 @@ static int hardfault_get_desc(struct bbsramd_s *desc)
|
|||||||
{
|
{
|
||||||
ret = file_ioctl(&filestruct, STM32F7_BBSRAM_GETDESC_IOCTL,
|
ret = file_ioctl(&filestruct, STM32F7_BBSRAM_GETDESC_IOCTL,
|
||||||
(unsigned long)((uintptr_t)desc));
|
(unsigned long)((uintptr_t)desc));
|
||||||
(void)file_close_detached(&filestruct);
|
(void)file_close(&filestruct);
|
||||||
|
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -485,7 +485,7 @@ int board_ajoy_initialize(void)
|
|||||||
{
|
{
|
||||||
ierr("ERROR: ajoy_register failed: %d\n", ret);
|
ierr("ERROR: ajoy_register failed: %d\n", ret);
|
||||||
#ifndef NO_JOYSTICK_ADC
|
#ifndef NO_JOYSTICK_ADC
|
||||||
file_close_detached(&g_adcfile);
|
file_close(&g_adcfile);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -267,7 +267,7 @@ int stm32l4_adc_measure_voltages(uint32_t *vrefint, uint32_t *vbat, uint32_t *ve
|
|||||||
}
|
}
|
||||||
|
|
||||||
out_close:
|
out_close:
|
||||||
file_close_detached(&filestruct);
|
file_close(&filestruct);
|
||||||
|
|
||||||
out:
|
out:
|
||||||
return ret;
|
return ret;
|
||||||
|
|||||||
@@ -485,7 +485,7 @@ int board_ajoy_initialize(void)
|
|||||||
{
|
{
|
||||||
ierr("ERROR: ajoy_register failed: %d\n", ret);
|
ierr("ERROR: ajoy_register failed: %d\n", ret);
|
||||||
#ifndef NO_JOYSTICK_ADC
|
#ifndef NO_JOYSTICK_ADC
|
||||||
file_close_detached(&g_adcfile);
|
file_close(&g_adcfile);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ static int wdog_daemon(int argc, char *argv[])
|
|||||||
exit_close_dev:
|
exit_close_dev:
|
||||||
/* Close watchdog device and exit. */
|
/* Close watchdog device and exit. */
|
||||||
|
|
||||||
file_close_detached(&filestruct);
|
file_close(&filestruct);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -145,7 +145,7 @@ int photon_watchdog_initialize(void)
|
|||||||
|
|
||||||
/* Close watchdog as it is not needed here anymore */
|
/* Close watchdog as it is not needed here anymore */
|
||||||
|
|
||||||
(void)file_close_detached(&filestruct);
|
(void)file_close(&filestruct);
|
||||||
|
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ static int wdog_daemon(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
errout_with_dev:
|
errout_with_dev:
|
||||||
file_close_detached(&filestruct);
|
file_close(&filestruct);
|
||||||
errout:
|
errout:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -210,7 +210,7 @@ int sam_watchdog_initialize(void)
|
|||||||
#endif
|
#endif
|
||||||
return OK;
|
return OK;
|
||||||
errout_with_dev:
|
errout_with_dev:
|
||||||
file_close_detached(&filestruct);
|
file_close(&filestruct);
|
||||||
errout:
|
errout:
|
||||||
return ret;
|
return ret;
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -437,7 +437,7 @@ int sam_ajoy_initialization(void)
|
|||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
ierr("ERROR: ajoy_register failed: %d\n", ret);
|
ierr("ERROR: ajoy_register failed: %d\n", ret);
|
||||||
file_close_detached(&g_adcfile);
|
file_close(&g_adcfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|||||||
@@ -267,7 +267,7 @@ int stm32l4_adc_measure_voltages(uint32_t *vrefint, uint32_t *vbat, uint32_t *ve
|
|||||||
}
|
}
|
||||||
|
|
||||||
out_close:
|
out_close:
|
||||||
file_close_detached(&filestruct);
|
file_close(&filestruct);
|
||||||
out:
|
out:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ int bchdev_unregister(FAR const char *chardev)
|
|||||||
|
|
||||||
ret = file_ioctl(&filestruct, DIOC_GETPRIV,
|
ret = file_ioctl(&filestruct, DIOC_GETPRIV,
|
||||||
(unsigned long)((uintptr_t)&bch));
|
(unsigned long)((uintptr_t)&bch));
|
||||||
(void)file_close_detached(&filestruct);
|
(void)file_close(&filestruct);
|
||||||
|
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -458,7 +458,7 @@ int losetup(FAR const char *devname, FAR const char *filename,
|
|||||||
return OK;
|
return OK;
|
||||||
|
|
||||||
errout_with_file:
|
errout_with_file:
|
||||||
file_close_detached(&dev->devfile);
|
file_close(&dev->devfile);
|
||||||
|
|
||||||
errout_with_dev:
|
errout_with_dev:
|
||||||
kmm_free(dev);
|
kmm_free(dev);
|
||||||
@@ -521,7 +521,7 @@ int loteardown(FAR const char *devname)
|
|||||||
|
|
||||||
if (dev->devfile.f_inode != NULL)
|
if (dev->devfile.f_inode != NULL)
|
||||||
{
|
{
|
||||||
(void)file_close_detached(&dev->devfile);
|
(void)file_close(&dev->devfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
kmm_free(dev);
|
kmm_free(dev);
|
||||||
|
|||||||
@@ -551,7 +551,7 @@ FAR struct mtd_dev_s *blockmtd_initialize(FAR const char *path, size_t offset,
|
|||||||
if (nblocks < 3)
|
if (nblocks < 3)
|
||||||
{
|
{
|
||||||
ferr("ERROR: Need to provide at least three full erase block\n");
|
ferr("ERROR: Need to provide at least three full erase block\n");
|
||||||
file_close_detached(&priv->mtdfile);
|
file_close(&priv->mtdfile);
|
||||||
kmm_free(priv);
|
kmm_free(priv);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -598,7 +598,7 @@ void blockmtd_teardown(FAR struct mtd_dev_s *dev)
|
|||||||
/* Close the enclosed file */
|
/* Close the enclosed file */
|
||||||
|
|
||||||
priv = (FAR struct file_dev_s *) dev;
|
priv = (FAR struct file_dev_s *) dev;
|
||||||
file_close_detached(&priv->mtdfile);
|
file_close(&priv->mtdfile);
|
||||||
|
|
||||||
#ifdef CONFIG_MTD_REGISTRATION
|
#ifdef CONFIG_MTD_REGISTRATION
|
||||||
/* Un-register the MTD with the procfs system if enabled */
|
/* Un-register the MTD with the procfs system if enabled */
|
||||||
|
|||||||
@@ -278,10 +278,10 @@ static void pty_destroy(FAR struct pty_devpair_s *devpair)
|
|||||||
|
|
||||||
/* Close the contained file structures */
|
/* Close the contained file structures */
|
||||||
|
|
||||||
(void)file_close_detached(&devpair->pp_master.pd_src);
|
(void)file_close(&devpair->pp_master.pd_src);
|
||||||
(void)file_close_detached(&devpair->pp_master.pd_sink);
|
(void)file_close(&devpair->pp_master.pd_sink);
|
||||||
(void)file_close_detached(&devpair->pp_slave.pd_src);
|
(void)file_close(&devpair->pp_slave.pd_src);
|
||||||
(void)file_close_detached(&devpair->pp_slave.pd_sink);
|
(void)file_close(&devpair->pp_slave.pd_sink);
|
||||||
|
|
||||||
#ifdef CONFIG_PSEUDOTERM_SUSV1
|
#ifdef CONFIG_PSEUDOTERM_SUSV1
|
||||||
/* Free this minor number so that it can be reused */
|
/* Free this minor number so that it can be reused */
|
||||||
@@ -1221,7 +1221,7 @@ errout_with_pipeb:
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
(void)file_close_detached(&devpair->pp_master.pd_src);
|
(void)file_close(&devpair->pp_master.pd_src);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pipe_b[1] >= 0)
|
if (pipe_b[1] >= 0)
|
||||||
@@ -1230,7 +1230,7 @@ errout_with_pipeb:
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
(void)file_close_detached(&devpair->pp_slave.pd_sink);
|
(void)file_close(&devpair->pp_slave.pd_sink);
|
||||||
}
|
}
|
||||||
|
|
||||||
errout_with_pipea:
|
errout_with_pipea:
|
||||||
@@ -1240,7 +1240,7 @@ errout_with_pipea:
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
(void)file_close_detached(&devpair->pp_slave.pd_src);
|
(void)file_close(&devpair->pp_slave.pd_src);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pipe_a[1] >= 0)
|
if (pipe_a[1] >= 0)
|
||||||
@@ -1249,7 +1249,7 @@ errout_with_pipea:
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
(void)file_close_detached(&devpair->pp_master.pd_sink);
|
(void)file_close(&devpair->pp_master.pd_sink);
|
||||||
}
|
}
|
||||||
|
|
||||||
errout_with_devpair:
|
errout_with_devpair:
|
||||||
|
|||||||
@@ -420,7 +420,7 @@ int syslog_dev_uninitialize(void)
|
|||||||
|
|
||||||
/* Close the detached file instance */
|
/* Close the detached file instance */
|
||||||
|
|
||||||
(void)file_close_detached(&g_syslog_dev.sl_file);
|
(void)file_close(&g_syslog_dev.sl_file);
|
||||||
|
|
||||||
/* Free the device path */
|
/* Free the device path */
|
||||||
|
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ int file_detach(int fd, FAR struct file *filep)
|
|||||||
|
|
||||||
/* Release the file descriptor *without* calling the driver close method
|
/* Release the file descriptor *without* calling the driver close method
|
||||||
* and without decrementing the inode reference count. That will be done
|
* and without decrementing the inode reference count. That will be done
|
||||||
* in file_close_detached().
|
* in file_close().
|
||||||
*/
|
*/
|
||||||
|
|
||||||
parent->f_oflags = 0;
|
parent->f_oflags = 0;
|
||||||
@@ -168,7 +168,7 @@ int file_detach(int fd, FAR struct file *filep)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: file_close_detached
|
* Name: file_close
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Close a file that was previously detached with file_detach().
|
* Close a file that was previously detached with file_detach().
|
||||||
@@ -185,7 +185,7 @@ int file_detach(int fd, FAR struct file *filep)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int file_close_detached(FAR struct file *filep)
|
int file_close(FAR struct file *filep)
|
||||||
{
|
{
|
||||||
struct inode *inode;
|
struct inode *inode;
|
||||||
int ret = OK;
|
int ret = OK;
|
||||||
|
|||||||
@@ -780,7 +780,7 @@ int file_detach(int fd, FAR struct file *filep);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: file_close_detached
|
* Name: file_close
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Close a file that was previously detached with file_detach().
|
* Close a file that was previously detached with file_detach().
|
||||||
@@ -795,7 +795,7 @@ int file_detach(int fd, FAR struct file *filep);
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int file_close_detached(FAR struct file *filep);
|
int file_close(FAR struct file *filep);
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: open_blockdriver
|
* Name: open_blockdriver
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ void local_free(FAR struct local_conn_s *conn)
|
|||||||
|
|
||||||
if (conn->lc_infile.f_inode != NULL)
|
if (conn->lc_infile.f_inode != NULL)
|
||||||
{
|
{
|
||||||
file_close_detached(&conn->lc_infile);
|
file_close(&conn->lc_infile);
|
||||||
conn->lc_infile.f_inode = NULL;
|
conn->lc_infile.f_inode = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -136,7 +136,7 @@ void local_free(FAR struct local_conn_s *conn)
|
|||||||
|
|
||||||
if (conn->lc_outfile.f_inode != NULL)
|
if (conn->lc_outfile.f_inode != NULL)
|
||||||
{
|
{
|
||||||
file_close_detached(&conn->lc_outfile);
|
file_close(&conn->lc_outfile);
|
||||||
conn->lc_outfile.f_inode = NULL;
|
conn->lc_outfile.f_inode = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -230,7 +230,7 @@ static int inline local_stream_connect(FAR struct local_conn_s *client,
|
|||||||
return OK;
|
return OK;
|
||||||
|
|
||||||
errout_with_outfd:
|
errout_with_outfd:
|
||||||
(void)file_close_detached(&client->lc_outfile);
|
(void)file_close(&client->lc_outfile);
|
||||||
client->lc_outfile.f_inode = NULL;
|
client->lc_outfile.f_inode = NULL;
|
||||||
|
|
||||||
errout_with_fifos:
|
errout_with_fifos:
|
||||||
|
|||||||
@@ -348,7 +348,7 @@ psock_dgram_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len,
|
|||||||
|
|
||||||
/* Now we can close the read-only file descriptor */
|
/* Now we can close the read-only file descriptor */
|
||||||
|
|
||||||
file_close_detached(&conn->lc_infile);
|
file_close(&conn->lc_infile);
|
||||||
conn->lc_infile.f_inode = NULL;
|
conn->lc_infile.f_inode = NULL;
|
||||||
|
|
||||||
/* Release our reference to the half duplex FIFO */
|
/* Release our reference to the half duplex FIFO */
|
||||||
@@ -371,7 +371,7 @@ psock_dgram_recvfrom(FAR struct socket *psock, FAR void *buf, size_t len,
|
|||||||
errout_with_infd:
|
errout_with_infd:
|
||||||
/* Close the read-only file descriptor */
|
/* Close the read-only file descriptor */
|
||||||
|
|
||||||
file_close_detached(&conn->lc_infile);
|
file_close(&conn->lc_infile);
|
||||||
conn->lc_infile.f_inode = NULL;
|
conn->lc_infile.f_inode = NULL;
|
||||||
|
|
||||||
errout_with_halfduplex:
|
errout_with_halfduplex:
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ ssize_t psock_local_sendto(FAR struct socket *psock, FAR const void *buf,
|
|||||||
|
|
||||||
/* Now we can close the write-only socket descriptor */
|
/* Now we can close the write-only socket descriptor */
|
||||||
|
|
||||||
file_close_detached(&conn->lc_outfile);
|
file_close(&conn->lc_outfile);
|
||||||
conn->lc_outfile.f_inode = NULL;
|
conn->lc_outfile.f_inode = NULL;
|
||||||
|
|
||||||
errout_with_halfduplex:
|
errout_with_halfduplex:
|
||||||
|
|||||||
@@ -835,14 +835,14 @@ int net_unlockroute_ipv6(void)
|
|||||||
#ifdef CONFIG_ROUTE_IPv4_FILEROUTE
|
#ifdef CONFIG_ROUTE_IPv4_FILEROUTE
|
||||||
int net_closeroute_ipv4(FAR struct file *filep)
|
int net_closeroute_ipv4(FAR struct file *filep)
|
||||||
{
|
{
|
||||||
return file_close_detached(filep);
|
return file_close(filep);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_ROUTE_IPv6_FILEROUTE
|
#ifdef CONFIG_ROUTE_IPv6_FILEROUTE
|
||||||
int net_closeroute_ipv6(FAR struct file *filep)
|
int net_closeroute_ipv6(FAR struct file *filep)
|
||||||
{
|
{
|
||||||
return file_close_detached(filep);
|
return file_close(filep);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user