Running on redhat 7.9. I will be using dvd+rw-mediainfo wrapped by either ProcBuilder from apache or the ProcessBuilder from java 11 to query the state of media inserted into an optical drive. I'd like information about the possible exit values dvd+rw-mediainfo can produce. Empirically I have determined that 251 means there is no disc inserted into the drive and 130 means there is no drive matching the argument to the command. Are there any other exit codes I should be aware of? I looked at the c source I found at https://sources.debian.org/src/dvd+rw-tools/7.1-3/dvd+rw-mediainfo.cpp/ but there is no definition of the return codes in there. There are not a lot of included h files. I was unable to find stddef.h on my system which I sort of suspected might be the location.
#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
I'm not very adept at c++ (strictly java) but I was hoping to find a h file that defined the exit codes. They are not listed in the man page entries for the command. Where I see exit called in the source it is not clear to me where the values are defined.
if ((err=cmd.transport(READ,inq,36)))
sperror ("INQUIRY",err),
exit (FATAL_START(errno));
I don't see where the value of errno is set. I also can't find the definitation of FATAL_START. Also one exit calls uses a constant that I can't find defined anywhere.
exit (FATAL_START(EINVAL));
For the
errno
values, seeerrno.h
(and other files included from therein), which on a RedHat-based system you will find in/usr/include/errno.h
, provided by packageglibc-headers
.Looking at your link to the source code, the macro
FATAL_START
seems to be defined in the header file transport.hxx, and it just sets bit 7:So, exit code 251 = 128 + 123 would correspond to this:
And 130 = 128 + 2 corresponds to this: