Initialize fields mode, uid, and gid.

Patch by Markus Oberhumer.  Thanks!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21369 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Misha Brukman 2005-04-20 03:55:35 +00:00
parent 72a9caa260
commit 4b2afe6394
2 changed files with 12 additions and 0 deletions

View File

@ -318,6 +318,12 @@ Archive::writeSymbolTable(std::ofstream& ARFile) {
memcpy(Hdr.name,ARFILE_LLVM_SYMTAB_NAME,16);
uint64_t secondsSinceEpoch = sys::TimeValue::now().toEpochTime();
char buffer[32];
sprintf(buffer, "%-8o", 0644);
memcpy(Hdr.mode,buffer,8);
sprintf(buffer, "%-6u", getuid());
memcpy(Hdr.uid,buffer,6);
sprintf(buffer, "%-6u", getgid());
memcpy(Hdr.gid,buffer,6);
sprintf(buffer,"%-12u", unsigned(secondsSinceEpoch));
memcpy(Hdr.date,buffer,12);
sprintf(buffer,"%-10u",symTabSize);

View File

@ -318,6 +318,12 @@ Archive::writeSymbolTable(std::ofstream& ARFile) {
memcpy(Hdr.name,ARFILE_LLVM_SYMTAB_NAME,16);
uint64_t secondsSinceEpoch = sys::TimeValue::now().toEpochTime();
char buffer[32];
sprintf(buffer, "%-8o", 0644);
memcpy(Hdr.mode,buffer,8);
sprintf(buffer, "%-6u", getuid());
memcpy(Hdr.uid,buffer,6);
sprintf(buffer, "%-6u", getgid());
memcpy(Hdr.gid,buffer,6);
sprintf(buffer,"%-12u", unsigned(secondsSinceEpoch));
memcpy(Hdr.date,buffer,12);
sprintf(buffer,"%-10u",symTabSize);