diff options
Diffstat (limited to 'src/bin/psql/command.c')
-rw-r--r-- | src/bin/psql/command.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c index a8e956530b2..2b8fcb9dcde 100644 --- a/src/bin/psql/command.c +++ b/src/bin/psql/command.c @@ -3,7 +3,7 @@ * * Copyright (c) 2000-2003, PostgreSQL Global Development Group * - * $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.111 2004/01/25 03:07:22 neilc Exp $ + * $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.112 2004/01/26 22:35:32 tgl Exp $ */ #include "postgres_fe.h" #include "command.h" @@ -1601,8 +1601,12 @@ do_edit(const char *filename_arg, PQExpBuffer query_buf) remove(fname); error = true; } - else - fclose(stream); + else if (fclose(stream) != 0) + { + psql_error("%s: %s\n", fname, strerror(errno)); + remove(fname); + error = true; + } } } |