Page MenuHomePhabricator

eio: path and filename property should always remind accessible even in case of error.
ClosedPublic

Authored by cedric on Mar 13 2019, 2:58 PM.

Diff Detail

Repository
rEFL core/efl
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
cedric created this revision.Mar 13 2019, 2:58 PM
cedric updated this revision to Diff 20647.Mar 15 2019, 4:58 PM
cedric added a reviewer: YOhoho.

Rebase.

This commit does a little bit more than it describes. It also makes all the properties "direct_info", "mtime", "atime", "ctime", "is_dir", "is_lnk", "size", "stat" accessable. So as long as they have a value, this value is returned. Which also means when _eio_build_st is called twice, and the first one succeeds, and the second does not. Then the old value is returned i think ? All in all, should we make pd->st = NULL and pd->info = NULL; in case of an error ?

bu5hm4n requested changes to this revision.Mar 16 2019, 8:59 AM
This revision now requires changes to proceed.Mar 16 2019, 8:59 AM

This commit does a little bit more than it describes. It also makes all the properties "direct_info", "mtime", "atime", "ctime", "is_dir", "is_lnk", "size", "stat" accessable. So as long as they have a value, this value is returned. Which also means when _eio_build_st is called twice, and the first one succeeds, and the second does not. Then the old value is returned i think ? All in all, should we make pd->st = NULL and pd->info = NULL; in case of an error ?

All of this property where already doing an :

if (pd->error)
  return eina_value_error_new(pd->error);

So if we were able to get a proper value, we would return it first, then we would return a general error, before doing anything else. So I don't think it does more just it give a chance for some things to succeed without limiting things to just be in error.

bu5hm4n accepted this revision.Mar 21 2019, 2:31 AM

_eio_build_st is protecting itself from doing what I wrote above, it just feels a little bit fragile, since changing this would leave the world in parts, maybe make pd->st = NULL and pd->info = NULL; in case of an error ?

This revision is now accepted and ready to land.Mar 21 2019, 2:31 AM

_eio_build_st is protecting itself from doing what I wrote above, it just feels a little bit fragile, since changing this would leave the world in parts, maybe make pd->st = NULL and pd->info = NULL; in case of an error ?

I kind of want to avoid that as this would mean that even when you were able to fetch some information you would make the entire object fail. I am still not sure on how to make it partially fail and be able to fetch the data that aren't failing after there was a fail.

cedric updated this revision to Diff 20996.Mar 27 2019, 2:28 PM

Rebase.

This revision was automatically updated to reflect the committed changes.