Skip to content

Commit

Permalink
Merge pull request #42 from olejorgenb/notionflux-exit-status
Browse files Browse the repository at this point in the history
notionflux: distinct exit status on lua error
  • Loading branch information
raboof authored Apr 9, 2017
2 parents 23f6ace + 7f0fe80 commit 55351a9
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions mod_notionflux/notionflux/notionflux.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ int main(int argc, char *argv[])
int use_stdin=1;
char res;
int n;
int exit_status=0;

if(argc>1){
if(argc!=3 || strcmp(argv[1], "-e")!=0)
Expand Down Expand Up @@ -235,15 +236,18 @@ int main(int argc, char *argv[])
if(n==0)
break;

if(res=='S')
if(res=='S'){
mywrite(1, buf, n);
else /* res=='E' */
}
else{ /* res=='E' */
mywrite(2, buf, n);
exit_status=2;
}

if(n<MAX_DATA)
break;
}

return 0;
return exit_status;
}

0 comments on commit 55351a9

Please sign in to comment.