pgsql: Move pqsignal() to libpgport.

Started by Tom Lanealmost 13 years ago4 messages
#1Tom Lane
tgl@sss.pgh.pa.us

Move pqsignal() to libpgport.

We had two copies of this function in the backend and libpq, which was
already pretty bogus, but it turns out that we need it in some other
programs that don't use libpq (such as pg_test_fsync). So put it where
it probably should have been all along. The signal-mask-initialization
support in src/backend/libpq/pqsignal.c stays where it is, though, since
we only need that in the backend.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/da5aeccf64b37a8e9bd3cb605848590595dbcbf8

Modified Files
--------------
contrib/pgbench/pgbench.c | 1 -
src/backend/access/transam/xlog.c | 1 -
src/backend/libpq/pqsignal.c | 67 +---------------------------
src/backend/main/main.c | 3 -
src/backend/port/win32/signal.c | 8 +++-
src/backend/port/win32/timer.c | 2 -
src/backend/replication/walsender.c | 1 -
src/backend/utils/misc/timeout.c | 1 -
src/bin/initdb/.gitignore | 1 -
src/bin/initdb/Makefile | 9 +---
src/bin/initdb/initdb.c | 1 -
src/bin/pg_basebackup/pg_receivexlog.c | 1 -
src/bin/pg_ctl/pg_ctl.c | 1 -
src/bin/psql/common.c | 2 -
src/bin/psql/copy.c | 1 -
src/bin/psql/print.c | 1 -
src/bin/scripts/common.c | 1 -
src/include/libpq/pqsignal.h | 11 +----
src/include/port.h | 7 +++
src/interfaces/libpq/Makefile | 2 +-
src/interfaces/libpq/bcc32.mak | 2 -
src/interfaces/libpq/fe-misc.c | 1 -
src/interfaces/libpq/fe-print.c | 1 -
src/interfaces/libpq/fe-secure.c | 1 -
src/interfaces/libpq/pqsignal.c | 49 --------------------
src/interfaces/libpq/pqsignal.h | 25 ----------
src/interfaces/libpq/win32.mak | 2 -
src/pl/plperl/plperl.c | 1 -
src/port/Makefile | 3 +-
src/port/pqsignal.c | 76 ++++++++++++++++++++++++++++++++
30 files changed, 99 insertions(+), 184 deletions(-)

--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers

#2Guillaume Lelarge
guillaume@lelarge.info
In reply to: Tom Lane (#1)
1 attachment(s)
Re: [COMMITTERS] pgsql: Move pqsignal() to libpgport.

On Sun, 2013-03-17 at 16:06 +0000, Tom Lane wrote:

Move pqsignal() to libpgport.

We had two copies of this function in the backend and libpq, which was
already pretty bogus, but it turns out that we need it in some other
programs that don't use libpq (such as pg_test_fsync). So put it where
it probably should have been all along. The signal-mask-initialization
support in src/backend/libpq/pqsignal.c stays where it is, though, since
we only need that in the backend.

Hi,

When I try to compile HEAD right after this commit, I have this issue
with pg_receivexlog:

pg_receivexlog.c: In function ‘main’:
pg_receivexlog.c:425:11: error: ‘SIGINT’ undeclared (first use in this
function)
pg_receivexlog.c:425:11: note: each undeclared identifier is reported
only once for each function it appears in

The attached patch fixes this. Not sure it's the right fix though...

--
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com

Attachments:

signal.patchtext/x-patch; charset=UTF-8; name=signal.patchDownload
diff --git a/src/bin/pg_basebackup/pg_receivexlog.c b/src/bin/pg_basebackup/pg_receivexlog.c
index e65f127..91caf66 100644
--- a/src/bin/pg_basebackup/pg_receivexlog.c
+++ b/src/bin/pg_basebackup/pg_receivexlog.c
@@ -20,6 +20,7 @@
 #include "streamutil.h"
 
 #include <dirent.h>
+#include <signal.h>
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <unistd.h>
#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Guillaume Lelarge (#2)
Re: [COMMITTERS] pgsql: Move pqsignal() to libpgport.

Guillaume Lelarge <guillaume@lelarge.info> writes:

On Sun, 2013-03-17 at 16:06 +0000, Tom Lane wrote:

Move pqsignal() to libpgport.

When I try to compile HEAD right after this commit, I have this issue
with pg_receivexlog:

Oddly, I didn't see that on the machine I was testing on --- it must
have something else pulling in <signal.h> there. Fixed.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#4Guillaume Lelarge
guillaume@lelarge.info
In reply to: Tom Lane (#3)
Re: [COMMITTERS] pgsql: Move pqsignal() to libpgport.

On Sun, 2013-03-17 at 14:13 -0400, Tom Lane wrote:

Guillaume Lelarge <guillaume@lelarge.info> writes:

On Sun, 2013-03-17 at 16:06 +0000, Tom Lane wrote:

Move pqsignal() to libpgport.

When I try to compile HEAD right after this commit, I have this issue
with pg_receivexlog:

Oddly, I didn't see that on the machine I was testing on --- it must
have something else pulling in <signal.h> there. Fixed.

Thanks.

--
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers