To close the file descriptor when calling the execv(), this patch sets
the O_CLOEXEC flag to the file descriptor.
Change-Id: Ibd4bcdacdd40f0e5f207518428c91fa6796465c9
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
close(fd_);
}
+void Port::SetCloseOnExec() {
+ int flags = fcntl(fd_, F_GETFL, 0);
+ fcntl(fd_, F_SETFL, flags | O_CLOEXEC);
+ _W("Close on exec. fd(%d)", fd_);
+}
+
int Port::SetPrivateSharing(const char* paths[], unsigned int size) {
int ret = aul_rpc_port_set_private_sharing(id_.c_str(), paths, size);
if (ret != 0)
}
private:
+ void SetCloseOnExec();
void IgnoreIOEvent();
int ListenIOEvent();