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 07c2bb8421
commit 4897fc74f1
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 /* Option -print_size
@param flag bit0= report in mkisofs compatible form on real stdout @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) 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) { if(!xorriso->volset_change_pending) {
sprintf(xorriso->info_text,"-print_size: No image modifications pending"); sprintf(xorriso->info_text,"-print_size: No image modifications pending");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0);
if(!(flag & 1)) {
sprintf(xorriso->result_line,"Image size : 0s\n"); sprintf(xorriso->result_line,"Image size : 0s\n");
Xorriso_result(xorriso,0); Xorriso_result(xorriso,0);
}
return(2); return(2);
} }
ret= Xorriso_write_session(xorriso, 1); ret= Xorriso_write_session(xorriso, 1);
@ -265,12 +268,16 @@ int Xorriso_option_print_size(struct XorrisO *xorriso, int flag)
} }
if(flag&1) { if(flag&1) {
sprintf(xorriso->result_line,"%d\n", ret); sprintf(xorriso->result_line,"%d\n", ret);
if(xorriso->packet_output) {
Xorriso_result(xorriso,0);
} else {
fd= xorriso->dev_fd_1; fd= xorriso->dev_fd_1;
if(fd<0) if(fd<0)
fd= 1; fd= 1;
ret= write(fd, xorriso->result_line, strlen(xorriso->result_line)); ret= write(fd, xorriso->result_line, strlen(xorriso->result_line));
/* (result of write intentionally ignored) */ /* (result of write intentionally ignored) */
fsync(fd); fsync(fd);
}
} else { } else {
sprintf(xorriso->result_line,"Image size : %ds\n", ret); sprintf(xorriso->result_line,"Image size : %ds\n", ret);
Xorriso_result(xorriso,0); Xorriso_result(xorriso,0);

View File

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