Commit Graph

107 Commits

Author SHA1 Message Date
Carsten Haitzler ec80ef2ce4 efreetd - use putenv for better porting to weird os's 2022-01-09 21:14:23 +00:00
Carsten Haitzler 29a72e9c6c efreetd - add more logging for what efreetd says to clients 2020-07-24 23:22:47 +01:00
Carsten Haitzler b01b219017 efreetd - log the cache runs and when they launch, show data, exit 2020-07-24 23:02:16 +01:00
Carsten Haitzler 52ec7be013 efreetd - dont confuse log file file handle and log math func
better not to use the same symbol...
2020-07-24 21:22:33 +01:00
Carsten Haitzler 5e4f81bb6f efreet caceh - fix coverity report
fix CID 1429935
2020-06-19 00:56:08 +01:00
Carsten Haitzler a5b84c6c6e efreetd - cache - add more statinfo work around 0 mtime distros
some distros 9notably in this case nixos) want to do reproducible
builds. to them this means going around setting mtime for all files to
0. this means efreetd not only thinks mtime is invalid/stupid (0 is
generally just that as midnight on jan 1 1970 is not exactly a
sensible dare for a modified timestamp of a file as no filesystem with
any sanity will have not been modified since that time), but it keeps
mtime at 0 even when things update. this totally breaks efreetd that
expects to find mtime increases over time as things change. it's
necessary because it has to perform a "are mu caches up to date" scan
of all file data it caches and it needs to know if it should rebuild
something based on this.

so this does a few things:

1. it makes mtime have to be an exact match to the cache, not cache
mtime >= file mtime. so any change forward or back is an inavlidation.
2. it now also uses ctime, mode, size, uid, gid, block count and if a
symlink, the sha1 of the symlink path in addition and any change to
these == invalid.

this adds a lot of code and changes how dirs get scanned a bit but it
means it can pick up changes on these 0 mtime distros.

interestingly the policy of mtime being 0 is to have a reprodcible fs
... but ctime still changes and is > 0, as does inode info, so it's
not actually possible to have it totally work... but they try still,
so this is a fix for that problem.

whilst i was doing thisi also noticed efreetd re-red dirs many times
due to icon theme inhritance. i also fixed that to do a LOT less
syscalls by only scanning a dir once as i was rejigging the scanning
code at the time anyway. this should optimize thr scan costs at
efreetd startup too.

@fix
@opt
2020-06-18 11:13:52 +01:00
Carsten Haitzler 03164bfacf efreet - disable strict as this makes things less functional... 2020-04-16 13:33:37 +01:00
Carsten Haitzler b376c2a902 efreet - look in /usr/local/share/pixmaps too 2020-04-16 13:04:03 +01:00
Carsten Haitzler ee6cc91a03 eina - fix eina_strndup test passing 2020-01-15 19:23:44 +00:00
Carsten Haitzler 7096634a39 efreet - consider ctime changes as changes too
some distros do odd things with source desktop files and set their
mtime timestamps to 0... thus we can't tell that there is a change.
thier ctimes do change, so consider the newer of either of these as
the modification time to not miss updates

@fix
2019-11-16 13:02:10 +00:00
Carsten Haitzler 08ea94e9f9 efreetd - timeout in 2 not 10sec to have fewer hangs on shutdown/exit 2019-06-06 13:52:20 +01:00
Vincent Torri 8db978aa4c include evil_private.h in last files, and disable symbolic links on Windows in a couple of files
Test Plan: compilation

Reviewers: zmike, raster, cedric

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8933
2019-05-22 07:59:05 -04:00
Vincent Torri a5267d3d9c remove Evil.h when not necessary, include evil_private.h when necessary
Test Plan: compilation

Reviewers: zmike, raster, cedric

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8925
2019-05-20 09:10:00 -04:00
Mike Blumenkrantz eeddb16b76 meson: add intl to efreet all binary deps
this must be explicitly added for windows builds

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D8725
2019-05-06 17:00:48 +02:00
Wonki Kim fa97d86d0f efreetd: remove a tentative global variable definition
Summary:
there is a global variable that is defined tentatively.
this patch modify it not to be tentitive explictly.

Reviewers: raster, cedric, zmike

Reviewed By: raster, zmike

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8551
2019-04-04 09:14:08 -04:00
Carsten Haitzler ae6a26b8ed efreet - fix warnings on windows to do with size casting
no actual bug - just warnings
2019-01-15 12:26:42 +00:00
Carsten Haitzler db3fe9b03f efreet mime cache - expand buffer to avoid truncation by snprintf 2018-11-09 12:18:59 +00:00
Carsten Haitzler 02105219a8 efreetd - warn - expand buffer to avoid truncation by snprintf 2018-11-09 12:18:59 +00:00
Marcel Hollerbach 46d464e5bf here comes meson
a new shiny buildtool that currently completes in the total of ~ 4 min..
1 min. conf time
2:30 min. build time
Where autotools takes:
1:50 min. conf time
3:40 min. build time.

