0003-dc-fix-exit-code-of-q-command.patch 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. From 7243037e63bff34b08bb1c993787b98dee585b2f Mon Sep 17 00:00:00 2001
  2. From: Li Zhou <li.zhou@windriver.com>
  3. Date: Thu, 27 Jun 2019 13:10:47 +0800
  4. Subject: [PATCH] dc: fix exit code of q command
  5. The exit code for "echo q | dc" is 1 for dc-1.4.1;
  6. while the exit code for "echo q | dc" is 0 for dc-1.4.
  7. Here is the answer from ken@gnu.org:
  8. dc-1.4 was right. There was a rewrite of a chunk of code for 1.4.1 to
  9. fix a corner case in the Q command, and somehow the placement of the
  10. clean-up label for the 'q' command got misplaced on the error-handling
  11. branch instead of the clean-exit branch. The patch below fixes this
  12. (it is committed for whenever the next bc/dc release gets made).
  13. Thanks for the report,
  14. --Ken Pizzini
  15. Upstream:
  16. https://git.yoctoproject.org/cgit.cgi/poky/plain/meta/recipes-extended/bc/bc/0001-dc-fix-exit-code-of-q-command.patch
  17. Signed-off-by: Li Zhou <li.zhou@windriver.com>
  18. Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
  19. ---
  20. dc/eval.c | 2 +-
  21. 1 file changed, 1 insertion(+), 1 deletion(-)
  22. diff --git a/dc/eval.c b/dc/eval.c
  23. index 6c54e61..9c28f18 100644
  24. --- a/dc/eval.c
  25. +++ b/dc/eval.c
  26. @@ -841,10 +841,10 @@ error_fail:
  27. fprintf(stderr, "%s: ", progname);
  28. perror("error reading input");
  29. return DC_FAIL;
  30. -reset_and_exit_quit:
  31. reset_and_exit_fail:
  32. signal(SIGINT, sigint_default);
  33. return DC_FAIL;
  34. +reset_and_exit_quit:
  35. reset_and_exit_success:
  36. signal(SIGINT, sigint_default);
  37. return DC_SUCCESS;
  38. --
  39. 2.17.1