fastboot:enable O_CLOEXEC explicit
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
This commit is contained in:
parent
f1ce26162b
commit
e55666f90e
@ -230,7 +230,7 @@ static void fastboot_okay(FAR struct fastboot_ctx_s *context,
|
|||||||
|
|
||||||
static int fastboot_flash_open(FAR const char *name)
|
static int fastboot_flash_open(FAR const char *name)
|
||||||
{
|
{
|
||||||
int fd = open(name, O_RDWR);
|
int fd = open(name, O_RDWR | O_CLOEXEC);
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
{
|
{
|
||||||
fb_err("Open %s error\n", name);
|
fb_err("Open %s error\n", name);
|
||||||
@ -741,7 +741,7 @@ int main(int argc, FAR char **argv)
|
|||||||
|
|
||||||
snprintf(usbdev, sizeof(usbdev), "%s/ep%d",
|
snprintf(usbdev, sizeof(usbdev), "%s/ep%d",
|
||||||
FASTBOOT_USBDEV, FASTBOOT_EP_BULKOUT_IDX + 1);
|
FASTBOOT_USBDEV, FASTBOOT_EP_BULKOUT_IDX + 1);
|
||||||
context.usbdev_in = open(usbdev, O_RDONLY);
|
context.usbdev_in = open(usbdev, O_RDONLY | O_CLOEXEC);
|
||||||
if (context.usbdev_in < 0)
|
if (context.usbdev_in < 0)
|
||||||
{
|
{
|
||||||
fb_err("open [%s] error\n", usbdev);
|
fb_err("open [%s] error\n", usbdev);
|
||||||
@ -751,7 +751,7 @@ int main(int argc, FAR char **argv)
|
|||||||
|
|
||||||
snprintf(usbdev, sizeof(usbdev), "%s/ep%d",
|
snprintf(usbdev, sizeof(usbdev), "%s/ep%d",
|
||||||
FASTBOOT_USBDEV, FASTBOOT_EP_BULKIN_IDX + 1);
|
FASTBOOT_USBDEV, FASTBOOT_EP_BULKIN_IDX + 1);
|
||||||
context.usbdev_out = open(usbdev, O_WRONLY);
|
context.usbdev_out = open(usbdev, O_WRONLY | O_CLOEXEC);
|
||||||
if (context.usbdev_out < 0)
|
if (context.usbdev_out < 0)
|
||||||
{
|
{
|
||||||
fb_err("open [%s] error\n", usbdev);
|
fb_err("open [%s] error\n", usbdev);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user