X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-compat-util.h;h=c7cf2d5d9cdbfd4ed20c8b8ea49a36af7c138a4e;hb=77ce907786d2c4a7789e81c83a28e829c36fab30;hp=f09f244061ab9be5905b69e701faef8f416fd53e;hpb=66996ecc28f001d3dcc73090717bb8c6e47c0d75;p=git.git diff --git a/git-compat-util.h b/git-compat-util.h index f09f24406..c7cf2d5d9 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -46,6 +46,7 @@ #define _ALL_SOURCE 1 #define _GNU_SOURCE 1 #define _BSD_SOURCE 1 +#define _NETBSD_SOURCE 1 #include #include @@ -408,4 +409,16 @@ void git_qsort(void *base, size_t nmemb, size_t size, #endif #endif +#ifdef UNRELIABLE_FSTAT +#define fstat_is_reliable() 0 +#else +#define fstat_is_reliable() 1 +#endif + +/* + * Preserves errno, prints a message, but gives no warning for ENOENT. + * Always returns the return value of unlink(2). + */ +int unlink_or_warn(const char *path); + #endif