0027-harness-Print-better-error-messages-on-error-conditi.patch 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. From 6cd92a8216afcd1d3f6ff90cc150ba150800b11d Mon Sep 17 00:00:00 2001
  2. From: Guillem Jover <guillem@hadrons.org>
  3. Date: Wed, 21 Aug 2019 05:29:50 +0200
  4. Subject: [PATCH libaio 27/28] harness: Print better error messages on error
  5. conditions in 22.t
  6. These should help diagnose problems when dealing with error failures.
  7. In particular this helped distinguish the problem with io_pgetevents()
  8. not being implemented and it failing due to the sigset_t layout bug.
  9. Signed-off-by: Guillem Jover <guillem@hadrons.org>
  10. [JEM: fix up 80 columns violations]
  11. Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
  12. ---
  13. harness/cases/22.t | 15 +++++++++------
  14. 1 file changed, 9 insertions(+), 6 deletions(-)
  15. diff --git a/harness/cases/22.t b/harness/cases/22.t
  16. index b13024e..c47140d 100644
  17. --- a/harness/cases/22.t
  18. +++ b/harness/cases/22.t
  19. @@ -76,7 +76,7 @@ int test_main(void)
  20. ret = io_setup(1, &ctx);
  21. if (ret) {
  22. - printf("child: io_setup failed\n");
  23. + printf("child: io_setup failed: %s\n", strerror(-ret));
  24. return 1;
  25. }
  26. @@ -86,7 +86,7 @@ int test_main(void)
  27. /* if poll isn't supported, skip the test */
  28. if (ret == -EINVAL)
  29. return 3;
  30. - printf("child: io_submit failed\n");
  31. + printf("child: io_submit failed: %s\n", strerror(-ret));
  32. return 1;
  33. }
  34. @@ -99,7 +99,8 @@ int test_main(void)
  35. } while (ret == 0);
  36. if (ret != -EINTR) {
  37. - printf("child: io_pgetevents did not set errno to EINTR\n");
  38. + printf("child: io_pgetevents did not set errno to "
  39. + "EINTR: %s\n", strerror(-ret));
  40. return 1;
  41. }
  42. @@ -117,7 +118,7 @@ int test_main(void)
  43. ret = io_setup(1, &ctx);
  44. if (ret) {
  45. - printf("parent: io_setup failed\n");
  46. + printf("parent: io_setup failed: %s\n", strerror(-ret));
  47. return 1;
  48. }
  49. @@ -126,7 +127,8 @@ int test_main(void)
  50. /* if poll isn't supported, skip the test */
  51. if (ret == -EINVAL)
  52. return 3;
  53. - printf("parent: io_submit failed with %d\n", ret);
  54. + printf("parent: io_submit failed with %d: %s\n",
  55. + ret, strerror(-ret));
  56. return 1;
  57. }
  58. @@ -134,7 +136,8 @@ int test_main(void)
  59. ret = io_pgetevents(ctx, 1, 1, &ev, NULL, &sigmask);
  60. if (ret < 0) {
  61. - printf("parent: io_pgetevents failed\n");
  62. + printf("parent: io_pgetevents failed: %s\n",
  63. + strerror(-ret));
  64. return 1;
  65. }
  66. if (ret != 1) {
  67. --
  68. 2.26.0.292.g33ef6b2f38