Skip to content

Commit

Permalink
xfstests: fix printf warnings in locktest.c
Browse files Browse the repository at this point in the history
Signed-off-by: Dave Chinner <david@fromorbit.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
  • Loading branch information
dchinner committed Jan 20, 2010
1 parent 256a973 commit e941cbe
Showing 1 changed file with 20 additions and 15 deletions.
35 changes: 20 additions & 15 deletions src/locktest.c
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ send_ctl(void)

if (debug > 1) {
fprintf(stderr, "send_ctl: test=%d, command=%d offset=%"LL"d, length=%"LL"d, result=%d, error=%d\n",
ctl.test, ctl.command, ctl.offset, ctl.length,ctl.result, ctl.error);
ctl.test, ctl.command, (long long)ctl.offset, (long long)ctl.length,ctl.result, ctl.error);
}

ctl.test= bswap_uint32(ctl.test);
Expand All @@ -741,7 +741,7 @@ send_ctl(void)
if (nwrite < 0)
perror("send_ctl: write");
else
fprintf(stderr, "send_ctl[%d]: write() returns %d, not %d as expected\n",
fprintf(stderr, "send_ctl[%d]: write() returns %d, not %lu as expected\n",
ctl.test, nwrite, sizeof(ctl));
exit(1);
/*NOTREACHED*/
Expand All @@ -756,7 +756,7 @@ void recv_ctl(void)
if (nread < 0)
perror("recv_ctl: read");
else {
fprintf(stderr, "recv_ctl[%d]: read() returns %d, not %d as expected\n",
fprintf(stderr, "recv_ctl[%d]: read() returns %d, not %lu as expected\n",
ctl.test, nread, sizeof(ctl));
fprintf(stderr, "socket might has been closed by other locktest\n");
}
Expand All @@ -773,7 +773,7 @@ void recv_ctl(void)

if (debug > 1) {
fprintf(stderr, "recv_ctl: test=%d, command=%d offset=%"LL"d, length=%"LL"d, result=%d, error=%d\n",
ctl.test, ctl.command, ctl.offset, ctl.length, ctl.result, ctl.error);
ctl.test, ctl.command, (long long)ctl.offset, (long long)ctl.length, ctl.result, ctl.error);
}
}

Expand Down Expand Up @@ -1040,14 +1040,16 @@ main(int argc, char *argv[])
fail_flag++;
/* We have a failure */
if(debug)
fprintf(stderr, "Server failure in test %d, while %sing using offset %llu, length %llu - err = %d:%s\n",
fprintf(stderr, "Server failure in test %d, while %sing using offset %lld, length %lld - err = %d:%s\n",
ctl.test, tests[index][COMMAND]==WRLOCK?"write lock":
tests[index][COMMAND]==RDLOCK?"read lock":
tests[index][COMMAND]==UNLOCK?"unlock":
tests[index][COMMAND]==F_OPEN?"open":"clos",
tests[index][OFFSET], tests[index][LENGTH], saved_errno, strerror(saved_errno));
fprintf(stderr, "Server failure in %llu:%s\n",
tests[index][TEST_NUM],
(long long)tests[index][OFFSET],
(long long)tests[index][LENGTH],
saved_errno, strerror(saved_errno));
fprintf(stderr, "Server failure in %lld:%s\n",
(long long)tests[index][TEST_NUM],
descriptions[tests[index][TEST_NUM] - 1]);
}
}
Expand All @@ -1058,12 +1060,13 @@ main(int argc, char *argv[])
end=1;
}
if(debug > 1)
fprintf(stderr, "Sending command to client (%d) - %s - %llu:%llu\n",
fprintf(stderr, "Sending command to client (%d) - %s - %lld:%lld\n",
index, tests[index][COMMAND]==WRLOCK?"write lock":
tests[index][COMMAND]==RDLOCK?"read lock":
tests[index][COMMAND]==UNLOCK?"unlock":
tests[index][COMMAND]==F_OPEN?"open":"clos",
tests[index][OFFSET], tests[index][LENGTH]);
(long long)tests[index][OFFSET],
(long long)tests[index][LENGTH]);
/* get the client to do something */
ctl.index = index;
send_ctl();
Expand All @@ -1075,14 +1078,15 @@ main(int argc, char *argv[])
if( ctl.result == FAIL ) {
fail_flag++;
if(debug)
fprintf(stderr, "Client failure in test %d, while %sing using offset %llu, length %llu - err = %d:%s\n",
fprintf(stderr, "Client failure in test %d, while %sing using offset %lld, length %lld - err = %d:%s\n",
ctl.test, ctl.command==WRLOCK?"write lock":
ctl.command==RDLOCK?"read lock":
ctl.command==UNLOCK?"unlock":
ctl.command==F_OPEN?"open":"clos",
ctl.offset, ctl.length, ctl.error, strerror(ctl.error));
fprintf(stderr, "Client failure in %llu:%s\n",
tests[index][TEST_NUM],
(long long)ctl.offset, (long long)ctl.length,
ctl.error, strerror(ctl.error));
fprintf(stderr, "Client failure in %lld:%s\n",
(long long)tests[index][TEST_NUM],
descriptions[tests[index][TEST_NUM] - 1]);
}
}
Expand Down Expand Up @@ -1144,7 +1148,8 @@ main(int argc, char *argv[])
}
if( result != tests[index][RESULT] ) {
if(debug)
fprintf(stderr,"Got %d, wanted %llu\n", result, tests[index][RESULT]);
fprintf(stderr,"Got %d, wanted %lld\n", result,
(long long)tests[index][RESULT]);
ctl.result = FAIL;
ctl.error = saved_errno;
fail_count++;
Expand Down

0 comments on commit e941cbe

Please sign in to comment.