mirror of
https://github.com/postgres/postgres.git
synced 2025-11-03 09:13:20 +03:00
pq/signal() portability patch. Also psql copy prompt fix.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.9 1996/11/24 04:05:20 bryanh Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.10 1996/12/26 22:07:03 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -36,6 +36,7 @@
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <signal.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#ifndef WIN32
|
||||
@@ -57,7 +58,7 @@
|
||||
|
||||
#include <postgres.h>
|
||||
|
||||
#include <libpq/pqsignal.h> /* substitute for <signal.h> */
|
||||
#include <libpq/pqsignal.h>
|
||||
#include <libpq/auth.h>
|
||||
#include <libpq/libpq.h> /* where the declarations go */
|
||||
|
||||
@@ -496,7 +497,7 @@ pq_regoob(void (*fptr)())
|
||||
#else /* hpux */
|
||||
fcntl(fd, F_SETOWN, getpid());
|
||||
#endif /* hpux */
|
||||
(void) signal(SIGURG,fptr);
|
||||
(void) pqsignal(SIGURG,fptr);
|
||||
#endif /* WIN32 */
|
||||
}
|
||||
|
||||
@@ -504,7 +505,7 @@ void
|
||||
pq_unregoob()
|
||||
{
|
||||
#ifndef WIN32
|
||||
signal(SIGURG,SIG_DFL);
|
||||
pqsignal(SIGURG,SIG_DFL);
|
||||
#endif /* WIN32 */
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/libpq/pqsignal.c,v 1.4 1996/11/18 02:25:09 bryanh Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/libpq/pqsignal.c,v 1.5 1996/12/26 22:07:08 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* This shouldn't be in libpq, but the monitor and some other
|
||||
@@ -39,12 +39,16 @@
|
||||
* ------------------------------------------------------------------------*/
|
||||
#include <postgres.h>
|
||||
|
||||
#include <signal.h>
|
||||
|
||||
#include <libpq/pqsignal.h>
|
||||
|
||||
pqsigfunc
|
||||
pqsignal(int signo, pqsigfunc func)
|
||||
{
|
||||
#if defined(USE_POSIX_SIGNALS)
|
||||
#if !defined(USE_POSIX_SIGNALS)
|
||||
return signal(signo, func);
|
||||
#else
|
||||
struct sigaction act, oact;
|
||||
|
||||
act.sa_handler = func;
|
||||
@@ -56,8 +60,5 @@ pqsignal(int signo, pqsigfunc func)
|
||||
if (sigaction(signo, &act, &oact) < 0)
|
||||
return(SIG_ERR);
|
||||
return(oact.sa_handler);
|
||||
#else /* !USE_POSIX_SIGNALS */
|
||||
Assert(0);
|
||||
return 0;
|
||||
#endif /* !USE_POSIX_SIGNALS */
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user