cdio_follow_symlink -> cdio_realpath which is really POSIX realpath. (Suggestion via Thomas Schmitt.) gnu_linux.c: report errors when they occur.

This commit is contained in:
R. Bernstein
2010-01-16 16:44:12 -05:00
parent 2103e77696
commit 7d8b6d0a4d
9 changed files with 51 additions and 40 deletions

View File

@@ -18,8 +18,8 @@ INCLUDES = -I$(top_srcdir) $(LIBCDIO_CFLAGS) $(LIBISO9660_CFLAGS)
freebsd_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV)
freebsd_CFLAGS = -DTEST_DIR=\"$(srcdir)\"
follow_symlink_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV)
follow_symlink_CFLAGS = -DTEST_DIR=\"$(srcdir)\"
realpath_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV)
realpath_CFLAGS = -DTEST_DIR=\"$(srcdir)\"
gnu_linux_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV)
gnu_linux_CFLAGS = -DTEST_DIR=\"$(srcdir)\"
@@ -36,7 +36,7 @@ solaris_CFLAGS = -DTEST_DIR=\"$(srcdir)\"
win32_LDADD = $(LIBCDIO_LIBS) $(LTLIBICONV)
win32_CFLAGS = -DTEST_DIR=\"$(srcdir)\"
check_PROGRAMS = follow_symlink freebsd gnu_linux mmc osx solaris win32
check_PROGRAMS = freebsd gnu_linux mmc osx realpath solaris win32
TESTS = $(check_PROGRAMS)

View File

@@ -121,9 +121,9 @@ main(int argc, const char *argv[])
if (0 == rc) {
/* Just when you thought we'd forgotten, here is our first
test! */
cdio_follow_symlink(psz_symlink_file, psz_file_check);
cdio_realpath(psz_symlink_file, psz_file_check);
if (0 != strncmp(psz_file_check, psz_orig_file, PATH_MAX)) {
fprintf(stderr, "simple cdio_follow_symlink failed. %s vs %s\n",
fprintf(stderr, "simple cdio_realpath failed: %s vs %s\n",
psz_file_check, psz_orig_file);
exit(1);
}
@@ -134,9 +134,9 @@ main(int argc, const char *argv[])
rc = check_rc(symlink(psz_symlink_file, psz_symlink_file),
"symlink", psz_symlink_file);
if (0 == rc) {
cdio_follow_symlink(psz_symlink_file, psz_file_check);
cdio_realpath(psz_symlink_file, psz_file_check);
if (0 != strncmp(psz_file_check, psz_symlink_file, PATH_MAX)) {
fprintf(stderr, "direct cdio_follow_symlink cycle test failed. %s vs %s\n",
fprintf(stderr, "direct cdio_realpath cycle test failed. %s vs %s\n",
psz_file_check, psz_orig_file);
exit(2);
}