[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: mkisofs aborts but exit value is 0


many thanks for taking care of mkisofs
during all the years.

>                                seterrno(EFBIG); 
> BTW: File too large is usually used to deal with the same situation
> when writng to a device that is too small.
> Do you have an idea for a better errno?

Possibly one should resort to
  EIO              5      /* I/O error */
although it is a bit a dramatic one. 
It has the hard-to-beat advantage of being
very general. So it includes the given

"File too large" is in some way the contrary
of the problem situation. Actually, the file was
too small.
Since comerr() does report the error text, this
might become quite misleading :

  mkisofs: File too large. cannot read from '/home/th.schmitt/mail/scdbackup'

might happen with a file that has 0 bytes.

When using EIO it would probably be helpful to issue a
particular text message about the premature EOF,
in contrast to a real filesystem i/o error. So one
could figure out what might have led to the abort
and could take precautions, like stopping the email
client before retrying.
(Additionally it might save the user from getting
a heart attack from reading "I/O error".)

How about something like :

              if (geterrno() == 0) {
                        comerr("premature EOF with '%s'\n", filename); 
                        fprintf(stderr, "premature EOF with '%s'\n", filename); 
              } else {
                        comerr("cannot read from '%s'\n", filename); 
                        fprintf(stderr, "cannot read from '%s'\n", filename); 

In my problem situation the abort of mkisofs
would then look like

  mkisofs: I/O error. premature EOF with '/home/th.schmitt/mail/scdbackup'

while with a real disk i/o error it would look like

  mkisofs: I/O error. cannot read from '/home/th.schmitt/mail/scdbackup'

Both statements make sense and the first one gives
a hint that possibly not the hardware is to blame.

Have a nice day :)


Reply to: