fix[common]: Add mpp_dup function

mpp_dup function use fnctl F_DUPFD_CLOEXEC for fd dup with CLOEXEC flag.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Idd82eb935b06d2885685aeb696b95e910981539d
This commit is contained in:
Herman Chen
2024-01-09 16:38:33 +08:00
parent ccf32c1da3
commit 8db63d761a
10 changed files with 12 additions and 12 deletions

View File

@@ -125,7 +125,7 @@ CamSource *camera_source_init(const char *device, RK_U32 bufcnt, RK_U32 width, R
return NULL;
ctx->bufcnt = bufcnt;
ctx->fd = open(device, O_RDWR, 0);
ctx->fd = open(device, O_RDWR | O_CLOEXEC, 0);
if (ctx->fd < 0) {
mpp_err_f("Cannot open device\n");
goto FAIL;