Skip to content
  • Philip Withnall's avatar
    gutils: Split out building of g_get_home_dir() path · b7637268
    Philip Withnall authored
    
    
    Otherwise we can have problems calling g_get_home_dir() from within a
    g_build_*_dir() function elsewhere in gutils.c:
     • There will be a deadlock due to trying to recursively acquire the
       g_utils_global lock.
     • A stale g_home_dir value may be used if a test harness has called
       g_set_user_dirs() in the interim.
    
    Fix that by splitting the code to find/construct the home path out of
    g_get_home_dir() into g_build_home_dir(), the same way it’s split for
    the other g_get_*() functions. Call g_build_home_dir() from any call
    site where the g_utils_global lock is held.
    
    Signed-off-by: default avatarPhilip Withnall <withnall@endlessm.com>
    b7637268