提交 fc7c16fd 编写于 作者: J Jan Wieck

dllist.c is included in the frontend libpq interface via symlink.

There is no elog() available. Used fprintf(stderr, ...) and exit
instead.

Jan
上级 c9445f08
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/lib/dllist.c,v 1.22 2001/06/01 19:54:58 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/lib/dllist.c,v 1.23 2001/06/02 15:16:55 wieck Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
/* can be used in frontend or backend */ /* can be used in frontend or backend */
#ifdef FRONTEND #ifdef FRONTEND
#include "postgres_fe.h" #include "postgres_fe.h"
#include <sysexits.h>
/* No assert checks in frontend ... */ /* No assert checks in frontend ... */
#define Assert(condition) #define Assert(condition)
#else #else
...@@ -33,7 +34,14 @@ DLNewList(void) ...@@ -33,7 +34,14 @@ DLNewList(void)
l = (Dllist *) malloc(sizeof(Dllist)); l = (Dllist *) malloc(sizeof(Dllist));
if (l == NULL) if (l == NULL)
#ifdef FRONTEND
{
fprintf(stderr, "Memory exhausted in DLNewList");
exit(EX_UNAVAILABLE);
}
#else
elog(ERROR, "Memory exhausted in DLNewList"); elog(ERROR, "Memory exhausted in DLNewList");
#endif
l->dll_head = 0; l->dll_head = 0;
l->dll_tail = 0; l->dll_tail = 0;
...@@ -69,7 +77,14 @@ DLNewElem(void *val) ...@@ -69,7 +77,14 @@ DLNewElem(void *val)
e = (Dlelem *) malloc(sizeof(Dlelem)); e = (Dlelem *) malloc(sizeof(Dlelem));
if (e == NULL) if (e == NULL)
#ifdef FRONTEND
{
fprintf(stderr, "Memory exhausted in DLNewList");
exit(EX_UNAVAILABLE);
}
#else
elog(ERROR, "Memory exhausted in DLNewElem"); elog(ERROR, "Memory exhausted in DLNewElem");
#endif
e->dle_next = 0; e->dle_next = 0;
e->dle_prev = 0; e->dle_prev = 0;
e->dle_val = val; e->dle_val = val;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册