summaryrefslogtreecommitdiff
path: root/src/lib/eina/eina_file.c
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2017-04-18 16:54:03 -0700
committerCedric BAIL <cedric@osg.samsung.com>2017-04-18 16:54:03 -0700
commitb2893dfc77fc6bcf5c3a16d3dab30cafc3740d15 (patch)
tree228a087499b5a5c2807132d2513015448a96f948 /src/lib/eina/eina_file.c
parent9d8549f7a302e0c122baaa0ea2f15d7fe6d99589 (diff)
eina: use new API eina_file_close_on_exec.
Diffstat (limited to 'src/lib/eina/eina_file.c')
-rw-r--r--src/lib/eina/eina_file.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/src/lib/eina/eina_file.c b/src/lib/eina/eina_file.c
index c378ea5..4a0c782 100644
--- a/src/lib/eina/eina_file.c
+++ b/src/lib/eina/eina_file.c
@@ -763,9 +763,6 @@ eina_file_open(const char *path, Eina_Bool shared)
763 char *filename; 763 char *filename;
764 struct stat file_stat; 764 struct stat file_stat;
765 int fd = -1; 765 int fd = -1;
766#ifdef HAVE_FCNTL
767 int flags;
768#endif
769 766
770 EINA_SAFETY_ON_NULL_RETURN_VAL(path, NULL); 767 EINA_SAFETY_ON_NULL_RETURN_VAL(path, NULL);
771 768
@@ -783,15 +780,8 @@ eina_file_open(const char *path, Eina_Bool shared)
783 780
784 if (fd < 0) goto on_error; 781 if (fd < 0) goto on_error;
785 782
786#ifdef HAVE_FCNTL 783 if (!eina_file_close_on_exec(fd, EINA_TRUE))
787 flags = fcntl(fd, F_GETFD);
788 if (flags == -1)
789 goto on_error;
790
791 flags |= FD_CLOEXEC;
792 if (fcntl(fd, F_SETFD, flags) == -1)
793 goto on_error; 784 goto on_error;
794#endif
795 785
796 if (fstat(fd, &file_stat)) 786 if (fstat(fd, &file_stat))
797 goto on_error; 787 goto on_error;