Processing output of -as mkisofs by -pkt_output if enabled

This commit is contained in:
Thomas Schmitt 2010-11-30 11:20:59 +00:00
parent 5d5a7b3214
commit e4019b251c
2 changed files with 16 additions and 9 deletions

View File

@ -245,6 +245,7 @@ int Xorriso_option_print(struct XorrisO *xorriso, char *text, int flag)
/* Option -print_size
@param flag bit0= report in mkisofs compatible form on real stdout
(resp. on result channel if xorriso->packet_output)
*/
int Xorriso_option_print_size(struct XorrisO *xorriso, int flag)
{
@ -253,8 +254,10 @@ int Xorriso_option_print_size(struct XorrisO *xorriso, int flag)
if(!xorriso->volset_change_pending) {
sprintf(xorriso->info_text,"-print_size: No image modifications pending");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0);
sprintf(xorriso->result_line,"Image size : 0s\n");
Xorriso_result(xorriso,0);
if(!(flag & 1)) {
sprintf(xorriso->result_line,"Image size : 0s\n");
Xorriso_result(xorriso,0);
}
return(2);
}
ret= Xorriso_write_session(xorriso, 1);
@ -265,12 +268,16 @@ int Xorriso_option_print_size(struct XorrisO *xorriso, int flag)
}
if(flag&1) {
sprintf(xorriso->result_line,"%d\n", ret);
fd= xorriso->dev_fd_1;
if(fd<0)
fd= 1;
ret= write(fd, xorriso->result_line, strlen(xorriso->result_line));
/* (result of write intentionally ignored) */
fsync(fd);
if(xorriso->packet_output) {
Xorriso_result(xorriso,0);
} else {
fd= xorriso->dev_fd_1;
if(fd<0)
fd= 1;
ret= write(fd, xorriso->result_line, strlen(xorriso->result_line));
/* (result of write intentionally ignored) */
fsync(fd);
}
} else {
sprintf(xorriso->result_line,"Image size : %ds\n", ret);
Xorriso_result(xorriso,0);

View File

@ -1 +1 @@
#define Xorriso_timestamP "2010.11.30.104719"
#define Xorriso_timestamP "2010.11.30.112050"