Created attachment 10856 [details] Log hash file creation failure. CAVEAT: The uploaded patch was created during the work to support -gsplit-dwarf (FissionDwarf) of GCC. (See bug 10005 ) Some of the patches have interdependence and if earlier patches are not applied, the later ones may fail. I will re-create patches appropriately depending on how an earlier patch is incorporated (or dropped). The whole list of broken patches below were uploaded in bug 10005 for convenience, but now separate bugzilla is filed to follow up on each of it (except for the main -gsplit-dwarf support, in bug 10005). 0001-Harden-logging-perror-replaced-with-cc_log-and-fatal.patch *0002-hash-file-creation-failure-is-recorded-now.patch 0003-Use-x_unlink-instead-of-unlink-per-HACKING.txt.patch 0004-make-sure-the-result-of-stat-call-is-checked.patch 0005-Enhance-log-message-add-prefix-var.-name-and-a-few-a.patch 0006-warning-about-missing-x_unlinks-when-get_file_from_c.patch 0007-Support-for-gsplit-dwarf.patch 0008-Missing-copy-of-diagnostics-file-in-case-of-failure.patch What this entry is about: Short explanation. 2: 0002-hash-file-creation-failure-is-recorded-now.patch hash file creation failure is recorded now. This is to make error reporting more robust. This is actually not related to -gsplit-dwarf and so I am filing this a separate bugzilla. This is to hash.c only and so can be independent of main ccache.c change to support -gsplit-dwarf. (see bug 10005 TIA
Thanks! > hash file creation failure is recorded now. Minor, but still: Please start the summary line with a capital letter and don't end it with a period (it's a title, and titles don't end with a period). > + cc_log("hash file creation (%s) failed\n", fname); /* to catch strange errors */ From the message, it sounds like ccache failed to create a hash file, but the error is about reading, not creating, right? So perhaps reformulate as "Failed to open %s: %s" (with strerror(errno))? Also, I don't think the "to catch strange errors" comment improves code readbility.
(In reply to Joel Rosdahl from comment #1) Thank you for your comment. I will create a new patch. TIA
Created attachment 10881 [details] Log failure of opening hash file (take 2) Here is the modified patch. I changed the message according to your suggestion and took out the comment. TIA
I edited the title of this bugzilla. (Not creation, but simple open).
Applied, thanks! (I took the liberty of editing the commit message slightly.)
Included in v3.2.2.