CVSROOT: /cvs Module name: ports Changes by: rob...@cvs.openbsd.org 2019/02/19 07:53:17
Modified files: devel/glib2 : Makefile devel/glib2/patches: patch-glib_gutils_c Added files: devel/glib2/patches: patch-glib_gfileutils_c Log message: Help programs using unveil(2) by fixing and modyfing the code of glib by doing the following: - Modify the g_mkdir_with_parents() function so that it will try to create the specified path directly and if g_mkdir() fails, it will fall back to walking the path one by one. - In case of walking the path one by one, ignore ENOENT for all path elements except for the last one, because g_mkdir_with_parents() will fail with programs using unveil(2) (with statlie removed). Ignoring ENOENT is completely fine because we really only care about the last element of the path and this modification will also have the benefit of avoiding useless stat calls - My initial tests show that by just firing up a simple file dialog this modification saves an average of 110 system calls, now imagine running GNOME or Chrome with that. Each and every program using glib's g_mkdir_with_parents() before opening the needed files (most do this) will benefit from this. - Check if the XDG directories actually exist before adding them to the list used by file dialogs. This is also useful if you are not running a complete desktop environment and you simply do not have these directories. ok ajacoutot@