Merge "Fix parameter to lseek"

am: 4a8d1255de

* commit '4a8d1255dec24716b537a742ae67c0bc5ad8a41e':
  Fix parameter to lseek
This commit is contained in:
Elliott Hughes 2015-10-20 21:44:21 +00:00 committed by android-build-merger
commit 9f1edaece7
1 changed files with 5 additions and 4 deletions

View File

@ -40,7 +40,6 @@ int main(int argc, char *argv[])
int in;
int out;
int i;
int ret;
struct sparse_file *s;
if (argc < 3) {
@ -71,10 +70,12 @@ int main(int argc, char *argv[])
exit(-1);
}
lseek(out, SEEK_SET, 0);
if (lseek(out, 0, SEEK_SET) == -1) {
perror("lseek failed");
exit(EXIT_FAILURE);
}
ret = sparse_file_write(s, out, false, false, false);
if (ret < 0) {
if (sparse_file_write(s, out, false, false, false) < 0) {
fprintf(stderr, "Cannot write output file\n");
exit(-1);
}