[PR #5871] [MERGED] modif: improve errExit error messages #5703

Closed
opened 2026-05-05 10:43:21 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netblue30/firejail/pull/5871
Author: @kmk3
Created: 6/28/2023
Status: Merged
Merged: 7/1/2023
Merged by: @kmk3

Base: masterHead: improve-errexit


📝 Commits (4)

  • 33fb2be Deduplicate calls similar to errExit
  • 1989a0f common.h: line-wrap errExit
  • e06c3e9 common.h: use func instead of FUNCTION
  • b963fe4 Improve errExit error messages

📊 Changes

31 files changed (+42 additions, -14 deletions)

View changed files

📝 config.mk.in (+1 -1)
📝 src/etc-cleanup/Makefile (+1 -0)
📝 src/fbuilder/Makefile (+1 -0)
📝 src/fbuilder/utils.c (+1 -3)
📝 src/fcopy/Makefile (+1 -0)
📝 src/fids/Makefile (+1 -0)
📝 src/firecfg/Makefile (+1 -0)
📝 src/firejail/Makefile (+1 -0)
📝 src/firejail/util.c (+1 -3)
📝 src/firemon/Makefile (+1 -0)
📝 src/fldd/Makefile (+1 -0)
📝 src/fnet/Makefile (+1 -0)
📝 src/fnetfilter/Makefile (+1 -0)
📝 src/fnettrace-dns/Makefile (+1 -0)
📝 src/fnettrace-icmp/Makefile (+1 -0)
📝 src/fnettrace-sni/Makefile (+1 -0)
📝 src/fnettrace/Makefile (+1 -0)
📝 src/fsec-optimize/Makefile (+1 -0)
📝 src/fsec-print/Makefile (+1 -0)
📝 src/fseccomp/Makefile (+1 -0)

...and 11 more files

📄 Description

Main changes:

  • Move msg to the end of errExit (right before perror(3p))
  • Include the full file path (within the repository)
  • Add "()" to function name for clarity

Before:

Error malloc: main.c:123 main: Cannot allocate memory

After:

Error src/firejail/main.c:123 main(): malloc: Cannot allocate memory

Note: This clarifies which is the exact file that the error message
comes from, as there are many source files with the same name. For
example:

$ git ls-files 'src/*/main.c' | wc -l
20

Kind of relates to #3325.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netblue30/firejail/pull/5871 **Author:** [@kmk3](https://github.com/kmk3) **Created:** 6/28/2023 **Status:** ✅ Merged **Merged:** 7/1/2023 **Merged by:** [@kmk3](https://github.com/kmk3) **Base:** `master` ← **Head:** `improve-errexit` --- ### 📝 Commits (4) - [`33fb2be`](https://github.com/netblue30/firejail/commit/33fb2bed58e9f4dfadd2f69f90e474fd46099419) Deduplicate calls similar to errExit - [`1989a0f`](https://github.com/netblue30/firejail/commit/1989a0f46ad11a235d6788f7fbed880cd02aad19) common.h: line-wrap errExit - [`e06c3e9`](https://github.com/netblue30/firejail/commit/e06c3e99d8d42d3422bf8ebf50fd500da1cf4ccf) common.h: use __func__ instead of __FUNCTION__ - [`b963fe4`](https://github.com/netblue30/firejail/commit/b963fe41ae2cd669e5819aded531375ddaebc8b2) Improve errExit error messages ### 📊 Changes **31 files changed** (+42 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `config.mk.in` (+1 -1) 📝 `src/etc-cleanup/Makefile` (+1 -0) 📝 `src/fbuilder/Makefile` (+1 -0) 📝 `src/fbuilder/utils.c` (+1 -3) 📝 `src/fcopy/Makefile` (+1 -0) 📝 `src/fids/Makefile` (+1 -0) 📝 `src/firecfg/Makefile` (+1 -0) 📝 `src/firejail/Makefile` (+1 -0) 📝 `src/firejail/util.c` (+1 -3) 📝 `src/firemon/Makefile` (+1 -0) 📝 `src/fldd/Makefile` (+1 -0) 📝 `src/fnet/Makefile` (+1 -0) 📝 `src/fnetfilter/Makefile` (+1 -0) 📝 `src/fnettrace-dns/Makefile` (+1 -0) 📝 `src/fnettrace-icmp/Makefile` (+1 -0) 📝 `src/fnettrace-sni/Makefile` (+1 -0) 📝 `src/fnettrace/Makefile` (+1 -0) 📝 `src/fsec-optimize/Makefile` (+1 -0) 📝 `src/fsec-print/Makefile` (+1 -0) 📝 `src/fseccomp/Makefile` (+1 -0) _...and 11 more files_ </details> ### 📄 Description Main changes: * Move msg to the end of errExit (right before perror(3p)) * Include the full file path (within the repository) * Add "()" to function name for clarity Before: Error malloc: main.c:123 main: Cannot allocate memory After: Error src/firejail/main.c:123 main(): malloc: Cannot allocate memory Note: This clarifies which is the exact file that the error message comes from, as there are many source files with the same name. For example: $ git ls-files 'src/*/main.c' | wc -l 20 Kind of relates to #3325. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror 2026-05-05 10:43:21 -06:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/firejail#5703
No description provided.