Re: [pgsql-patches] Patch to avoid gprofprofilingoverwrites

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Nikhil S <nikhil(dot)sontakke(at)enterprisedb(dot)com>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>, Korry Douglas <korryd(at)enterprisedb(dot)com>
Subject: Re: [pgsql-patches] Patch to avoid gprofprofilingoverwrites
Date: 2007-02-20 05:03:28
Message-ID: 19949.1171947808@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Bruce Momjian <bruce(at)momjian(dot)us> writes:

> + CFLAGS="$CFLAGS -DPROFILE_PID_DIR -pg ${PROFILE_CFLAGS}"

Kindly use AC_DEFINE instead of random -D in CFLAGS (which is the wrong
place for -D anyway). Also, what exactly is the point here of
PROFILE_CFLAGS? I thought it was supposed to allow substituting
something else for -pg, but you've managed to defeat that.

> + snprintf(gprofDirName, MAXPGPATH, "./gprof/%d", getpid());

getpid is not int everywhere; use a cast. Also, the "./" bits are
silly, and if you ask me so is the MAXPGPATH-sized buffer for a string
that can't exceed 20 or so bytes.

regards, tom lane

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2007-02-20 05:14:18 Re: [PATCHES] WIP patch - INSERT-able log statements
Previous Message Greg Smith 2007-02-20 04:49:07 Re: [PATCHES] WIP patch - INSERT-able log statements