Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf03b75e

Browse files
committed
Removed un-needed signal suff from pginterface.
1 parent604ce32 commitf03b75e

File tree

5 files changed

+0
-57
lines changed

5 files changed

+0
-57
lines changed

‎contrib/pginterface/README

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,6 @@ useful if you are running the query engine on a system with a different
2222
architecture than the database server. If you pass a NULL pointer, the
2323
column is skipped, and you can use libpq to handle it as you wish.
2424

25-
I have used sigprocmask() to block the reception of certain signals
26-
while the program is executing SQL queries. This prevents a user
27-
pressing Control-C from stopping all the back ends. It blocks SIGHUP,
28-
SIGINT, and SIGTERM, but does not block SIGQUIT or obviously kill -9.
29-
If your platform does not support sigprocmask(), you can remove those
30-
function calls. ( Am I correct that abnormal termination can cause
31-
shared memory resynchronization?)
32-
3325
There is a demo program called pginsert that demonstrates how the
3426
library can be used.
3527

‎contrib/pginterface/pginsert.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
*/
55

66
#include<stdio.h>
7-
#include<signal.h>
8-
#include<time.h>
97
#include<libpq-fe.h>
108
#include"halt.h"
119
#include"pginterface.h"

‎contrib/pginterface/pginterface.c

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,13 @@
44
*/
55

66
#include<stdio.h>
7-
#include<signal.h>
87
#include<string.h>
98
#include<stdarg.h>
109

1110
#include<libpq-fe.h>
1211
#include"halt.h"
1312
#include"pginterface.h"
1413

15-
staticvoidsig_disconnect();
16-
staticvoidset_signals();
17-
1814
#defineNUL '\0'
1915

2016
/* GLOBAL VARIABLES */
@@ -27,8 +23,6 @@ static PGresult *res = NULL;
2723
staticinton_error_state=ON_ERROR_STOP;
2824

2925
/* LOCAL VARIABLES */
30-
staticsigset_tblock_sigs,
31-
unblock_sigs;
3226
staticinttuple;
3327

3428
/*
@@ -48,7 +42,6 @@ connectdb(char *dbName,
4842
if (PQstatus(conn)==CONNECTION_BAD)
4943
halt("Connection to database '%s' failed.\n%s\n",dbName,
5044
PQerrorMessage(conn));
51-
set_signals();
5245
returnconn;
5346
}
5447

@@ -74,9 +67,7 @@ doquery(char *query)
7467
if (res!=NULL)
7568
PQclear(res);
7669

77-
sigprocmask(SIG_SETMASK,&block_sigs,NULL);
7870
res=PQexec(conn,query);
79-
sigprocmask(SIG_SETMASK,&unblock_sigs,NULL);
8071

8172
if (on_error_state==ON_ERROR_STOP&&
8273
(res==NULL||
@@ -196,37 +187,3 @@ on_error_continue()
196187
{
197188
on_error_state=ON_ERROR_CONTINUE;
198189
}
199-
200-
/*
201-
**
202-
**sig_disconnect
203-
**
204-
*/
205-
staticvoid
206-
sig_disconnect()
207-
{
208-
fprintf(stderr,"exiting...\n");
209-
PQfinish(conn);
210-
exit(1);
211-
}
212-
213-
/*
214-
**
215-
**set_signals
216-
**
217-
*/
218-
staticvoid
219-
set_signals()
220-
{
221-
sigemptyset(&block_sigs);
222-
sigemptyset(&unblock_sigs);
223-
sigaddset(&block_sigs,SIGTERM);
224-
sigaddset(&block_sigs,SIGHUP);
225-
sigaddset(&block_sigs,SIGINT);
226-
/*sigaddset(&block_sigs,SIGQUIT); no block */
227-
sigprocmask(SIG_SETMASK,&unblock_sigs,NULL);
228-
signal(SIGTERM,sig_disconnect);
229-
signal(SIGHUP,sig_disconnect);
230-
signal(SIGINT,sig_disconnect);
231-
signal(SIGQUIT,sig_disconnect);
232-
}

‎contrib/pginterface/pgnulltest.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
#defineTEST_NON_NULLS
77

88
#include<stdio.h>
9-
#include<signal.h>
10-
#include<time.h>
119
#include<halt.h>
1210
#include<libpq-fe.h>
1311
#include<pginterface.h>

‎contrib/pginterface/pgwordcount.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
*/
55

66
#include<stdio.h>
7-
#include<signal.h>
8-
#include<time.h>
97
#include"halt.h"
108
#include<libpq-fe.h>
119
#include"pginterface.h"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp