zfs: Update test format strings to match variable typtes
And drop stray 'd' from the end of some printed numbers. I assume this was the result of someone thinking u is a printf length modifier for d, not a format specifier itself. Reviewed by: kevans, rew MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D34387
This commit is contained in:
parent
8881d206f4
commit
f27fb06cad
@ -83,7 +83,7 @@ main(int argc, char **argv)
|
||||
|
||||
bytes = write(fd, buf, size);
|
||||
if (bytes != size) {
|
||||
(void) printf("short write: %d != %ud\n", bytes, size);
|
||||
(void) printf("short write: %d != %zu\n", bytes, size);
|
||||
retval = 1;
|
||||
goto end;
|
||||
}
|
||||
@ -114,20 +114,20 @@ main(int argc, char **argv)
|
||||
|
||||
bytes = pread(fd, buf, size, 0);
|
||||
if (bytes != size) {
|
||||
(void) printf("short read: %d != %ud\n", bytes, size);
|
||||
(void) printf("short read: %d != %zu\n", bytes, size);
|
||||
retval = 1;
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (buf[idx] != 1) {
|
||||
(void) printf(
|
||||
"bad data from read! got buf[%ud]=%d, expected 1\n",
|
||||
"bad data from read! got buf[%zu]=%d, expected 1\n",
|
||||
idx, buf[idx]);
|
||||
retval = 1;
|
||||
goto end;
|
||||
}
|
||||
|
||||
(void) printf("good data from read: buf[%ud]=1\n", idx);
|
||||
(void) printf("good data from read: buf[%zu]=1\n", idx);
|
||||
end:
|
||||
if (fd != -1) {
|
||||
(void) close(fd);
|
||||
|
@ -227,7 +227,7 @@ do_read(const char *pfile)
|
||||
(void) close(fd);
|
||||
|
||||
if (ret != 0) {
|
||||
fprintf(stderr, "read(%d, buf, %d)\n", fd, sizeof (buf));
|
||||
fprintf(stderr, "read(%d, buf, %zu)\n", fd, sizeof (buf));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@ -253,7 +253,7 @@ do_write(const char *pfile)
|
||||
(void) close(fd);
|
||||
|
||||
if (ret != 0) {
|
||||
fprintf(stderr, "write(%d, buf, %d)\n", fd, strlen(buf));
|
||||
fprintf(stderr, "write(%d, buf, %zu)\n", fd, strlen(buf));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
@ -332,7 +332,7 @@ verify_file(int fd, const pattern_t* p_pat){
|
||||
int file_offset = chunk_start + chunk_offset;
|
||||
if (good_data && (actual_buf[i] != desired_buf[i])){
|
||||
fprintf(stderr, "fsync_integrity: miscompare at "
|
||||
"chunk %i, chunk offset %lx, file offset %lx\n",
|
||||
"chunk %i, chunk offset %x, file offset %x\n",
|
||||
chunk_idx, chunk_offset, file_offset);
|
||||
fprintf(stderr, "Expected %016lx, got %016lx\n",
|
||||
desired_buf[i], actual_buf[i]);
|
||||
@ -341,7 +341,7 @@ verify_file(int fd, const pattern_t* p_pat){
|
||||
}
|
||||
else if (!good_data && (actual_buf[i] == desired_buf[i])) {
|
||||
fprintf(stderr, "fsync_integrity: miscompare ends at "
|
||||
"chunk %i, chunk offset %lx, file offset %lx\n",
|
||||
"chunk %i, chunk offset %x, file offset %x\n",
|
||||
chunk_idx, chunk_offset, file_offset);
|
||||
good_data = 1;
|
||||
}
|
||||
|
@ -370,7 +370,7 @@ verify_file(int fd, const pattern_t* p_pat){
|
||||
int file_offset = chunk_start + chunk_offset;
|
||||
if (good_data && (actual_buf[i] != desired_buf[i])){
|
||||
fprintf(stderr, "txg_integrity: miscompare at "
|
||||
"chunk %i, chunk offset %lx, file offset %lx\n",
|
||||
"chunk %i, chunk offset %x, file offset %x\n",
|
||||
chunk_idx, chunk_offset, file_offset);
|
||||
fprintf(stderr, "Expected %16lx, got %16lx\n",
|
||||
desired_buf[i], actual_buf[i]);
|
||||
@ -379,7 +379,7 @@ verify_file(int fd, const pattern_t* p_pat){
|
||||
}
|
||||
else if (!good_data && (actual_buf[i] == desired_buf[i])) {
|
||||
fprintf(stderr, "txg_integrity: miscompare ends at "
|
||||
"chunk %i, chunk offset %lx, file offset %lx\n",
|
||||
"chunk %i, chunk offset %x, file offset %x\n",
|
||||
chunk_idx, chunk_offset, file_offset);
|
||||
good_data = 1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user