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