mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-05 17:16:50 +08:00
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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user