|
8 | 8 | *
|
9 | 9 | *
|
10 | 10 | * IDENTIFICATION
|
11 |
| - * $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.88 2001/08/06 21:55:13 petere Exp $ |
| 11 | + * $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.89 2001/10/18 23:07:29 tgl Exp $ |
12 | 12 | *
|
13 | 13 | *-------------------------------------------------------------------------
|
14 | 14 | */
|
@@ -63,11 +63,13 @@ boolLog_pid;
|
63 | 63 |
|
64 | 64 | staticconstchar*print_timestamp(void);
|
65 | 65 | staticconstchar*print_pid(void);
|
66 |
| -staticvoidsend_notice_to_frontend(constchar*msg); |
67 |
| -staticvoidsend_error_to_frontend(constchar*msg); |
| 66 | +staticvoidsend_message_to_frontend(inttype,constchar*msg); |
68 | 67 | staticconstchar*useful_strerror(interrnum);
|
69 | 68 | staticconstchar*elog_message_prefix(intlev);
|
70 | 69 |
|
| 70 | +#definesend_notice_to_frontend(msg) send_message_to_frontend(NOTICE, msg) |
| 71 | +#definesend_error_to_frontend(msg) send_message_to_frontend(ERROR, msg) |
| 72 | + |
71 | 73 |
|
72 | 74 | staticintDebugfile=-1;
|
73 | 75 |
|
@@ -667,40 +669,18 @@ write_syslog(int level, const char *line)
|
667 | 669 | #endif/* ENABLE_SYSLOG */
|
668 | 670 |
|
669 | 671 |
|
670 |
| - |
671 |
| -staticvoid |
672 |
| -send_notice_or_error_to_frontend(inttype,constchar*msg); |
673 |
| - |
674 |
| - |
675 |
| -staticvoid |
676 |
| -send_notice_to_frontend(constchar*msg) |
677 |
| -{ |
678 |
| -send_notice_or_error_to_frontend(NOTICE,msg); |
679 |
| -} |
680 |
| - |
681 |
| - |
682 |
| -staticvoid |
683 |
| -send_error_to_frontend(constchar*msg) |
684 |
| -{ |
685 |
| -send_notice_or_error_to_frontend(ERROR,msg); |
686 |
| -} |
687 |
| - |
688 |
| - |
689 | 672 | staticvoid
|
690 |
| -send_notice_or_error_to_frontend(inttype,constchar*msg) |
| 673 | +send_message_to_frontend(inttype,constchar*msg) |
691 | 674 | {
|
692 |
| -StringInfobuf; |
| 675 | +StringInfoDatabuf; |
693 | 676 |
|
694 | 677 | AssertArg(type==NOTICE||type==ERROR);
|
695 | 678 |
|
696 |
| -buf=makeStringInfo(); |
697 |
| - |
698 |
| -pq_beginmessage(buf); |
699 |
| -pq_sendbyte(buf,type==NOTICE ?'N' :'E'); |
700 |
| -pq_sendstring(buf,msg); |
701 |
| -pq_endmessage(buf); |
| 679 | +pq_beginmessage(&buf); |
| 680 | +pq_sendbyte(&buf,type==NOTICE ?'N' :'E'); |
| 681 | +pq_sendstring(&buf,msg); |
| 682 | +pq_endmessage(&buf); |
702 | 683 |
|
703 |
| -pfree(buf); |
704 | 684 | /*
|
705 | 685 | * This flush is normally not necessary, since postgres.c will
|
706 | 686 | * flush out waiting data when control returns to the main loop.
|
|