Skip to content

Commit 1fb0e09

Browse files
committed
Merge branch 'dm/some-stdio-functions-are-macro-on-freebsd' into pu
Variants of BSD define fileno(fh) as a macro, breaking a program that passes a "void *" to it. * dm/some-stdio-functions-are-macro-on-freebsd: http: cast result to FILE *
2 parents 19ef37c + ba81921 commit 1fb0e09

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

http.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2002,12 +2002,12 @@ static int http_request_reauth(const char *url,
20022002
strbuf_reset(result);
20032003
break;
20042004
case HTTP_REQUEST_FILE:
2005-
if (fflush(result)) {
2005+
if (fflush((FILE *)result)) {
20062006
error_errno("unable to flush a file");
20072007
return HTTP_START_FAILED;
20082008
}
2009-
rewind(result);
2010-
if (ftruncate(fileno(result), 0) < 0) {
2009+
rewind((FILE *)result);
2010+
if (ftruncate(fileno((FILE *)result), 0) < 0) {
20112011
error_errno("unable to truncate a file");
20122012
return HTTP_START_FAILED;
20132013
}

0 commit comments

Comments
 (0)