diff options
| author | Marc G. Fournier <scrappy@hub.org> | 1997-01-03 18:48:31 +0000 |
|---|---|---|
| committer | Marc G. Fournier <scrappy@hub.org> | 1997-01-03 18:48:31 +0000 |
| commit | b5164666a391d9684db0f7ec8764946a4d67e02f (patch) | |
| tree | 71055ed0e188743907a4f605102c3979c1cab3b4 /src/interfaces/libpgtcl/pgtcl.c | |
| parent | 9d81f5297bd766f5e23236b0f8a9af47a6f4ee8a (diff) | |
| download | postgresql-b5164666a391d9684db0f7ec8764946a4d67e02f.tar.gz | |
someone added pg_listen and pg_notifies to libpgtcl. But first
these routines try to use the old pointer casting stuff to get
the connection id, second the notification hash table should
be part of the cliendData. Otherwise, one interpreter might
eat up the notifies for another one.
Please apply the patch below to the current 6.0 tree.
Submitted by: wieck@sapserv.debis.de
Diffstat (limited to 'src/interfaces/libpgtcl/pgtcl.c')
| -rw-r--r-- | src/interfaces/libpgtcl/pgtcl.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/interfaces/libpgtcl/pgtcl.c b/src/interfaces/libpgtcl/pgtcl.c index cc77d7e685..8df0c42105 100644 --- a/src/interfaces/libpgtcl/pgtcl.c +++ b/src/interfaces/libpgtcl/pgtcl.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/pgtcl.c,v 1.6 1996/12/19 05:02:47 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/pgtcl.c,v 1.7 1997/01/03 18:48:28 scrappy Exp $ * *------------------------------------------------------------------------- */ @@ -49,6 +49,7 @@ Pgtcl_AtExit (ClientData cData) Tcl_DeleteHashTable(&(cd->dbh_hash)); Tcl_DeleteHashTable(&(cd->res_hash)); + Tcl_DeleteHashTable(&(cd->notify_hash)); Tcl_DeleteExitHandler(Pgtcl_AtExit, cData); } @@ -71,6 +72,7 @@ Pgtcl_Init (Tcl_Interp *interp) cd = (Pg_clientData *)ckalloc(sizeof(Pg_clientData)); Tcl_InitHashTable(&(cd->dbh_hash), TCL_STRING_KEYS); Tcl_InitHashTable(&(cd->res_hash), TCL_STRING_KEYS); + Tcl_InitHashTable(&(cd->notify_hash), TCL_STRING_KEYS); cd->dbh_count = 0L; cd->res_count = 0L; @@ -162,12 +164,12 @@ Pgtcl_Init (Tcl_Interp *interp) Tcl_CreateCommand(interp, "pg_listen", Pg_listen, - (ClientData)NULL, (Tcl_CmdDeleteProc*)NULL); + (ClientData)cd, (Tcl_CmdDeleteProc*)NULL); Tcl_CreateCommand(interp, "pg_notifies", Pg_notifies, - (ClientData)NULL, (Tcl_CmdDeleteProc*)NULL); + (ClientData)cd, (Tcl_CmdDeleteProc*)NULL); Tcl_PkgProvide(interp, "Pgtcl", "1.0"); |
