]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Handle incapability of determining home directory more gracefully
authorJoel Rosdahl <joel@rosdahl.net>
Sun, 24 May 2020 09:44:50 +0000 (11:44 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Sun, 24 May 2020 18:49:09 +0000 (20:49 +0200)
src/legacy_util.cpp

index d4ccf337d1a3df4c9c3a645b1108ad5af0f90f93..bd0fde6ddbc232506927e4cea38818ffe889a4e8 100644 (file)
@@ -603,7 +603,8 @@ create_tmp_file(char** fname, const char* mode)
   return file;
 }
 
-// Return current user's home directory, or NULL if it can't be determined.
+// Return current user's home directory, or throw FatalError if it can't be
+// determined.
 const char*
 get_home_directory()
 {
@@ -625,7 +626,7 @@ get_home_directory()
     }
   }
 #endif
-  return nullptr;
+  fatal("Could not determine home directory from $HOME or getpwuid(3)");
 }
 
 // Check whether s1 and s2 have the same executable name.