From c64e48d58808fed9cff2b0681b31872b7720dd9d Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Tue, 19 Mar 2024 21:54:14 +0100 Subject: [PATCH] Made Xorriso_tell_media_space() ready for long block adresses --- xorriso/drive_mgt.c | 4 ++-- xorriso/opts_p_z.c | 7 ++++--- xorriso/xorriso_timestamp.h | 2 +- xorriso/xorrisoburn.h | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/xorriso/drive_mgt.c b/xorriso/drive_mgt.c index 36591516..61704a92 100644 --- a/xorriso/drive_mgt.c +++ b/xorriso/drive_mgt.c @@ -1663,9 +1663,9 @@ ex:; int Xorriso_tell_media_space(struct XorrisO *xorriso, - int *media_space, int *free_space, int flag) + off_t *media_space, off_t *free_space, int flag) { - int ret; + off_t ret; struct burn_drive_info *dinfo; struct burn_drive *drive; struct burn_write_opts *burn_options; diff --git a/xorriso/opts_p_z.c b/xorriso/opts_p_z.c index 03f7b9b3..0954fb42 100644 --- a/xorriso/opts_p_z.c +++ b/xorriso/opts_p_z.c @@ -1623,7 +1623,8 @@ int Xorriso_option_system_id(struct XorrisO *xorriso, char *name, int flag) /* Option -tell_media_space */ int Xorriso_option_tell_media_space(struct XorrisO *xorriso, int flag) { - int ret, free_space= 0, media_space= 0; + int ret; + off_t free_space= 0, media_space= 0; ret= Xorriso_tell_media_space(xorriso, &media_space, &free_space, 0); if(ret<=0) { @@ -1636,9 +1637,9 @@ int Xorriso_option_tell_media_space(struct XorrisO *xorriso, int flag) "Pending image size larger than free space on medium"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0); } - sprintf(xorriso->result_line, "Media space : %ds\n", media_space); + sprintf(xorriso->result_line, "Media space : %.fs\n", (double) media_space); Xorriso_result(xorriso, 0); - sprintf(xorriso->result_line, "After commit : %ds\n", free_space); + sprintf(xorriso->result_line, "After commit : %.fs\n", (double) free_space); Xorriso_result(xorriso, 0); return(1); } diff --git a/xorriso/xorriso_timestamp.h b/xorriso/xorriso_timestamp.h index 104a02a1..b56c8cb8 100644 --- a/xorriso/xorriso_timestamp.h +++ b/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2024.03.19.185848" +#define Xorriso_timestamP "2024.03.19.205356" diff --git a/xorriso/xorrisoburn.h b/xorriso/xorrisoburn.h index aa249a84..74e7a002 100644 --- a/xorriso/xorrisoburn.h +++ b/xorriso/xorrisoburn.h @@ -76,7 +76,7 @@ int Xorriso_show_boot_info(struct XorrisO *xorriso, int flag); int Xorriso_show_devices(struct XorrisO *xorriso, int flag); int Xorriso_tell_media_space(struct XorrisO *xorriso, - int *media_space, int *free_space, int flag); + off_t *media_space, off_t *free_space, int flag); /* @param flag bit0=fast , bit1=deformat @return 0=failure, did not touch medium , -1=failure, altered medium