Appease Sun Studio by renaming "tmpfile"
On Solaris the system headers define the "tmpfile" name, which'll
cause Git compiled with Sun Studio 12 Update 1 to whine about us
redefining the name:
"pack-write.c", line 76: warning: name redefined by pragma redefine_extname declared static: tmpfile (E_PRAGMA_REDEFINE_STATIC)
"sha1_file.c", line 2455: warning: name redefined by pragma redefine_extname declared static: tmpfile (E_PRAGMA_REDEFINE_STATIC)
"fast-import.c", line 858: warning: name redefined by pragma redefine_extname declared static: tmpfile (E_PRAGMA_REDEFINE_STATIC)
"builtin/index-pack.c", line 175: warning: name redefined by pragma redefine_extname declared static: tmpfile (E_PRAGMA_REDEFINE_STATIC)
Just renaming the "tmpfile" variable to "tmp_file" in the relevant
places is the easiest way to fix this.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
952fba9c63
commit
ab1900a36e
@ -172,10 +172,10 @@ static const char *open_pack_file(const char *pack_name)
|
||||
if (from_stdin) {
|
||||
input_fd = 0;
|
||||
if (!pack_name) {
|
||||
static char tmpfile[PATH_MAX];
|
||||
output_fd = odb_mkstemp(tmpfile, sizeof(tmpfile),
|
||||
static char tmp_file[PATH_MAX];
|
||||
output_fd = odb_mkstemp(tmp_file, sizeof(tmp_file),
|
||||
"pack/tmp_pack_XXXXXX");
|
||||
pack_name = xstrdup(tmpfile);
|
||||
pack_name = xstrdup(tmp_file);
|
||||
} else
|
||||
output_fd = open(pack_name, O_CREAT|O_EXCL|O_RDWR, 0600);
|
||||
if (output_fd < 0)
|
||||
|
||||
Reference in New Issue
Block a user