diff options
author | Vicent Marti <tanoku@gmail.com> | 2010-12-23 00:15:09 +0200 |
---|---|---|
committer | Vicent Marti <tanoku@gmail.com> | 2010-12-23 00:15:09 +0200 |
commit | 9f54fe482dd369ebbae67b0b33f7efde206ba249 (patch) | |
tree | 5b239e63f5040ebece759c5143ea44916d17bb63 /src/errors.c | |
parent | 11f6646f032c669170453e8e359ac337fa9abbb7 (diff) | |
download | libgit2-9f54fe482dd369ebbae67b0b33f7efde206ba249.tar.gz |
Remove git_errno
It was not being used by any methods (only by malloc and calloc), and
since it needs to be TLS, it cannot be exported on DLLs on Windows.
Burn it with fire. The API always returns error codes!
Signed-off-by: Vicent Marti <tanoku@gmail.com>
Diffstat (limited to 'src/errors.c')
-rw-r--r-- | src/errors.c | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/src/errors.c b/src/errors.c index ac73402ee..df8b82200 100644 --- a/src/errors.c +++ b/src/errors.c @@ -1,34 +1,6 @@ #include "common.h" #include "thread-utils.h" /* for GIT_TLS */ -#if defined(GIT_TLS) -/* compile-time constant initialization required */ -GIT_TLS int git_errno = 0; - -#elif defined(GIT_HAS_PTHREAD) - -static pthread_key_t errno_key; - -static void init_errno(void) __attribute__((constructor)); -static void init_errno(void) -{ - pthread_key_create(&errno_key, free); -} - -int *git__errno_storage(void) -{ - int *e = pthread_getspecific(errno_key); - if (!e) { -#undef calloc - e = calloc(1, sizeof(*e)); -#define calloc(a,b) GIT__FORBID_MALLOC - pthread_setspecific(errno_key, e); - } - return e; -} - -#endif - static struct { int num; const char *str; |