Commits


for portability, handle errno variations upon open(2) failure with O_NOFOLLOW Problem pointed out by naddy for FreeBSD -portable. Discussed with millert, thomas adam, and naddy.


portable: add FreeBSD support This adds the capability to compile got-portable on FreeBSD.


sterror: use XPG version on GLIBC It looks like autoconf 2.69 will not provide XPG strerror_r even if the appropriate macros are set which request the XPG version. Until this is fixed in autoconf and that version is more widely-adopted, this approach will provide what's required. Originally from Stefan Sperling, tweaked by me.


portable: initial Linux compilation This commit modifies the GoT main branch to be able to compile it under linux.


switch to strerror_r(3) in error.c for thread-safety


introduce got_custom_error array to support multiple errors in flight This is still not thread-safe but at least avoids errors overwriting each other in single-threaded contexts.


add got_error_fmt() got_error_fmt() could eventually replace got_error_path() which has already been used to construct errors with strings that are not actually paths... ok millert@


add got_error_from_errno_fmt() for more flexibility in error messages suggested by and ok millert


use size_t for loop indices to avoid signedness warnings; from emaste@freebsd


fix NULL deref in got_error_from_errno via got_error_uuid (found by jasper)


error.c: use <limits.h> instead of <sys/param.h>


introduce got_error_path()


rename got_error_prefix_errno() to got_error_from_errno()


got_error_set_errno: take a char arg to pass to got_error_prefix_errno $> got rm a got: : No such file or directory becomes $> got rm a got: /path/to/a: No such file or directory


got_error_from_errno -> got_error_prefix_errno also add got_error_prefix_errno2 and got_error_prefix_errno3 which should hopefully all be merged into a single function with variadic args (but can't alloc mem)


error: introduce got_error_prefix_errno for better errno messages


error: fix definition of got_error_from_errno


add got_error_uuid()


add got_error_not_ref()


remove unnecessary cast


introduce got errors with custom messages; add one for ERR_NO_OBJ


make 'tog log' use background thread and introduce global mutex


simplify got_error_from_errno()


don't forget to set error message in got_error_from_errno()


introduce got_ferror() and use it