diff options
author | Bruce Momjian <bruce@momjian.us> | 2006-06-07 22:24:46 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2006-06-07 22:24:46 +0000 |
commit | 399a36a75d2d06bfdb91402713d408271b4833ba (patch) | |
tree | b8391f6bda4680d37ac430c3270c67bde979d842 /src/bin/psql/command.c | |
parent | 877e296306a2017a18fc7086e9742c8ee3e0a665 (diff) | |
download | postgresql-399a36a75d2d06bfdb91402713d408271b4833ba.tar.gz postgresql-399a36a75d2d06bfdb91402713d408271b4833ba.zip |
Prepare code to be built by MSVC:
o remove many WIN32_CLIENT_ONLY defines
o add WIN32_ONLY_COMPILER define
o add 3rd argument to open() for portability
o add include/port/win32_msvc directory for
system includes
Magnus Hagander
Diffstat (limited to 'src/bin/psql/command.c')
-rw-r--r-- | src/bin/psql/command.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c index 63161edd457..3c5bd6740f1 100644 --- a/src/bin/psql/command.c +++ b/src/bin/psql/command.c @@ -3,12 +3,12 @@ * * Copyright (c) 2000-2006, PostgreSQL Global Development Group * - * $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.168 2006/06/01 00:15:36 tgl Exp $ + * $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.169 2006/06/07 22:24:45 momjian Exp $ */ #include "postgres_fe.h" #include "command.h" -#ifdef WIN32_CLIENT_ONLY /* needed for BCC */ +#ifdef __BORLANDC__ /* needed for BCC */ #undef mkdir #endif @@ -26,11 +26,9 @@ #include <io.h> #include <fcntl.h> #include <direct.h> -#ifndef WIN32_CLIENT_ONLY #include <sys/types.h> /* for umask() */ #include <sys/stat.h> /* for stat() */ #endif -#endif #include "libpq-fe.h" #include "pqexpbuffer.h" @@ -1261,10 +1259,8 @@ do_edit(const char *filename_arg, PQExpBuffer query_buf) bool error = false; int fd; -#ifndef WIN32_CLIENT_ONLY struct stat before, after; -#endif if (filename_arg) fname = filename_arg; @@ -1339,19 +1335,16 @@ do_edit(const char *filename_arg, PQExpBuffer query_buf) } } -#ifndef WIN32_CLIENT_ONLY if (!error && stat(fname, &before) != 0) { psql_error("%s: %s\n", fname, strerror(errno)); error = true; } -#endif /* call editor */ if (!error) error = !editFile(fname); -#ifndef WIN32_CLIENT_ONLY if (!error && stat(fname, &after) != 0) { psql_error("%s: %s\n", fname, strerror(errno)); @@ -1360,10 +1353,6 @@ do_edit(const char *filename_arg, PQExpBuffer query_buf) if (!error && before.st_mtime != after.st_mtime) { -#else - if (!error) - { -#endif stream = fopen(fname, PG_BINARY_R); if (!stream) { |