summaryrefslogtreecommitdiff
path: root/src/errors.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Add string descriptions for all error codesVicent Marti2010-11-051-3/+14
| | | | | | | Old descriptions have been updated and new ones have been added for the 'git_strerror' function. Signed-off-by: Vicent Marti <tanoku@gmail.com>
* Fix some "signed v unsigned comparison" warnings with -WextraRamsay Jones2010-01-201-1/+1
| | | | Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
* Set GIT_EOSERR when the OS errno should be consultedShawn O. Pearce2008-12-301-0/+3
| | | | | | | | This error code indicates the OS error code has a better value describing the last error, as it is likely a network or local file IO problem identified by a C library function call. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Wrap malloc and friends and report out of memory as GIT_ENOMEMShawn O. Pearce2008-12-301-0/+3
| | | | | | | | | | | | | | | | We now forbid direct use of malloc, strdup or calloc within the library and instead use wrapper functions git__malloc, etc. to invoke the underlying library malloc and set git_errno to a no memory error code if the allocation fails. In the future once we have pack objects in memory we are likely to enhance these routines with garbage collection logic to purge cached pack data when allocations fail. Because the size of the function will grow somewhat large, we don't want to mark them for inline as gcc tends to aggressively inline, creating larger than expected executables. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Support building on Mac OS X by using pthread_getspecific for TLSShawn O. Pearce2008-12-301-0/+23
| | | | | | | | | | | | | | | | | | The Mach-O format does not permit gcc to implement the __thread TLS specification, so we must instead emulate it using a single int cell allocated from memory and stored inside of the thread specific data associated with the current pthread. What makes this tricky is git_errno must be a valid lvalue, so we really need to return a pointer to the caller and deference it as part of the git_errno macro. The GCC-specific __attribute__((constructor)) extension is used to ensure the pthread_key_t is allocated before any Git functions are executed in the library, as this is necessary to access our thread specific storage. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Add an embryo of a TLS-aware error handling systemAndreas Ericsson2008-11-221-0/+23
This adds the per-thread global variable git_errno to the system, which callers can examine to get information about an error. Two helper functions are added to reduce LoC-count for the library code itself. Also, some exceptions are made for running sparse on GIT_TLS definitions, since it doesn't grok thread-local variables at all. Signed-off-by: Andreas Ericsson <ae@op5.se> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>