CrashReporter.cpp: fix stderr conflict (#12440)

This commit is contained in:
SASANO Takayoshi 2025-11-25 05:11:15 +09:00 committed by GitHub
parent 2b0fd417d3
commit 3d7ea9c02f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -76,15 +76,15 @@ void NCrashReporter::createAndSaveCrash(int sig) {
reportPath += ".txt";
{
CBufFileWriter<64> stderr(2);
stderr += "Hyprland has crashed :( Consult the crash report at ";
CBufFileWriter<64> stderr_out(STDERR_FILENO);
stderr_out += "Hyprland has crashed :( Consult the crash report at ";
if (!reportPath.boundsExceeded()) {
stderr += reportPath.getStr();
stderr_out += reportPath.getStr();
} else {
stderr += "[ERROR: Crash report path does not fit into memory! Check if your $CACHE_HOME/$HOME is too deeply nested. Max 255 characters.]";
stderr_out += "[ERROR: Crash report path does not fit into memory! Check if your $CACHE_HOME/$HOME is too deeply nested. Max 255 characters.]";
}
stderr += " for more information.\n";
stderr.flush();
stderr_out += " for more information.\n";
stderr_out.flush();
}
reportFd = open(reportPath.getStr(), O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR);