--- ./libvcd/vcd_image_linuxcd.c.dist Mon May 28 08:09:31 2001 +++ ./libvcd/vcd_image_linuxcd.c Mon Aug 27 21:57:29 2001 @@ -30,15 +30,20 @@ #include #include -#if defined(__linux__) +#if defined(__linux__) || defined(__bsdi__) #include #include +#include #include +#include +#include +#ifdef __linux__ #include -#include -#include +#elif defined(__bsdi__) +#include +#endif /* reader */ @@ -101,17 +106,15 @@ { char buf[ISO_BLOCKSIZE] = { 0, }; - if (fseek (_obj->fd, lsn * ISO_BLOCKSIZE, SEEK_SET)) + if (lseek (fileno(_obj->fd), lsn * ISO_BLOCKSIZE, SEEK_SET) == -1) { - perror ("fseek()"); - clearerr (_obj->fd); + perror ("lseek()"); return 1; } - if (fread (buf, ISO_BLOCKSIZE, 1, _obj->fd) != 1 && ferror (_obj->fd)) + if (read (fileno(_obj->fd), buf, ISO_BLOCKSIZE) != ISO_BLOCKSIZE) { - perror ("fread()"); - clearerr (_obj->fd); + perror ("read()"); return 1; } @@ -141,12 +144,12 @@ return size; } -#endif /* defined(__linux__) */ +#endif /* defined(__linux__) || defined(__bsdi__) */ VcdImageSource * vcd_image_source_new_linuxcd (const char device_filename[]) { -#if defined(__linux__) +#if defined(__linux__) || defined(__bsdi__) _img_linuxcd_src_t *_data; vcd_image_source_funcs _funcs = { @@ -167,10 +170,10 @@ perror ("fopen()"); return NULL; } - + return vcd_image_source_new (_data, &_funcs); #else - vcd_error ("linux cd image source only supported under linux"); + vcd_error ("linux cd image source only supported under linux and bsdi"); return NULL; #endif } --- ./frontends/xml/vcd_xml_rip.c.dist Tue Jul 31 03:44:35 2001 +++ ./frontends/xml/vcd_xml_rip.c Mon Aug 27 11:04:50 2001 @@ -1278,9 +1278,9 @@ {"sector-2336", '\0', POPT_ARG_NONE, §or_2336_flag, 0, "use 2336 byte sector mode for image file"}, -#if defined(__linux__) +#if defined(__linux__) || defined(__bsdi__) {"cdrom-device", '\0', POPT_ARG_STRING, &img_fname, CL_LINUXCD, - "set CDROM device as source (linux only)", "DEVICE"}, + "set CDROM device as source (linux and bsdi only)", "DEVICE"}, #endif {"nrg-file", '\0', POPT_ARG_STRING, &img_fname, CL_NRG, --- ./frontends/cli/vcd_debug.c.dist Wed Aug 1 09:36:56 2001 +++ ./frontends/cli/vcd_debug.c Mon Aug 27 11:01:37 2001 @@ -1385,9 +1385,9 @@ {"sector-2336", '\0', POPT_ARG_NONE, &gl_sector_2336_flag, 0, "use 2336 byte sector mode for image file"}, -#ifdef __linux__ +#if defined(__linux__) || defined(__bsdi__) {"cdrom-device", '\0', POPT_ARG_STRING, &gl_source_name, SOURCE_DEVICE, - "set CDROM device as source (linux only)", "DEVICE"}, + "set CDROM device as source (linux and bsdi only)", "DEVICE"}, #endif {"verbose", 'v', POPT_ARG_NONE, &gl_verbose_flag, 0, --- ./frontends/cli/Makefile.am.dist Thu Jul 26 12:05:34 2001 +++ ./frontends/cli/Makefile.am Mon Aug 27 10:43:21 2001 @@ -1,9 +1,9 @@ if BUILD_CLI_FE_POPT POPT_SUBDIR = popt POPT_INCLUDES = -I$(srcdir)/popt/ -POPT_LIBS = popt/libpopt.a +POPT_LIBS = popt/libpopt.a -ldvd else -POPT_LIBS = -lpopt +POPT_LIBS = -lpopt -ldvd endif bin_PROGRAMS = vcdimager vcddebug --- ./frontends/xml/Makefile.am.dist Mon Aug 27 10:47:59 2001 +++ ./frontends/xml/Makefile.am Mon Aug 27 10:48:11 2001 @@ -1,9 +1,9 @@ if BUILD_CLI_FE_POPT POPT_SUBDIR = popt POPT_INCLUDES = -I$(srcdir)/../cli/popt/ -POPT_LIBS = ../cli/popt/libpopt.a +POPT_LIBS = ../cli/popt/libpopt.a -ldvd else -POPT_LIBS = -lpopt +POPT_LIBS = -lpopt -ldvd endif bin_PROGRAMS = vcdxbuild vcdxgen vcdxrip vcdxminfo --- ./tests/Makefile.am.dist Tue Jun 12 13:10:57 2001 +++ ./tests/Makefile.am Mon Aug 27 10:49:20 2001 @@ -2,7 +2,7 @@ INCLUDES = $(POPT_INCLUDES) -I$(top_srcdir) -I$(top_srcdir)/libvcd/ -VCD_LIBS = $(top_builddir)/libvcd/libvcd.a +VCD_LIBS = $(top_builddir)/libvcd/libvcd.a -ldvd mpegscan_LDADD = $(VCD_LIBS)