Commit Graph

25 Commits

Author SHA1 Message Date
Cedric BAIL 2894a2e3c3 ecore_file: on shutdown properly set to NULL to avoid confusion when cycling init/shutdown. 2018-05-24 16:02:20 -07:00
Yeshwanth Reddivari 9c191d3890 ecore_file: modify check for wd in file monitor del
Summary:
Make checks consistent in ecore_file_monitor_backend_del.
inotify_add_watch can return 0 as well on success.
So, even if wd is 0, inotify_rm_watch need to be invoked.

Reviewers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5770

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2018-02-14 12:47:40 -08:00
Mike Blumenkrantz 7927cfefe3 ecore-file: make monitoring truly fork-safe
add a fork reset callback and attempt to preserve existing monitors
during reset

@fix
2018-02-02 16:59:44 -05:00
WooHyun Jung 9fc1dd1a4e ecore_file_monitor: replace EINA_LIST_FOREACH to EINA_LIST_FOREACH_SAFE
If ecore_file_monitor_del is called inside the file monitor callback function,
eina_list found from monitor_hash would be freed. (You can check this inside
eina_hash_list_remove.)
Then, EINA_LIST_FOREACH makes one more for loop with invalid eina_list pointer.

EINA_LIST_FOREACH_SAFE can prevent from this problem.
2018-01-15 13:54:01 +09:00
Mike Blumenkrantz 11e92cdc86 ecore-file: do not emit events when an inotify watch is removed
???????????????????????????????????????????????????????????????????????????????

@fix
2017-10-03 13:34:22 -04:00
Cedric BAIL 214e22bf72 ecore_file: use new API eina_file_close_on_exec. 2017-04-18 16:56:18 -07:00
Jean Guyomarc'h 8bbab0d015 ecore_file: fix memory leak
@fix
2016-05-06 22:18:57 +02:00
Carsten Haitzler bbcde33f93 fix efreet/file monitor stringshare optimization
fixes e4d815dc48 that i just put in a
few days back - it's a good idea to copy the string into your buffer
to use it.. not just 0 terminate it. :)
2016-04-23 23:45:28 +09:00
Carsten Haitzler e4d815dc48 efreetd - reduce memory usage by using stringshare much more
lots of long paths for monitoring file paths for icons etc. are in
memory for efreetd. this reduces that memory by sharing them much more.

@optimization
2016-04-23 23:07:48 +09:00
Mike Blumenkrantz ee5c81b736 ecore-file: use hash list for inotify monitor tracking
inotify reuses watches for multiple instances on the same file, so
keeping a multimap here is necessary to avoid hash collision

fix T2360
2015-04-23 08:55:35 -04:00
Mike Blumenkrantz ce15918593 ecore-file: use hash for finding monitors
this should hugely improve the speed of file monitor event processing;
in my test case, 800,000+ monitors were present and the application was
entirely unable to process them
2015-04-09 20:01:18 -04:00
Chris Michael fc2fbcc7b8 ecore-file: Fix formatting
Summary: No functional changes, just formatting

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-11-03 08:13:32 -05:00
Jean-Philippe Andre 8d9c6c0a00 inotify: Fix safety after read in 3 places
Fixes Coverity issues:
 - CID 1039565
 - CID 1039566
2014-10-28 10:54:51 +09:00
Carsten Haitzler 555df8f510 Revert "fix allocator sizeof operand mismatch reported by clang"
This reverts commit 955cc579d4.

why? wrong. no. and it breaks actual execution/functioning. segv land
2014-01-09 10:02:26 +09:00
Jihoon Kim 955cc579d4 fix allocator sizeof operand mismatch reported by clang
https://build.enlightenment.org/job/nightly_efl_clang_x86_64/lastSuccessfulBuild/artifact/scan-build/build/2014-01-07-1/report-QL6MiM.html#EndPath
https://build.enlightenment.org/job/nightly_efl_clang_x86_64/lastSuccessfulBuild/artifact/scan-build/build/2014-01-07-1/report-a2l0Ci.html#EndPath
https://build.enlightenment.org/job/nightly_efl_clang_x86_64/lastSuccessfulBuild/artifact/scan-build/build/2014-01-07-1/report-McvqNf.html#EndPath
2014-01-09 09:10:02 +09:00
Sebastian Dransfeld 752d627a93 ecore_x: Fix buffer overrun
Use strncpy to prevent buffer overrun on buf, and '\0' terminate.

Fixes CID 1039584
2013-12-07 21:11:34 +01:00
Ryuan Choi 2f322e1273 ecore_file: Print more informative message when inotify_add_watch was failed.
inotify_add_watch can be failed because of several reasons.
2013-11-25 19:21:52 +09:00
Chris Michael 4c9c522337 Check for valid fd returned from ecore_main_fd_handler_fd_get before
potentially passing -1 to the read() function.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-08-05 11:40:02 +01:00
Chris Michael 65fc207951 Don't pass negative values to close:
ecore_main_fd_handler_fd_get can return -1, so check return value
before passing to close().

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-08-05 11:36:24 +01:00
Carsten Haitzler 4451625301 fix clang sizeof complaint 2013-07-16 20:45:24 +09:00
Cedric Bail 8d5e33077e efl: use HAVE_FCNTL around call to fcntl. 2013-03-10 23:10:27 +09:00
Cedric BAIL 88ba56d9d5 efl: don't leak fd on exec.
SVN revision: 80434
2012-12-07 11:01:41 +00:00
Gustavo Sverzut Barbieri 62bb4646c9 efl/ecore_file: refactor to be more like eio in providing backends.
instead of the previous mess, just define the functions with common
names and call the backend that was compiled in, similar to what eio
does.

also do not be silent on errors, use eina_safety_checks to issue warnings.



SVN revision: 80360
2012-12-06 13:38:34 +00:00
Gustavo Sverzut Barbieri 6a5eaacc6a efl: common inotify checks, simplified.
Another try to make inotify checks more common.

This time uses AC_CHECK_HEADERS() as for others, that already define
HAVE_SYS_INOTIFY_H, then uses that.

I still kept AM_CONDITIONAL([HAVE_INOTIFY]) because I plan to convert
ecore_file to the same, smarter, method that is used in eio (compiling
the file depending on the backend.



SVN revision: 80358
2012-12-06 13:02:59 +00:00
Vincent Torri 7d6010b12c merge: add escape ecore, fix several bugs
SVN revision: 79995
2012-12-02 22:35:45 +00:00