~ubuntu-branches/ubuntu/lucid/postgresql-8.4/lucid-proposed

« back to all changes in this revision

Viewing changes to src/backend/utils/misc/guc.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-05-19 14:03:37 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090519140337-wp9u2si99uppeb81
Tags: 8.4~beta2-2
* Second public beta of 8.4.
* debian/control: Slightly lower the dependencies for postgresql-common to
  >= 98~, so that backports also match.

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
 * Written by Peter Eisentraut <peter_e@gmx.net>.
11
11
 *
12
12
 * IDENTIFICATION
13
 
 *        $PostgreSQL$
 
13
 *        $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.504 2009/05/03 20:09:54 tgl Exp $
14
14
 *
15
15
 *--------------------------------------------------------------------
16
16
 */
7618
7618
{
7619
7619
        if (doit)
7620
7620
        {
 
7621
                char       *canon_val = guc_strdup(ERROR, newval);
 
7622
                char       *tname;
 
7623
                char       *fname;
 
7624
 
 
7625
                canonicalize_path(canon_val);
 
7626
 
 
7627
                tname = guc_malloc(ERROR, strlen(canon_val) + 12);      /* /pgstat.tmp */
 
7628
                sprintf(tname, "%s/pgstat.tmp", canon_val);
 
7629
                fname = guc_malloc(ERROR, strlen(canon_val) + 13);      /* /pgstat.stat */
 
7630
                sprintf(fname, "%s/pgstat.stat", canon_val);
 
7631
 
7621
7632
                if (pgstat_stat_tmpname)
7622
7633
                        free(pgstat_stat_tmpname);
 
7634
                pgstat_stat_tmpname = tname;
7623
7635
                if (pgstat_stat_filename)
7624
7636
                        free(pgstat_stat_filename);
7625
 
 
7626
 
                pgstat_stat_tmpname = guc_malloc(FATAL, strlen(newval) + 12);  /* /pgstat.tmp */
7627
 
                pgstat_stat_filename = guc_malloc(FATAL, strlen(newval) + 13); /* /pgstat.stat */
7628
 
 
7629
 
                sprintf(pgstat_stat_tmpname, "%s/pgstat.tmp", newval);
7630
 
                sprintf(pgstat_stat_filename, "%s/pgstat.stat", newval);
 
7637
                pgstat_stat_filename = fname;
 
7638
 
 
7639
                return canon_val;
7631
7640
        }
7632
 
 
7633
 
        return newval;
 
7641
        else
 
7642
                return newval;
7634
7643
}
7635
7644
 
7636
7645
#include "guc-file.c"