|
12 | 12 | * Copyright (c) 1994, Regents of the University of California
|
13 | 13 | *
|
14 | 14 | * IDENTIFICATION
|
15 |
| - * $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/pgtclId.c,v 1.16 1998/09/21 01:02:03 momjian Exp $ |
| 15 | + * $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/pgtclId.c,v 1.17 1999/01/17 21:14:33 tgl Exp $ |
16 | 16 | *
|
17 | 17 | *-------------------------------------------------------------------------
|
18 | 18 | */
|
@@ -582,6 +582,15 @@ PgNotifyTransferEvents(Pg_ConnectionId * connid)
|
582 | 582 | Tcl_QueueEvent((Tcl_Event*)event,TCL_QUEUE_TAIL);
|
583 | 583 | free(notify);
|
584 | 584 | }
|
| 585 | + |
| 586 | +/* |
| 587 | + * This is also a good place to check for unexpected closure of the |
| 588 | + * connection (ie, backend crash), in which case we must shut down the |
| 589 | + * notify event source to keep Tcl from trying to select() on the now- |
| 590 | + * closed socket descriptor. |
| 591 | + */ |
| 592 | +if (PQsocket(connid->conn)<0) |
| 593 | +PgStopNotifyEventSource(connid); |
585 | 594 | }
|
586 | 595 |
|
587 | 596 | /*
|
|