Changeset: bb0a450525aa for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bb0a450525aa
Modified Files:
sql/src/benchmarks/tpch/dbgen/bm_utils.c
Branch: Oct2010
Log Message:
Only look at stat structure if the call to stat succeeded.
diffs (20 lines):
diff -r f68a5814bcc1 -r bb0a450525aa sql/src/benchmarks/tpch/dbgen/bm_utils.c
--- a/sql/src/benchmarks/tpch/dbgen/bm_utils.c Fri Oct 15 10:36:33 2010 +0200
+++ b/sql/src/benchmarks/tpch/dbgen/bm_utils.c Fri Oct 15 10:37:46 2010 +0200
@@ -381,14 +381,14 @@
fprintf(stderr, "stat(%s) failed.\n", fullpath);
exit(-1);
}
- if (S_ISREG(fstats.st_mode) && !force && *mode != 'r' )
+ if (retcode == 0 && S_ISREG(fstats.st_mode) && !force && *mode != 'r' )
{
sprintf(prompt, "Do you want to overwrite %s ?", fullpath);
if (!yes_no(prompt))
exit(0);
}
- if (S_ISFIFO(fstats.st_mode))
+ if (retcode == 0 && S_ISFIFO(fstats.st_mode))
{
retcode =
open(fullpath, ((*mode == 'r')?O_RDONLY:O_WRONLY)|O_CREAT);
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list