sprintf's to snprintf's and check the return.
Turn check1list and check2list looping into a fixed constant number of
iterations rather than rely on a sentinal.
- MinGW doesn't have struct timespec, so udf_time.c doesn't compile
(changes lib/udf/udf_time.c, configure.ac, config.h.in)
- The configure test for bitfield ordering uses AC_TRY_RUN and thus
doesn't work when cross-compiling; use sneakiness to try and
determine it at compile time, falling back to the existing runtime
check if the sneakiness doesn't work
(changes configure.ac; tested on x86_64-linux-gnu and i586-mingw32
which are bf_lsbf=1, plus sparc64-linux-gnu which is bf_lsbf=0)
- The configure test for "extern long timezone" needlessly uses
AC_TRY_RUN when in fact AC_LINK_IFELSE is all we need to know, and
that latter works when cross-compiling
(changes configure.ac)
- MinGW sys/stat.h doesn't have the *GRP or *OTH macros, nor S_IFLNK
or S_IFSOCK, nor S_ISUID etc
(changes lib/udf/udf.c and lib/iso9660/xa.c)
- MinGW doesn't have <sys/wait.h>, so even the header-inclusion bit
of the Linux driver doesn't compile unless it's moved inside the
"ifdef HAVE_LINUX_CDROM"
(changes lib/driver/gnu_linux.c)
- Because the man pages cd-info.1 etc depend on the binaries themselves
(for help2man reasons), the configure options --without-cd-info etc
don't actually stop them being compiled. Fixed by only depending on
man pages for programs that are actually built, which also stops
the installation of man pages of programs which aren't themselves
installed
(changes src/Makefile.am)
call. I haven't been able to find anything that documents in any
detail how to use this ioctl let alone the weird behavior where
CDROMREADTOC header beforehand turns and "invalid parameter" into a
valid one. It's not the way other 'nix's work.
1. In the function is_cdrom_linux(...) in the file lib/driver/gnu_linux.c,
the CDROMREADTOCHDR ioctl gets called, which fails when the drive is
empty. The CDROM_GET_CAPABILITY ioctl always succeeds for CDrom drives
and fails for hard disks etc.
2. For some reason, at least my (GNU/Linux 2.6.10) Kernel fails to
open empty drives, when only O_RDONLY is used. Changing the open flag to
O_RDONLY|O_NONBLOCK, the call succeeds also for emtpy drives.
By the way, the cdrom header file in the kernel says explicitely,
that O_RDONLY|O_NONBLOCK should used whenever a cdrom is touched.
rocky: also made a change to eject to continue even if we can't get
the drive status -- which we can't with an empty CD-ROM drive.