From eae76def3a242d30a472051700faf499a4d9ae4f Mon Sep 17 00:00:00 2001 From: "R. Bernstein" Date: Thu, 14 Jan 2010 06:05:06 -0500 Subject: [PATCH] CLean up better by remove temporary symbolic link file. --- test/driver/follow_symlink.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/driver/follow_symlink.c b/test/driver/follow_symlink.c index 32c594ea..bb4ad7f5 100644 --- a/test/driver/follow_symlink.c +++ b/test/driver/follow_symlink.c @@ -90,6 +90,7 @@ main(int argc, const char *argv[]) char psz_file_check[PATH_MAX+1]; char *psz_last_slash; unsigned int i_last_slash; + char *psz_symlink_file = NULL; psz_tmp_subdir = get_temporary_name(NULL, "temporary directory"); if (NULL == psz_tmp_subdir) { @@ -112,7 +113,6 @@ main(int argc, const char *argv[]) psz_orig_file = get_temporary_name(NULL, "file"); if (NULL != psz_orig_file) { FILE *fp = fopen(psz_orig_file, "w"); - char *psz_symlink_file; int rc; fprintf(fp, "testing\n"); fclose(fp); @@ -134,7 +134,8 @@ main(int argc, const char *argv[]) } - + if (NULL != psz_symlink_file) + check_rc(unlink(psz_symlink_file), "unlink", psz_symlink_file); check_rc(unlink(psz_orig_file), "unlink", psz_orig_file); check_rc(rmdir(psz_tmp_subdir), "rmdir", psz_tmp_subdir);