Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8c72526

Browse files
committed
Department of second thoughts. Remove FRONTEND from snprintf.c because
snprintf is called before the memory system is started. We have to justmalloc/free. There are no elogs in the code so we should be fine.
1 parent169adfc commit8c72526

File tree

2 files changed

+4
-17
lines changed

2 files changed

+4
-17
lines changed

‎src/port/Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#for use only by the backend binaries
1616
#
1717
# IDENTIFICATION
18-
# $PostgreSQL: pgsql/src/port/Makefile,v 1.24 2005/03/2002:44:45 momjian Exp $
18+
# $PostgreSQL: pgsql/src/port/Makefile,v 1.25 2005/03/2003:53:39 momjian Exp $
1919
#
2020
#-------------------------------------------------------------------------
2121

@@ -31,7 +31,6 @@ LIBOBJS_SRV := $(LIBOBJS)
3131
LIBOBJS_SRV :=$(patsubst dirmod.o,dirmod_srv.o,$(LIBOBJS_SRV))
3232
LIBOBJS_SRV :=$(patsubst exec.o,exec_srv.o,$(LIBOBJS_SRV))
3333
LIBOBJS_SRV :=$(patsubst getaddrinfo.o,getaddrinfo_srv.o,$(LIBOBJS_SRV))
34-
LIBOBJS_SRV :=$(patsubst snprintf.o,snprintf_srv.o,$(LIBOBJS_SRV))
3534
LIBOBJS_SRV :=$(patsubst thread.o,thread_srv.o,$(LIBOBJS_SRV))
3635

3736
all: libpgport.a libpgport_srv.a

‎src/port/snprintf.c

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,14 @@
3232
* SUCH DAMAGE.
3333
*/
3434

35-
#ifndefFRONTEND
3635
#include"postgres.h"
37-
#else
38-
#include"postgres_fe.h"
39-
#endif
4036

4137
#ifndefWIN32
4238
#include<sys/ioctl.h>
4339
#endif
4440
#include<sys/param.h>
4541

42+
4643
/*
4744
**SNPRINTF, VSNPRINT -- counted versions of printf
4845
**
@@ -65,7 +62,7 @@
6562
* causing nasty effects.
6663
**************************************************************/
6764

68-
/*static char _id[] = "$PostgreSQL: pgsql/src/port/snprintf.c,v 1.24 2005/03/17 03:18:14 momjian Exp $";*/
65+
/*static char _id[] = "$PostgreSQL: pgsql/src/port/snprintf.c,v 1.25 2005/03/20 03:53:39 momjian Exp $";*/
6966

7067
staticvoiddopr(char*buffer,constchar*format,va_listargs,char*end);
7168

@@ -227,10 +224,7 @@ dopr(char *buffer, const char *format, va_list args, char *end)
227224
for (p=format;*p!='\0';p++)
228225
if (*p=='%')/* counts %% as two, so overcounts */
229226
percents++;
230-
#ifndefFRONTEND
231-
fmtpar=pgport_palloc(sizeof(structfmtpar)*percents);
232-
fmtparptr=pgport_palloc(sizeof(structfmtpar*)*percents);
233-
#else
227+
234228
if ((fmtpar=malloc(sizeof(structfmtpar)*percents))==NULL)
235229
{
236230
fprintf(stderr,_("out of memory\n"));
@@ -241,7 +235,6 @@ dopr(char *buffer, const char *format, va_list args, char *end)
241235
fprintf(stderr,_("out of memory\n"));
242236
exit(1);
243237
}
244-
#endif
245238

246239
format_save=format;
247240

@@ -586,13 +579,8 @@ dopr(char *buffer, const char *format, va_list args, char *end)
586579
}
587580
*output='\0';
588581

589-
#ifndefFRONTEND
590-
pgport_pfree(fmtpar);
591-
pgport_pfree(fmtparptr);
592-
#else
593582
free(fmtpar);
594583
free(fmtparptr);
595-
#endif
596584
}
597585

598586
staticvoid

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp