forked from enlightenment/efl
parent
931e4f9325
commit
88ba56d9d5
13
ChangeLog
13
ChangeLog
|
@ -1,3 +1,7 @@
|
||||||
|
2012-12-07 Cedric Bail
|
||||||
|
|
||||||
|
* Don't leak fd on exec.
|
||||||
|
|
||||||
2012-12-07 Sung W. Park (sung_)
|
2012-12-07 Sung W. Park (sung_)
|
||||||
|
|
||||||
* Added EVAS_GL_LINE_NO_OFFSET_HACK to turn off the line coordinate
|
* Added EVAS_GL_LINE_NO_OFFSET_HACK to turn off the line coordinate
|
||||||
|
@ -53,6 +57,10 @@
|
||||||
textblock recalcs lead very badly. Required changed to textgrid
|
textblock recalcs lead very badly. Required changed to textgrid
|
||||||
though a sit relied on the leaky behavior.
|
though a sit relied on the leaky behavior.
|
||||||
|
|
||||||
|
2012-11-20 ChunEon Park (Hermet)
|
||||||
|
|
||||||
|
* Fix the evas memory leak - eina_rectangles allocated internally.
|
||||||
|
|
||||||
2012-11-16 Sung W. Park (sung_)
|
2012-11-16 Sung W. Park (sung_)
|
||||||
|
|
||||||
* Fixed glGetIntegerv() in Direct Rendering mode for Evas GL
|
* Fixed glGetIntegerv() in Direct Rendering mode for Evas GL
|
||||||
|
@ -135,8 +143,3 @@
|
||||||
|
|
||||||
* Fix EINA_INLIST_FOREACH_SAFE macro to work when inlist is not the
|
* Fix EINA_INLIST_FOREACH_SAFE macro to work when inlist is not the
|
||||||
first item in the struct.
|
first item in the struct.
|
||||||
|
|
||||||
2012-11-20 ChunEon Park (Hermet)
|
|
||||||
|
|
||||||
* Fix the evas memory leak - eina_rectangles allocated internally.
|
|
||||||
|
|
||||||
|
|
1
NEWS
1
NEWS
|
@ -69,4 +69,5 @@ Fixes:
|
||||||
* Fixed textblock textprop leak.
|
* Fixed textblock textprop leak.
|
||||||
* Fixed evas_object_box to reset size_hint_min to zero when no child.
|
* Fixed evas_object_box to reset size_hint_min to zero when no child.
|
||||||
* Fix build of Ecore_Evas_Extn on Solaris.
|
* Fix build of Ecore_Evas_Extn on Solaris.
|
||||||
|
* Don't leak fd on exec.
|
||||||
* Fixed polygon rendering bug in GL backend when there are cutouts.
|
* Fixed polygon rendering bug in GL backend when there are cutouts.
|
||||||
|
|
|
@ -270,6 +270,26 @@ static gboolean _ecore_glib_idle_enterer_called;
|
||||||
static gboolean ecore_fds_ready;
|
static gboolean ecore_fds_ready;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Eina_Bool
|
||||||
|
_ecore_fd_close_on_exec(int fd)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_EXECVP
|
||||||
|
int flags;
|
||||||
|
|
||||||
|
flags = fcntl(fd, F_GETFD);
|
||||||
|
if (flags == -1)
|
||||||
|
return EINA_FALSE;
|
||||||
|
|
||||||
|
flags |= FD_CLOEXEC;
|
||||||
|
if (fcntl(fd, F_SETFD, flags) == -1)
|
||||||
|
return EINA_FALSE;
|
||||||
|
return EINA_TRUE;
|
||||||
|
#else
|
||||||
|
(void) fd;
|
||||||
|
return EINA_FALSE;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
_ecore_fd_valid(void)
|
_ecore_fd_valid(void)
|
||||||
{
|
{
|
||||||
|
@ -754,6 +774,7 @@ _ecore_main_loop_init(void)
|
||||||
if (epoll_fd < 0)
|
if (epoll_fd < 0)
|
||||||
WRN("Failed to create epoll fd!");
|
WRN("Failed to create epoll fd!");
|
||||||
epoll_pid = getpid();
|
epoll_pid = getpid();
|
||||||
|
_ecore_fd_close_on_exec(epoll_fd);
|
||||||
|
|
||||||
/* add polls on all our file descriptors */
|
/* add polls on all our file descriptors */
|
||||||
Ecore_Fd_Handler *fdh;
|
Ecore_Fd_Handler *fdh;
|
||||||
|
@ -789,6 +810,7 @@ _ecore_main_loop_init(void)
|
||||||
WRN("failed to create timer fd!");
|
WRN("failed to create timer fd!");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
_ecore_fd_close_on_exec(timer_fd);
|
||||||
ecore_timer_fd.fd = timer_fd;
|
ecore_timer_fd.fd = timer_fd;
|
||||||
ecore_timer_fd.events = G_IO_IN;
|
ecore_timer_fd.events = G_IO_IN;
|
||||||
ecore_timer_fd.revents = 0;
|
ecore_timer_fd.revents = 0;
|
||||||
|
|
|
@ -415,6 +415,9 @@ _ecore_pipe_add(Ecore_Pipe_Cb handler,
|
||||||
p->handler = handler;
|
p->handler = handler;
|
||||||
p->data = data;
|
p->data = data;
|
||||||
|
|
||||||
|
_ecore_fd_close_on_exec(fds[0]);
|
||||||
|
_ecore_fd_close_on_exec(fds[1]);
|
||||||
|
|
||||||
fcntl(p->fd_read, F_SETFL, O_NONBLOCK);
|
fcntl(p->fd_read, F_SETFL, O_NONBLOCK);
|
||||||
p->fd_handler = ecore_main_fd_handler_add(p->fd_read,
|
p->fd_handler = ecore_main_fd_handler_add(p->fd_read,
|
||||||
ECORE_FD_READ,
|
ECORE_FD_READ,
|
||||||
|
|
|
@ -186,6 +186,8 @@ Ecore_Fd_Handler *
|
||||||
const void *buf_data);
|
const void *buf_data);
|
||||||
void *_ecore_main_fd_handler_del(Ecore_Fd_Handler *fd_handler);
|
void *_ecore_main_fd_handler_del(Ecore_Fd_Handler *fd_handler);
|
||||||
|
|
||||||
|
Eina_Bool _ecore_fd_close_on_exec(int fd);
|
||||||
|
|
||||||
void _ecore_main_shutdown(void);
|
void _ecore_main_shutdown(void);
|
||||||
|
|
||||||
#if defined (_WIN32) || defined (__lv2ppu__) || defined (HAVE_EXOTIC)
|
#if defined (_WIN32) || defined (__lv2ppu__) || defined (HAVE_EXOTIC)
|
||||||
|
|
|
@ -205,6 +205,26 @@ ecore_con_info_mcast_listen(Ecore_Con_Server *svr,
|
||||||
return ecore_con_info_get(svr, done_cb, data, &hints);
|
return ecore_con_info_get(svr, done_cb, data, &hints);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Eina_Bool
|
||||||
|
_ecore_fd_close_on_exec(int fd)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_EXECVP
|
||||||
|
int flags;
|
||||||
|
|
||||||
|
flags = fcntl(fd, F_GETFD);
|
||||||
|
if (flags == -1)
|
||||||
|
return EINA_FALSE;
|
||||||
|
|
||||||
|
flags |= FD_CLOEXEC;
|
||||||
|
if (fcntl(fd, F_SETFD, flags) == -1)
|
||||||
|
return EINA_FALSE;
|
||||||
|
return EINA_TRUE;
|
||||||
|
#else
|
||||||
|
(void) fd;
|
||||||
|
return EINA_FALSE;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
EAPI int
|
EAPI int
|
||||||
ecore_con_info_get(Ecore_Con_Server *svr,
|
ecore_con_info_get(Ecore_Con_Server *svr,
|
||||||
Ecore_Con_Info_Cb done_cb,
|
Ecore_Con_Info_Cb done_cb,
|
||||||
|
@ -220,6 +240,9 @@ ecore_con_info_get(Ecore_Con_Server *svr,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_ecore_fd_close_on_exec(fd[0]);
|
||||||
|
_ecore_fd_close_on_exec(fd[1]);
|
||||||
|
|
||||||
cbdata = calloc(1, sizeof(CB_Data));
|
cbdata = calloc(1, sizeof(CB_Data));
|
||||||
if (!cbdata)
|
if (!cbdata)
|
||||||
{
|
{
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
|
||||||
#include "ecore_file_private.h"
|
#include "ecore_file_private.h"
|
||||||
|
|
||||||
|
@ -49,11 +50,20 @@ int
|
||||||
ecore_file_monitor_backend_init(void)
|
ecore_file_monitor_backend_init(void)
|
||||||
{
|
{
|
||||||
int fd;
|
int fd;
|
||||||
|
#ifdef HAVE_EXECVP
|
||||||
|
int flags;
|
||||||
|
#endif
|
||||||
|
|
||||||
fd = inotify_init();
|
fd = inotify_init();
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
#ifdef HAVE_EXECVP
|
||||||
|
flags = fcntl(fd, F_GETFD);
|
||||||
|
flags |= FD_CLOEXEC;
|
||||||
|
fcntl(fd, F_SETFD, flags);
|
||||||
|
#endif
|
||||||
|
|
||||||
_fdh = ecore_main_fd_handler_add(fd, ECORE_FD_READ, _ecore_file_monitor_inotify_handler,
|
_fdh = ecore_main_fd_handler_add(fd, ECORE_FD_READ, _ecore_file_monitor_inotify_handler,
|
||||||
NULL, NULL, NULL);
|
NULL, NULL, NULL);
|
||||||
if (!_fdh)
|
if (!_fdh)
|
||||||
|
|
|
@ -156,9 +156,20 @@ eina_mmap_safety_enabled_set(Eina_Bool enabled)
|
||||||
/* no zero page device - open it */
|
/* no zero page device - open it */
|
||||||
if (_eina_mmap_zero_fd < 0)
|
if (_eina_mmap_zero_fd < 0)
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_EXECVP
|
||||||
|
int flags;
|
||||||
|
#endif
|
||||||
|
|
||||||
_eina_mmap_zero_fd = open("/dev/zero", O_RDWR);
|
_eina_mmap_zero_fd = open("/dev/zero", O_RDWR);
|
||||||
/* if we don;'t have one - fail to set up mmap safety */
|
/* if we don;'t have one - fail to set up mmap safety */
|
||||||
if (_eina_mmap_zero_fd < 0) return EINA_FALSE;
|
if (_eina_mmap_zero_fd < 0) return EINA_FALSE;
|
||||||
|
|
||||||
|
#ifdef HAVE_EXECVP
|
||||||
|
flags = fcntl(_eina_mmap_zero_fd, F_GETFD);
|
||||||
|
flags |= FD_CLOEXEC;
|
||||||
|
fcntl(_eina_mmap_zero_fd, F_SETFD, flags);
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
/* set up signal handler for SIGBUS */
|
/* set up signal handler for SIGBUS */
|
||||||
sa.sa_sigaction = _eina_mmap_safe_sigbus;
|
sa.sa_sigaction = _eina_mmap_safe_sigbus;
|
||||||
|
|
|
@ -161,11 +161,20 @@ _eio_inotify_handler(void *data EINA_UNUSED, Ecore_Fd_Handler *fdh)
|
||||||
void eio_monitor_backend_init(void)
|
void eio_monitor_backend_init(void)
|
||||||
{
|
{
|
||||||
int fd;
|
int fd;
|
||||||
|
#ifdef HAVE_EXECVP
|
||||||
|
int flags;
|
||||||
|
#endif
|
||||||
|
|
||||||
fd = inotify_init();
|
fd = inotify_init();
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
return ;
|
return ;
|
||||||
|
|
||||||
|
#ifdef HAVE_EXECVP
|
||||||
|
flags = fcntl(fd, F_GETFD);
|
||||||
|
flags |= FD_CLOEXEC;
|
||||||
|
fcntl(fd, F_SETFD, flags);
|
||||||
|
#endif
|
||||||
|
|
||||||
_inotify_fdh = ecore_main_fd_handler_add(fd, ECORE_FD_READ, _eio_inotify_handler, NULL, NULL, NULL);
|
_inotify_fdh = ecore_main_fd_handler_add(fd, ECORE_FD_READ, _eio_inotify_handler, NULL, NULL, NULL);
|
||||||
if (!_inotify_fdh)
|
if (!_inotify_fdh)
|
||||||
{
|
{
|
||||||
|
|
|
@ -27,6 +27,26 @@ struct _Evas_Event_Async
|
||||||
Evas_Callback_Type type;
|
Evas_Callback_Type type;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Eina_Bool
|
||||||
|
_evas_fd_close_on_exec(int fd)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_EXECVP
|
||||||
|
int flags;
|
||||||
|
|
||||||
|
flags = fcntl(fd, F_GETFD);
|
||||||
|
if (flags == -1)
|
||||||
|
return EINA_FALSE;
|
||||||
|
|
||||||
|
flags |= FD_CLOEXEC;
|
||||||
|
if (fcntl(fd, F_SETFD, flags) == -1)
|
||||||
|
return EINA_FALSE;
|
||||||
|
return EINA_TRUE;
|
||||||
|
#else
|
||||||
|
(void) fd;
|
||||||
|
return EINA_FALSE;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
evas_async_events_init(void)
|
evas_async_events_init(void)
|
||||||
{
|
{
|
||||||
|
@ -43,6 +63,9 @@ evas_async_events_init(void)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_evas_fd_close_on_exec(filedes[0]);
|
||||||
|
_evas_fd_close_on_exec(filedes[1]);
|
||||||
|
|
||||||
_fd_read = filedes[0];
|
_fd_read = filedes[0];
|
||||||
_fd_write = filedes[1];
|
_fd_write = filedes[1];
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
#include <unistd.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
|
||||||
#include <Eina.h>
|
#include <Eina.h>
|
||||||
|
@ -86,6 +87,9 @@ _server_connect(void)
|
||||||
{
|
{
|
||||||
int s, len;
|
int s, len;
|
||||||
struct sockaddr_un remote;
|
struct sockaddr_un remote;
|
||||||
|
#ifdef HAVE_EXECVP
|
||||||
|
int flags;
|
||||||
|
#endif
|
||||||
|
|
||||||
if ((s = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
|
if ((s = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
|
||||||
{
|
{
|
||||||
|
@ -93,12 +97,19 @@ _server_connect(void)
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_EXECVP
|
||||||
|
flags = fcntl(s, F_GETFD);
|
||||||
|
flags |= FD_CLOEXEC;
|
||||||
|
fcntl(s, F_SETFD, flags);
|
||||||
|
#endif
|
||||||
|
|
||||||
remote.sun_family = AF_UNIX;
|
remote.sun_family = AF_UNIX;
|
||||||
_socket_path_set(remote.sun_path);
|
_socket_path_set(remote.sun_path);
|
||||||
len = strlen(remote.sun_path) + sizeof(remote.sun_family);
|
len = strlen(remote.sun_path) + sizeof(remote.sun_family);
|
||||||
if (connect(s, (struct sockaddr *)&remote, len) == -1)
|
if (connect(s, (struct sockaddr *)&remote, len) == -1)
|
||||||
{
|
{
|
||||||
ERR("connect");
|
ERR("connect");
|
||||||
|
close(s);
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue