Makefile.am: add CDIO_ to all #defines in cdio_config.h

extract.c: give filename on extract errors and convert encoding to unix.
This commit is contained in:
R. Bernstein
2012-03-04 13:38:35 -05:00
parent 8eabfdd37a
commit 39bd8104b8
2 changed files with 306 additions and 305 deletions

View File

@@ -111,7 +111,7 @@ static int udf_extract_files(udf_t *p_udf, udf_dirent_t *p_udf_dirent, const cha
} else {
fd = fopen(psz_fullpath, "wb");
if (fd == NULL) {
fprintf(stderr, " Unable to create file\n");
fprintf(stderr, " Unable to create file %s\n", psz_fullpath);
goto out;
}
i_file_length = udf_get_file_length(p_udf_dirent);
@@ -124,7 +124,8 @@ static int udf_extract_files(udf_t *p_udf, udf_dirent_t *p_udf_dirent, const cha
}
fwrite(buf, (size_t)MIN(i_file_length, i_read), 1, fd);
if (ferror(fd)) {
fprintf(stderr, " Error writing file: %s\n", strerror(errno));
fprintf(stderr, " Error writing file %s: %s\n", psz_fullpath,
strerror(errno));
goto out;
}
i_file_length -= i_read;
@@ -198,7 +199,8 @@ static int iso_extract_files(iso9660_t* p_iso, const char *psz_path)
}
fwrite(buf, (size_t)MIN(i_file_length, ISO_BLOCKSIZE), 1, fd);
if (ferror(fd)) {
fprintf(stderr, " Error writing file: %s\n", strerror(errno));
fprintf(stderr, " Error writing file %s: %s\n", psz_iso_name,
strerror(errno));
goto out;
}
i_file_length -= ISO_BLOCKSIZE;

View File

@@ -19,10 +19,10 @@
#
cdio_config.h: $(top_builddir)/config.h
echo '#ifndef __CDIO_CONFIG_H__' > cdio_config.h
echo '#define __CDIO_CONFIG_H__' >> cdio_config.h
cat $(top_builddir)/config.h >>cdio_config.h
echo '#endif /* #ifndef CDIO_CONFIG_H */' >>cdio_config.h
@echo '#ifndef __CDIO_CONFIG_H__' > cdio_config.h
@echo '#define __CDIO_CONFIG_H__' >> cdio_config.h
@@SED@ -re 's/^(#[ \t]*define) /\1 CDIO_/' $(top_builddir)/config.h >>cdio_config.h
@echo '#endif /* #ifndef CDIO_CONFIG_H */' >>cdio_config.h
libcdioincludedir=$(includedir)/cdio
dist_libcdioinclude_HEADERS = \
@@ -30,7 +30,6 @@ dist_libcdioinclude_HEADERS = \
bytesex.h \
bytesex_asm.h \
cdio.h \
cdio_unconfig.h \
cd_types.h \
cdtext.h \
device.h \