Skip to content

Commit

Permalink
Merge branch 'js/run-command-updates' (early part)
Browse files Browse the repository at this point in the history
* 'js/run-command-updates' (early part):
  MinGW: truncate exit()'s argument to lowest 8 bits
  • Loading branch information
Junio C Hamano committed Jul 9, 2009
2 parents 0da3e1d + 47e3de0 commit ce4f404
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions compat/mingw.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ static inline int fcntl(int fd, int cmd, long arg)
errno = EINVAL;
return -1;
}
/* bash cannot reliably detect negative return codes as failure */
#define exit(code) exit((code) & 0xff)

/*
* simple adaptors
Expand Down
2 changes: 1 addition & 1 deletion git.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ static int run_builtin(struct cmd_struct *p, int argc, const char **argv)

status = p->fn(argc, argv, prefix);
if (status)
return status & 0xff;
return status;

/* Somebody closed stdout? */
if (fstat(fileno(stdout), &st))
Expand Down

0 comments on commit ce4f404

Please sign in to comment.