Skip to content

Commit

Permalink
Fix for warnings: ignoring return value of ‘write’, declared with att…
Browse files Browse the repository at this point in the history
…ribute warn_unused_result.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140314 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
gkistanova committed Sep 22, 2011
1 parent 4e41416 commit 6bbba3c
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions runtime/libprofile/CommonProfiling.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,19 @@ int getOutFile() {
{
int PTy = ArgumentInfo;
int Zeros = 0;
write(OutFile, &PTy, sizeof(int));
write(OutFile, &SavedArgsLength, sizeof(unsigned));
write(OutFile, SavedArgs, SavedArgsLength);
if (write(OutFile, &PTy, sizeof(int)) < 0 ||
write(OutFile, &SavedArgsLength, sizeof(unsigned)) < 0 ||
write(OutFile, SavedArgs, SavedArgsLength) < 0 ) {
fprintf(stderr,"error: unable to write to output file.");
exit(0);
}
/* Pad out to a multiple of four bytes */
if (SavedArgsLength & 3)
write(OutFile, &Zeros, 4-(SavedArgsLength&3));
if (SavedArgsLength & 3) {
if (write(OutFile, &Zeros, 4-(SavedArgsLength&3)) < 0) {
fprintf(stderr,"error: unable to write to output file.");
exit(0);
}
}
}
}
return(OutFile);
Expand Down

0 comments on commit 6bbba3c

Please sign in to comment.