Skip to content

Commit

Permalink
Add O_CLOEXEC flag to open call
Browse files Browse the repository at this point in the history
  • Loading branch information
mejedi committed May 22, 2019
1 parent 6930448 commit a2f860d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hook_engine.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ int hook_install(void *fn, void *replacement, void *trampoline)
int hook_begin()
{
if (g_mem_fd == -1) {
g_mem_fd = open("/proc/self/mem", O_WRONLY);
g_mem_fd = open("/proc/self/mem", O_WRONLY|O_NOCTTY|O_CLOEXEC);
}

return 0;
Expand Down

0 comments on commit a2f860d

Please sign in to comment.