diff options
author | Jonathan Nieder <jrnieder@gmail.com> | 2011-03-18 15:23:52 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-04-03 12:21:34 -0700 |
commit | ebae9ff95de2d0b36b061c7db833df4f7e01a41d (patch) | |
tree | 4c32bda4104ff10243ad1867af4d597000f73cd1 /t/t2105-update-index-gitfile.sh | |
parent | Git 1.7.4.3 (diff) | |
download | tgif-ebae9ff95de2d0b36b061c7db833df4f7e01a41d.tar.xz |
compat: add missing #include <sys/resource.h>
Starting with commit c793430 (Limit file descriptors used by packs,
2011-02-28), git uses getrlimit to tell how many file descriptors it
can use. Unfortunately it does not include the header declaring that
function, resulting in compilation errors:
sha1_file.c: In function 'open_packed_git_1':
sha1_file.c:718: error: storage size of 'lim' isn't known
sha1_file.c:721: warning: implicit declaration of function 'getrlimit'
sha1_file.c:721: error: 'RLIMIT_NOFILE' undeclared (first use in this function)
sha1_file.c:718: warning: unused variable 'lim'
The standard header to include for this is <sys/resource.h> (which on
some systems itself requires declarations from <sys/types.h> or
<sys/time.h>). Probably the problem was missed until now because in
current glibc sys/resource.h happens to be included by sys/wait.h.
MinGW does not provide sys/resource.h (and compat/mingw takes care of
providing getrlimit some other way), so add the missing #include to
the "#ifndef __MINGW32__" block in git-compat-util.h.
Reported-by: Stefan Sperling <stsp@stsp.name>
Tested-by: Stefan Sperling <stsp@stsp.name> [on OpenBSD]
Tested-by: Arnaud Lacombe <lacombar@gmail.com> [on FreeBSD 8]
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t2105-update-index-gitfile.sh')
0 files changed, 0 insertions, 0 deletions