diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-03-15 14:22:23 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-03-15 14:22:23 -0700 |
commit | 674ef90904fe651ecacafc4211a8a24014160207 (patch) | |
tree | da07f0f6663799582fffd716e3e5b5f094a6b390 /compat | |
parent | ccf6d62d1e8d9a725b4c5a374c2d0e2cd01dd6a7 (diff) | |
parent | d131b7afea58f47721dafd013ab6aff4adfc42dd (diff) | |
download | git-674ef90904fe651ecacafc4211a8a24014160207.tar.gz git-674ef90904fe651ecacafc4211a8a24014160207.tar.xz |
Merge branch 'sp/maint-fd-limit'
* sp/maint-fd-limit:
sha1_file.c: Don't retain open fds on small packs
mingw: add minimum getrlimit() compatibility stub
Limit file descriptors used by packs
Diffstat (limited to 'compat')
-rw-r--r-- | compat/mingw.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/compat/mingw.h b/compat/mingw.h index fe6ba3404..62eccd339 100644 --- a/compat/mingw.h +++ b/compat/mingw.h @@ -231,6 +231,22 @@ int mingw_getpagesize(void); #define getpagesize mingw_getpagesize #endif +struct rlimit { + unsigned int rlim_cur; +}; +#define RLIMIT_NOFILE 0 + +static inline int getrlimit(int resource, struct rlimit *rlp) +{ + if (resource != RLIMIT_NOFILE) { + errno = EINVAL; + return -1; + } + + rlp->rlim_cur = 2048; + return 0; +} + /* Use mingw_lstat() instead of lstat()/stat() and * mingw_fstat() instead of fstat() on Windows. */ |