diff options
author | Bruce Momjian <bruce@momjian.us> | 2000-01-18 19:05:31 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2000-01-18 19:05:31 +0000 |
commit | 0cb6bc70cec12d4fbcb68673bd73453061de89f2 (patch) | |
tree | b34d4c0d427b5b24eeb195935957787f843fe59d /src/bin/psql/common.c | |
parent | 2eebcddeaa2a60fe836a8a10ac6c697bdd36bf8e (diff) | |
download | postgresql-0cb6bc70cec12d4fbcb68673bd73453061de89f2.tar.gz postgresql-0cb6bc70cec12d4fbcb68673bd73453061de89f2.zip |
Hi!
Here is a patch to bring both libpq and psql to a state where it compiles on
win32 (native) again. A lot of things have changed, and I have not been able
to keep up with them all, so it has been broken for quite a while.
After this patch, at least it compiles. It also talks "basic talk" to the
server, but I have not yet tested all things. Sending queries, and using
e.g. \d or \dt works fine. The rest will have to be tested further.
It also bumps the version on libpq.dll to 7.0.
Everything should be enclosed in #ifdef WIN32, unless I have missed
something. Except for one or maybe two places where I have moved a #include
that should not be used on win32 from the "global area" into a "#ifndef
WIN32 area".
//Magnus
Diffstat (limited to 'src/bin/psql/common.c')
-rw-r--r-- | src/bin/psql/common.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/bin/psql/common.c b/src/bin/psql/common.c index 8133faa467a..b1241bd53d8 100644 --- a/src/bin/psql/common.c +++ b/src/bin/psql/common.c @@ -111,10 +111,12 @@ setQFout(const char *fname) } /* Direct signals */ +#ifndef WIN32 if (pset.queryFoutPipe) pqsignal(SIGPIPE, SIG_IGN); else pqsignal(SIGPIPE, SIG_DFL); +#endif return status; } @@ -252,11 +254,15 @@ PSQLexec(const char *query) return NULL; cancelConn = pset.db; +#ifndef WIN32 pqsignal(SIGINT, handle_sigint); /* control-C => cancel */ +#endif res = PQexec(pset.db, query); +#ifndef WIN32 pqsignal(SIGINT, SIG_DFL); /* now control-C is back to normal */ +#endif if (PQstatus(pset.db) == CONNECTION_BAD) { @@ -345,11 +351,15 @@ SendQuery(const char *query) } cancelConn = pset.db; +#ifndef WIN32 pqsignal(SIGINT, handle_sigint); +#endif results = PQexec(pset.db, query); +#ifndef WIN32 pqsignal(SIGINT, SIG_DFL); +#endif if (results == NULL) { |