Skip to content

Commit 19b1002

Browse files
committed
Do not merge! Debugging HP-UX is always a joy
Ticket: ENT-13508 Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
1 parent 476b57f commit 19b1002

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

libutils/file_lib.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1569,6 +1569,19 @@ SMART_SYSCALLS_UNUSED static bool FileSparseCopyShoveling(int sd, const char *sr
15691569
assert(total_bytes_written != NULL);
15701570
assert(last_write_was_a_hole != NULL);
15711571

1572+
Log(LOG_LEVEL_INFO, "ENT-13508: Debugging HP-UX is always a joy :)");
1573+
1574+
struct stat sb;
1575+
if (lstat(src_name, &sb) == -1) {
1576+
Log(LOG_LEVEL_ERR, "ENT-13508: lstat(\"%s\"): %s", dst_name, GetErrorStr());
1577+
}
1578+
Log(LOG_LEVEL_INFO, "ENT-13508: lstat(\"%s\") = %jd", dst_name, (intmax_t)sb.st_size);
1579+
1580+
if (stat(src_name, &sb) == -1) {
1581+
Log(LOG_LEVEL_ERR, "ENT-13508: stat(\"%s\"): %s", dst_name, GetErrorStr());
1582+
}
1583+
Log(LOG_LEVEL_INFO, "ENT-13508: stat(\"%s\") = %jd", dst_name, (intmax_t)sb.st_size);
1584+
15721585
const size_t buf_size = blk_size;
15731586
void *buf = xmalloc(buf_size);
15741587

@@ -1603,6 +1616,7 @@ SMART_SYSCALLS_UNUSED static bool FileSparseCopyShoveling(int sd, const char *sr
16031616
}
16041617

16051618
n_read_total += n_read;
1619+
Log(LOG_LEVEL_INFO, "ENT-13508: Total read from file '%s' is '%zu'", src_name, n_read_total);
16061620
}
16071621

16081622
free(buf);

0 commit comments

Comments
 (0)