diff options
author | Bryan Henderson <bryanh@giraffe.netgate.net> | 1996-10-16 09:41:13 +0000 |
---|---|---|
committer | Bryan Henderson <bryanh@giraffe.netgate.net> | 1996-10-16 09:41:13 +0000 |
commit | 6cbaa93b8274c3902d20f5b04f76ceaf26e290af (patch) | |
tree | 634659bb09ff7ccecb7bffe76abbfc792a997ab0 /src | |
parent | ec610a769625be41c2027f49696ce7b250fc05bc (diff) | |
download | postgresql-6cbaa93b8274c3902d20f5b04f76ceaf26e290af.tar.gz postgresql-6cbaa93b8274c3902d20f5b04f76ceaf26e290af.zip |
Change treatment of sigaction structure again to include even more platforms.
Thanks D'Arcy.
Diffstat (limited to 'src')
-rw-r--r-- | src/interfaces/libpq/fe-connect.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c index 01221829fc7..5bbca3fe486 100644 --- a/src/interfaces/libpq/fe-connect.c +++ b/src/interfaces/libpq/fe-connect.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.10 1996/10/15 07:16:41 bryanh Exp $ + * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.11 1996/10/16 09:41:13 bryanh Exp $ * *------------------------------------------------------------------------- */ @@ -338,13 +338,19 @@ freePGconn(PGconn *conn) static void closePGconn(PGconn *conn) { - const struct sigaction ignore_action = {SIG_IGN, 0, 0}; + struct sigaction ignore_action = {SIG_IGN, 0, 0}; + /* This is used as a constant, but not declared as such because the + sigaction structure is defined differently on different systems */ struct sigaction oldaction; /* If connection is already gone, that's cool. No reason for kernel to kill us when we try to write to it. So ignore SIGPIPE signals. */ + ignore_action.sa_handler = SIG_IGN; + ignore_action.sa_mask = 0; + ignore_action.sa_flags = 0; sigaction(SIGPIPE, (struct sigaction *) &ignore_action, &oldaction); + fputs("X\0", conn->Pfout); fflush(conn->Pfout); sigaction(SIGPIPE, &oldaction, NULL); |