Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit fc7c16f

Browse files
Jan WieckJan Wieck
Jan Wieck
authored and
Jan Wieck
committed
dllist.c is included in the frontend libpq interface via symlink.
There is no elog() available. Used fprintf(stderr, ...) and exit instead. Jan
1 parent c9445f0 commit fc7c16f

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/backend/lib/dllist.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $Header: /cvsroot/pgsql/src/backend/lib/dllist.c,v 1.22 2001/06/01 19:54:58 tgl Exp $
12+
* $Header: /cvsroot/pgsql/src/backend/lib/dllist.c,v 1.23 2001/06/02 15:16:55 wieck Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
1616

1717
/* can be used in frontend or backend */
1818
#ifdef FRONTEND
1919
#include "postgres_fe.h"
20+
#include <sysexits.h>
2021
/* No assert checks in frontend ... */
2122
#define Assert(condition)
2223
#else
@@ -33,7 +34,14 @@ DLNewList(void)
3334

3435
l = (Dllist *) malloc(sizeof(Dllist));
3536
if (l == NULL)
37+
#ifdef FRONTEND
38+
{
39+
fprintf(stderr, "Memory exhausted in DLNewList");
40+
exit(EX_UNAVAILABLE);
41+
}
42+
#else
3643
elog(ERROR, "Memory exhausted in DLNewList");
44+
#endif
3745
l->dll_head = 0;
3846
l->dll_tail = 0;
3947

@@ -69,7 +77,14 @@ DLNewElem(void *val)
6977

7078
e = (Dlelem *) malloc(sizeof(Dlelem));
7179
if (e == NULL)
80+
#ifdef FRONTEND
81+
{
82+
fprintf(stderr, "Memory exhausted in DLNewList");
83+
exit(EX_UNAVAILABLE);
84+
}
85+
#else
7286
elog(ERROR, "Memory exhausted in DLNewElem");
87+
#endif
7388
e->dle_next = 0;
7489
e->dle_prev = 0;
7590
e->dle_val = val;

0 commit comments

Comments
 (0)