Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/common-exit.c # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / common-exit.c` 26 lines ยท 680 bytes Raw Blame History 1 #include "git-compat-util.h" 2 #include "trace2.h" 3 4 static void check_bug_if_BUG(void) 5 { 6 if (!bug_called_must_BUG) 7 return; 8 BUG("on exit(): had bug() call(s) in this process without explicit BUG_if_bug()"); 9 } 10 11 /* We wrap exit() to call common_exit() in git-compat-util.h */ 12 int common_exit(const char *file, int line, int code) 13 { 14 /* 15 * For non-POSIX systems: Take the lowest 8 bits of the "code" 16 * to e.g. turn -1 into 255. On a POSIX system this is 17 * redundant, see exit(3) and wait(2), but as it doesn't harm 18 * anything there we don't need to guard this with an "ifdef". 19 */ 20 code &= 0xff; 21 22 check_bug_if_BUG(); 23 trace2_cmd_exit_fl(file, line, code); 24 25 return code; 26 }