meson was taken because it went quite good for enlightenment, and is a traction gaining system that is also used by other mayor projects. Additionally, the DSL that is defined my meson makes the configuration of the builds a lot easier to read.

Further informations can be gathered from the README.meson

Right now, bindings & windows support are missing.

It is highly recommented to use meson 0.48 due to optimizations in meson
that reduced the time the meson call would need.

Co-authored-by: Mike Blumenkrantz <zmike@samsung.com>

Differential Revision: https://phab.enlightenment.org/D7012
Depends on D7011
2018-10-02 17:22:50 +02:00
Carsten Haitzler f4ce0d1b95 efreet icon cache creation binary - remove redundent check
found by PVS studio
2017-07-31 11:41:10 +09:00
Carsten Haitzler 8786449704 efreetd cache create - fix reallocs to bail on out of memory cleanly 2017-07-24 13:37:57 +09:00
Carsten Haitzler fceb86c865 efreetd cache - fix leak of strbuf when error conditions abort save
fix CID 1374951
2017-07-23 18:11:26 +09:00
Carsten Haitzler 91878f72f1 efreetd cache - handle queue case leaking strbuf
fix CID 1374954
2017-07-23 18:09:39 +09:00
Carsten Haitzler 53d6486ffa efreet icon cache create bin - check realloc results and handle
@fix
2017-07-16 15:56:02 +09:00
Carsten Haitzler fef4c2c292 efreet cache create binary - check realloc results and handle failure
@fix
2017-07-16 15:56:02 +09:00
Bryce Harrington a7c1edc44f efreet: Fix failure to save list data to output
Summary:
This fixes a typo in the fix 55676b33, which introduced an invalid early
return from the save_list function, preventing it from outputing the
list data to the file.

@fix CID1375005, CID1375004

Reviewers: jpeg

Reviewed By: jpeg

Subscribers: stefan_schmidt, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4873
2017-05-12 11:08:30 +02:00
Stefan Schmidt 55676b335c efreet: free the allocated buffer before returning
This fixes the commit 169a08c03a (efreetd:
BSD optimizations). Coverity rightly pointed out six different leaks of
various buffers on error paths.

CID: 1374949 1374950 1374951 1374952 1374953 1374954
2017-05-11 09:34:53 +02:00
Al Poole 169a08c03a efreetd: BSD optimizations.
Summary: Related to ticket T5475.

Reviewers: raster, cedric

Subscribers: jpeg, cedric, raster

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-05-10 12:26:08 -07:00
Carsten Haitzler d9ad9b585a efreetd - make efreetd use eio and not ecore_file_monitor for monitoring
this should fix T5130 - freebsd's efreetd polling regularly

@fix
2017-04-23 21:17:40 +09:00
Carsten Haitzler 39baea1053 efreet cache create - check return values of i/o funcs
this is pretty harmless but it checks these and at least reports an
error...

this fixes CID 1361941 + 1361940

@fix
2017-04-18 17:30:50 +09:00
Ivan Furs 3d6212b8f2 removing duplicates winsock2.h
Summary:
winsock2.h included in Ecore.h
But Ecore.h ' is included in
/bin/efreet/efreet_desktop_cache_create.c
src/bin/efreet/efreet_mime_cache_create.c
src/tests/ecore_con/ecore_con_test_efl_net_ip_address.c

Reviewers: NikaWhite, cedric, raster, an.kroitor

Reviewed By: raster

Subscribers: artem.popov, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4687
2017-03-07 13:59:54 +09:00
Carsten Haitzler 015174f4a4 efreetd - remove unused var 2017-02-09 19:07:09 +09:00
Carsten Haitzler 0ea4d0d821 efreetd cache - use eina home env get to centralize homedir fetching
this cleans up and improves a getenv that should really use eina
2017-02-09 18:38:28 +09:00
Carsten Haitzler 6b090a00b6 efreetd - dont use XDG_RUNTIME_DIR or EFREET_LOG env vars for setuid
if a setuid app needs efreet - it will not be able to contact the
users' efreetd and thus may spawn it's own... and thus we cant have
this now spawned efreetd using env vars inherited from the
unpriveleged etc. user, so ignore them.
2017-02-09 18:38:28 +09:00
Sungtaek Hong 3f0963f7b0 efreet_desktop: fix potential error in efreet_desktop_cache_create
Summary:
 - old_file_ids is freed but not set as NULL.
   If it goes to error code, old_file_ids will be freed again.

Reviewers: jpeg, cedric, Hermet

Reviewed By: Hermet

Subscribers: conr2d

Differential Revision: https://phab.enlightenment.org/D4467
2016-12-08 13:26:55 +09:00
Stefan Schmidt e1fd028081 efreetd: handle invalid fd in all cases
Very unlikely that we will get a -1 when opening /dev/null but you never know
what kind of system you are running on.

CID: 1361759
2016-12-05 17:07:39 +01:00
Carsten Haitzler 561f8eaa8f efreet - save about 240-300k or so of memory used by efreet mime
so efreet mime was loading a bunch of mime type info files, parsing
them on startup and allocating memory to store all this mime info -
globs, mimetype strings and more. all a big waste of memory as its
allocated on the heap per process where its the SAME data files loaded
every time.

so make an efreet mime cache file and a tool to create it from mime
files. mmap this file with all the hashes/strings in it so all that
data is mmaped once in memory and shared between all processes and it
is only paged in on demand - as actually read/needed so if your
process doesnt need to know about mime stuff.. it wont touch it anyway.

this saves about 240-300k or so of memory in my tests. this has not
covered the mime MAGIC files which still consume memory and are on the
heap. this is more complex so it will take more time to come up with a
nice file format for the data that is nicely mmaped etc.

@optimize
2016-08-23 12:04:06 +09:00
Carsten Haitzler 4a2f14638f efreetd - only open log file is env var is set to do so
set EFREETD_LOG to something to get efreetd to log. otherwise efretd
log files can end up rather larth and since they go in xdg_runtimedir
- thats mostly a ramdisk... they eat actual ram. so save a lot of
memory and only log if asked to.

@fix
2016-08-19 11:48:29 +09:00
Mike Blumenkrantz 50ab1a0e55 Revert "efreetd - reduce memory usage by using stringshare much more"
partially reverts e4d815dc48

this caused efreetd to crash almost immediately due to non-stringshared
strings being used in a stringshare-only hash data descriptor
2016-05-02 21:03:14 -04: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
Carsten Haitzler 5e6bdd6da9 efreetd - dont use netdb.sh as per man page on windows 2016-04-08 12:57:30 +09:00
Carsten Haitzler 09435e5e81 efreet - use eina tmp dir instead of /tmp dir
use eina_environment_tmp_get() for windows
2016-04-08 12:57:30 +09:00
Carsten Haitzler 978f416b8c efreetd - fix more cache path handling to live in the cache dir
follow on fixes from 5028a88077

@fix
2016-04-08 12:41:36 +09:00
Carsten Haitzler 5028a88077 efreet: fix tmp file/dir/log handling to not leave a mess and work
so efreets tmp file/cache/log file handling was broken, using
filenames in tmp and renaming them to a caceh dir that can be on
different filesystems. also log file should have been in a tmp dir ...
and subsidrs cache didnt get renamed properly at all and thus not
updated.

@fix
2016-04-08 12:13:42 +09:00
Jean Guyomarc'h 4521929d69 efreet: fix undeclared function
libgen is needed on OSX because it contains the prototype
of basename() which is required in the compiling unit.
The result of basename() was therefore implicitely converted into
an integer, which could leed to subtile issues.

@fix
2016-01-07 12:03:04 +01:00
Mike Blumenkrantz 06bb13e2f8 efreetd: send ipc for EFREET_EVENT_DESKTOP_CACHE_BUILD...always
since the conversion from dbus -> ecore-ipc, efreetd has failed to
notify when a cache build has completed, instead only sending the current
state of the desktop cache: not built

fix T2733

@fix
2015-12-23 13:40:48 -05:00
Mike Blumenkrantz 56469c55d9 efreet_icon_cache_create: null theme eet file to avoid double free
@fix
2015-12-16 13:40:00 -05:00
Vincent Torri 0497b9685c efl: add binary mode to open() calls
This allows better compatibility with Windows

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-05 21:06:04 +01:00
Carsten Haitzler 7236343701 fix efreetd to scan more subdirs for desktop and icon files
we miss desktop files for apps and stuff because we dont monitor too
deep a tree. this ups our tree depth to 10 levels.

@fix
2015-12-02 20:53:27 +09:00
Carsten Haitzler 5263e61585 efreet desktop tracking - fix monitoring of dirs of custom desktops
@fix

this is wrong - start monitoring every/any dir in which a desktop file
exists that we load a desktop file from. imagine you browse directories
in efm with lots of desktop files in them - we end up monitoring lots
of directories that we then rememebr and don't un-monitor. this
disables monitoring of dirs from which we load a .desktop file from to
fix this.
2015-12-02 20:53:27 +09:00