]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'jk/a-thread-only-dies-once'
authorJunio C Hamano <gitster@pobox.com>
Fri, 19 Apr 2013 20:45:04 +0000 (13:45 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 19 Apr 2013 20:45:05 +0000 (13:45 -0700)
A regression fix for the logic to detect die() handler triggering
itself recursively.

* jk/a-thread-only-dies-once:
  run-command: use thread-aware die_is_recursing routine
  usage: allow pluggable die-recursion checks

1  2 
git-compat-util.h
run-command.c
usage.c

index cde442fb5f47cd13757e09ae435963bc061db083,6aee9df86893459999314554fd246c2f8f847128..e955bb5e8b3101cc8c753cf541beabf5cd037b39
@@@ -318,19 -299,9 +318,20 @@@ extern NORETURN void die_errno(const ch
  extern int error(const char *err, ...) __attribute__((format (printf, 1, 2)));
  extern void warning(const char *err, ...) __attribute__((format (printf, 1, 2)));
  
 +/*
 + * Let callers be aware of the constant return value; this can help
 + * gcc with -Wuninitialized analysis. We restrict this trick to gcc, though,
 + * because some compilers may not support variadic macros. Since we're only
 + * trying to help gcc, anyway, it's OK; other compilers will fall back to
 + * using the function as usual.
 + */
 +#if defined(__GNUC__) && ! defined(__clang__)
 +#define error(...) (error(__VA_ARGS__), -1)
 +#endif
 +
  extern void set_die_routine(NORETURN_PTR void (*routine)(const char *err, va_list params));
  extern void set_error_routine(void (*routine)(const char *err, va_list params));
+ extern void set_die_is_recursing_routine(int (*routine)(void));
  
  extern int prefixcmp(const char *str, const char *prefix);
  extern int suffixcmp(const char *str, const char *suffix);
diff --cc run-command.c
Simple merge
diff --cc usage.c
Simple merge