logo

oasis

Own branch of Oasis Linux (upstream: <https://git.sr.ht/~mcf/oasis/>) git clone https://anongit.hacktivis.me/git/oasis.git

0005-Use-strerror-instead-of-GNU-m-format-specifier.patch (1066B)


  1. From 05925c2cbd72dc84a825a8a618efb5975b9d75ea Mon Sep 17 00:00:00 2001
  2. From: Michael Forney <mforney@mforney.org>
  3. Date: Sun, 16 Aug 2020 17:16:31 -0700
  4. Subject: [PATCH] Use strerror instead of GNU %m format specifier
  5. ---
  6. ls-kernel.c | 5 +++--
  7. 1 file changed, 3 insertions(+), 2 deletions(-)
  8. diff --git a/ls-kernel.c b/ls-kernel.c
  9. index 4199402..e75f9af 100644
  10. --- a/ls-kernel.c
  11. +++ b/ls-kernel.c
  12. @@ -6,6 +6,7 @@
  13. * Can be freely distributed and used under the terms of the GNU GPL.
  14. */
  15. +#include <errno.h>
  16. #include <stdio.h>
  17. #include <string.h>
  18. #include <unistd.h>
  19. @@ -124,12 +125,12 @@ show_kernel_init(void)
  20. {
  21. f = fopen(name, "r");
  22. if (!f)
  23. - die("Cannot open pcimap file %s: %m", name);
  24. + die("Cannot open pcimap file %s: %s", name, strerror(errno));
  25. }
  26. else
  27. {
  28. if (uname(&uts) < 0)
  29. - die("uname() failed: %m");
  30. + die("uname() failed: %s", strerror(errno));
  31. name = alloca(64 + strlen(uts.release));
  32. sprintf(name, "/lib/modules/%s/modules.pcimap", uts.release);
  33. f = fopen(name, "r");
  34. --
  35. 2.28.0