diff --git a/utils/nfs-cp.c b/utils/nfs-cp.c index a4ae07e6..e183067b 100644 --- a/utils/nfs-cp.c +++ b/utils/nfs-cp.c @@ -44,9 +44,11 @@ WSADATA wsaData; #include #endif +#include #include #include #include +#include #include #include #include "libnfs.h" @@ -264,15 +266,16 @@ int main(int argc, char *argv[]) } count = file_pread(src, buf, count, off); if (count < 0) { - fprintf(stderr, "Failed to read from source file\n"); + fprintf(stderr, "Failed to read from source file (%s)\n", + src->is_nfs ? nfs_get_error(src->nfs) : strerror(errno)); free_file_context(src); free_file_context(dst); return 10; } count = file_pwrite(dst, buf, count, off); if (count < 0) { - fprintf(stderr, "Failed to write to dest file %s\n", - dst->is_nfs ? nfs_get_error(dst->nfs) : ""); + fprintf(stderr, "Failed to write to dest file (%s)\n", + dst->is_nfs ? nfs_get_error(dst->nfs) : strerror(errno)); free_file_context(src); free_file_context(dst); return 10;