AC_REPLACE_FUNCS(gettimeofday)
AC_LIBOBJ(kill)
AC_LIBOBJ(open)
+ AC_LIBOBJ(system)
AC_LIBOBJ(win32env)
AC_LIBOBJ(win32error)
AC_LIBOBJ(win32setlocale)
int pre_dot,
post_dot;
- snprintf(cmd, sizeof(cmd), SYSTEMQUOTE "\"%s/pg_ctl\" --version" SYSTEMQUOTE, cluster->bindir);
+ snprintf(cmd, sizeof(cmd), "\"%s/pg_ctl\" --version", cluster->bindir);
if ((output = popen(cmd, "r")) == NULL ||
fgets(cmd_output, sizeof(cmd_output), output) == NULL)
pg_putenv("LC_ALL", NULL);
pg_putenv("LC_MESSAGES", "C");
- snprintf(cmd, sizeof(cmd), SYSTEMQUOTE "\"%s/%s \"%s\"" SYSTEMQUOTE,
+ snprintf(cmd, sizeof(cmd), "\"%s/%s \"%s\"",
cluster->bindir,
live_check ? "pg_controldata\"" : "pg_resetxlog\" -n",
cluster->pgdata);
mainThreadId = GetCurrentThreadId();
#endif
- written = strlcpy(cmd, SYSTEMQUOTE, sizeof(cmd));
+ written = 0;
va_start(ap, fmt);
written += vsnprintf(cmd + written, MAXCMDLEN - written, fmt, ap);
va_end(ap);
if (written >= MAXCMDLEN)
pg_fatal("command too long\n");
written += snprintf(cmd + written, MAXCMDLEN - written,
- " >> \"%s\" 2>&1" SYSTEMQUOTE, log_file);
+ " >> \"%s\" 2>&1", log_file);
if (written >= MAXCMDLEN)
pg_fatal("command too long\n");
test_buffs = MIN_BUFS_FOR_CONNS(test_conns);
snprintf(cmd, sizeof(cmd),
- SYSTEMQUOTE "\"%s\" --boot -x0 %s "
+ "\"%s\" --boot -x0 %s "
"-c max_connections=%d "
"-c shared_buffers=%d "
"-c dynamic_shared_memory_type=none "
- "< \"%s\" > \"%s\" 2>&1" SYSTEMQUOTE,
+ "< \"%s\" > \"%s\" 2>&1",
backend_exec, boot_options,
test_conns, test_buffs,
DEVNULL, DEVNULL);
}
snprintf(cmd, sizeof(cmd),
- SYSTEMQUOTE "\"%s\" --boot -x0 %s "
+ "\"%s\" --boot -x0 %s "
"-c max_connections=%d "
"-c shared_buffers=%d "
"-c dynamic_shared_memory_type=none "
- "< \"%s\" > \"%s\" 2>&1" SYSTEMQUOTE,
+ "< \"%s\" > \"%s\" 2>&1",
backend_exec, boot_options,
n_connections, test_buffs,
DEVNULL, DEVNULL);
unsetenv("PGCLIENTENCODING");
snprintf(cmd, sizeof(cmd),
- SYSTEMQUOTE "\"%s\" --boot -x1 %s %s %s" SYSTEMQUOTE,
+ "\"%s\" --boot -x1 %s %s %s",
backend_exec,
data_checksums ? "-k" : "",
boot_options, talkargs);
fflush(stdout);
snprintf(cmd, sizeof(cmd),
- SYSTEMQUOTE "\"%s\" %s template1 >%s" SYSTEMQUOTE,
+ "\"%s\" %s template1 >%s",
backend_exec, backend_options,
DEVNULL);
fflush(stdout);
snprintf(cmd, sizeof(cmd),
- SYSTEMQUOTE "\"%s\" %s template1 >%s" SYSTEMQUOTE,
+ "\"%s\" %s template1 >%s",
backend_exec, backend_options,
DEVNULL);
fflush(stdout);
snprintf(cmd, sizeof(cmd),
- SYSTEMQUOTE "\"%s\" %s template1 >%s" SYSTEMQUOTE,
+ "\"%s\" %s template1 >%s",
backend_exec, backend_options,
DEVNULL);
* We use -j here to avoid backslashing stuff in system_views.sql
*/
snprintf(cmd, sizeof(cmd),
- SYSTEMQUOTE "\"%s\" %s -j template1 >%s" SYSTEMQUOTE,
+ "\"%s\" %s -j template1 >%s",
backend_exec, backend_options,
DEVNULL);
fflush(stdout);
snprintf(cmd, sizeof(cmd),
- SYSTEMQUOTE "\"%s\" %s template1 >%s" SYSTEMQUOTE,
+ "\"%s\" %s template1 >%s",
backend_exec, backend_options,
DEVNULL);
#if defined(HAVE_LOCALE_T) && !defined(WIN32)
snprintf(cmd, sizeof(cmd),
- SYSTEMQUOTE "\"%s\" %s template1 >%s" SYSTEMQUOTE,
+ "\"%s\" %s template1 >%s",
backend_exec, backend_options,
DEVNULL);
fflush(stdout);
snprintf(cmd, sizeof(cmd),
- SYSTEMQUOTE "\"%s\" %s template1 >%s" SYSTEMQUOTE,
+ "\"%s\" %s template1 >%s",
backend_exec, backend_options,
DEVNULL);
* We use -j here to avoid backslashing stuff
*/
snprintf(cmd, sizeof(cmd),
- SYSTEMQUOTE "\"%s\" %s -j template1 >%s" SYSTEMQUOTE,
+ "\"%s\" %s -j template1 >%s",
backend_exec, backend_options,
DEVNULL);
fflush(stdout);
snprintf(cmd, sizeof(cmd),
- SYSTEMQUOTE "\"%s\" %s template1 >%s" SYSTEMQUOTE,
+ "\"%s\" %s template1 >%s",
backend_exec, backend_options,
DEVNULL);
* We use -j here to avoid backslashing stuff in information_schema.sql
*/
snprintf(cmd, sizeof(cmd),
- SYSTEMQUOTE "\"%s\" %s -j template1 >%s" SYSTEMQUOTE,
+ "\"%s\" %s -j template1 >%s",
backend_exec, backend_options,
DEVNULL);
PG_CMD_CLOSE;
snprintf(cmd, sizeof(cmd),
- SYSTEMQUOTE "\"%s\" %s template1 >%s" SYSTEMQUOTE,
+ "\"%s\" %s template1 >%s",
backend_exec, backend_options,
DEVNULL);
fflush(stdout);
snprintf(cmd, sizeof(cmd),
- SYSTEMQUOTE "\"%s\" %s template1 >%s" SYSTEMQUOTE,
+ "\"%s\" %s template1 >%s",
backend_exec, backend_options,
DEVNULL);
fflush(stdout);
snprintf(cmd, sizeof(cmd),
- SYSTEMQUOTE "\"%s\" %s template1 >%s" SYSTEMQUOTE,
+ "\"%s\" %s template1 >%s",
backend_exec, backend_options,
DEVNULL);
fflush(stdout);
snprintf(cmd, sizeof(cmd),
- SYSTEMQUOTE "\"%s\" %s template1 >%s" SYSTEMQUOTE,
+ "\"%s\" %s template1 >%s",
backend_exec, backend_options,
DEVNULL);
fflush(stdout);
snprintf(cmd, sizeof(cmd),
- SYSTEMQUOTE "\"%s\" %s template1 >%s" SYSTEMQUOTE,
+ "\"%s\" %s template1 >%s",
backend_exec, backend_options,
DEVNULL);
* the PID without having to rely on reading it back from the pidfile.
*/
if (log_file != NULL)
- snprintf(cmd, MAXPGPATH, SYSTEMQUOTE "\"%s\" %s%s < \"%s\" >> \"%s\" 2>&1 &" SYSTEMQUOTE,
+ snprintf(cmd, MAXPGPATH, "\"%s\" %s%s < \"%s\" >> \"%s\" 2>&1 &",
exec_path, pgdata_opt, post_opts,
DEVNULL, log_file);
else
- snprintf(cmd, MAXPGPATH, SYSTEMQUOTE "\"%s\" %s%s < \"%s\" 2>&1 &" SYSTEMQUOTE,
+ snprintf(cmd, MAXPGPATH, "\"%s\" %s%s < \"%s\" 2>&1 &",
exec_path, pgdata_opt, post_opts, DEVNULL);
return system(cmd);
PROCESS_INFORMATION pi;
if (log_file != NULL)
- snprintf(cmd, MAXPGPATH, "CMD /C " SYSTEMQUOTE "\"%s\" %s%s < \"%s\" >> \"%s\" 2>&1" SYSTEMQUOTE,
+ snprintf(cmd, MAXPGPATH, "CMD /C \"\"%s\" %s%s < \"%s\" >> \"%s\" 2>&1\"",
exec_path, pgdata_opt, post_opts, DEVNULL, log_file);
else
- snprintf(cmd, MAXPGPATH, "CMD /C " SYSTEMQUOTE "\"%s\" %s%s < \"%s\" 2>&1" SYSTEMQUOTE,
+ snprintf(cmd, MAXPGPATH, "CMD /C \"\"%s\" %s%s < \"%s\" 2>&1\"",
exec_path, pgdata_opt, post_opts, DEVNULL);
if (!CreateRestrictedProcess(cmd, &pi, false))
post_opts = "";
if (!silent_mode)
- snprintf(cmd, MAXPGPATH, SYSTEMQUOTE "\"%s\" %s%s" SYSTEMQUOTE,
+ snprintf(cmd, MAXPGPATH, "\"%s\" %s%s",
exec_path, pgdata_opt, post_opts);
else
- snprintf(cmd, MAXPGPATH, SYSTEMQUOTE "\"%s\" %s%s > \"%s\"" SYSTEMQUOTE,
+ snprintf(cmd, MAXPGPATH, "\"%s\" %s%s > \"%s\"",
exec_path, pgdata_opt, post_opts, DEVNULL);
if (system(cmd) != 0)
my_exec_path = pg_strdup(exec_path);
/* it's important for -C to be the first option, see main.c */
- snprintf(cmd, MAXPGPATH, SYSTEMQUOTE "\"%s\" -C data_directory %s%s" SYSTEMQUOTE,
+ snprintf(cmd, MAXPGPATH, "\"%s\" -C data_directory %s%s",
my_exec_path,
pgdata_opt ? pgdata_opt : "",
post_opts ? post_opts : "");
PQExpBuffer cmd = createPQExpBuffer();
int ret;
- appendPQExpBuffer(cmd, SYSTEMQUOTE "\"%s\" %s", pg_dump_bin,
+ appendPQExpBuffer(cmd, "\"%s\" %s", pg_dump_bin,
pgdumpopts->data);
/*
doShellQuoting(cmd, connstrbuf->data);
- appendPQExpBufferStr(cmd, SYSTEMQUOTE);
-
if (verbose)
fprintf(stderr, _("%s: running \"%s\"\n"), progname, cmd->data);
editorName, fname);
#else
if (lineno > 0)
- sys = psprintf(SYSTEMQUOTE "\"%s\" %s%d \"%s\"" SYSTEMQUOTE,
+ sys = psprintf("\"%s\" %s%d \"%s\"",
editorName, editor_lineno_arg, lineno, fname);
else
- sys = psprintf(SYSTEMQUOTE "\"%s\" \"%s\"" SYSTEMQUOTE,
+ sys = psprintf("\"%s\" \"%s\"",
editorName, fname);
#endif
result = system(sys);
#ifndef WIN32
sys = psprintf("exec %s", shellName);
#else
- sys = psprintf(SYSTEMQUOTE "\"%s\"" SYSTEMQUOTE, shellName);
+ sys = psprintf("\"%s\"", shellName);
#endif
result = system(sys);
free(sys);
#define DEVNULL "/dev/null"
#endif
-/*
- * Win32 needs double quotes at the beginning and end of system()
- * strings. If not, it gets confused with multiple quoted strings.
- * It also requires double-quotes around the executable name and
- * any files used for redirection. Other args can use single-quotes.
- *
- * Generated using Win32 "CMD /?":
- *
- * 1. If all of the following conditions are met, then quote characters
- * on the command line are preserved:
- *
- * - no /S switch
- * - exactly two quote characters
- * - no special characters between the two quote characters, where special
- * is one of: &<>()@^|
- * - there are one or more whitespace characters between the two quote
- * characters
- * - the string between the two quote characters is the name of an
- * executable file.
- *
- * 2. Otherwise, old behavior is to see if the first character is a quote
- * character and if so, strip the leading character and remove the last
- * quote character on the command line, preserving any text after the last
- * quote character.
- */
-#if defined(WIN32) && !defined(__CYGWIN__)
-#define SYSTEMQUOTE "\""
-#else
-#define SYSTEMQUOTE ""
-#endif
-
/* Portable delay handling */
extern void pg_usleep(long microsec);
#define fopen(a,b) pgwin32_fopen(a,b)
#endif
-#ifndef popen
-#define popen(a,b) _popen(a,b)
-#endif
-#ifndef pclose
+/*
+ * system() and popen() replacements to enclose the command in an extra
+ * pair of quotes.
+ */
+extern int pgwin32_system(const char *command);
+extern FILE *pgwin32_popen(const char *command, const char *type);
+
+#define system(a) pgwin32_system(a)
+#define popen(a,b) pgwin32_popen(a,b)
#define pclose(a) _pclose(a)
-#endif
/* New versions of MingW have gettimeofday, old mingw and msvc don't */
#ifndef HAVE_GETTIMEOFDAY
snprintf(inprg, sizeof(inprg), "%s/%s", inputdir, testname);
snprintf(cmd, sizeof(cmd),
- SYSTEMQUOTE "\"%s\" >\"%s\" 2>\"%s\"" SYSTEMQUOTE,
+ "\"%s\" >\"%s\" 2>\"%s\"",
inprg,
outfile_stdout,
outfile_stderr);
OBJS += chklocale.o inet_net_ntop.o noblock.o pgstrcasecmp.o pqsignal.o \
thread.o
# libpgport C files that are needed if identified by configure
-OBJS += $(filter crypt.o getaddrinfo.o getpeereid.o inet_aton.o open.o snprintf.o strerror.o strlcpy.o win32error.o win32setlocale.o, $(LIBOBJS))
+OBJS += $(filter crypt.o getaddrinfo.o getpeereid.o inet_aton.o open.o system.o snprintf.o strerror.o strlcpy.o win32error.o win32setlocale.o, $(LIBOBJS))
# backend/libpq
OBJS += ip.o md5.o
# utils/mb
# For some libpgport modules, this only happens if configure decides
# the module is needed (see filter hack in OBJS, above).
-chklocale.c crypt.c getaddrinfo.c getpeereid.c inet_aton.c inet_net_ntop.c noblock.c open.c pgsleep.c pgstrcasecmp.c pqsignal.c snprintf.c strerror.c strlcpy.c thread.c win32error.c win32setlocale.c: % : $(top_srcdir)/src/port/%
+chklocale.c crypt.c getaddrinfo.c getpeereid.c inet_aton.c inet_net_ntop.c noblock.c open.c system.c pgsleep.c pgstrcasecmp.c pqsignal.c snprintf.c strerror.c strlcpy.c thread.c win32error.c win32setlocale.c: % : $(top_srcdir)/src/port/%
rm -f $@ && $(LN_S) $< .
ip.c md5.c: % : $(backend_src)/libpq/%
# Might be left over from a Win32 client-only build
rm -f pg_config_paths.h
rm -f inet_net_ntop.c noblock.c pgstrcasecmp.c pqsignal.c thread.c
- rm -f chklocale.c crypt.c getaddrinfo.c getpeereid.c inet_aton.c open.c snprintf.c strerror.c strlcpy.c win32error.c win32setlocale.c
+ rm -f chklocale.c crypt.c getaddrinfo.c getpeereid.c inet_aton.c open.c system.c snprintf.c strerror.c strlcpy.c win32error.c win32setlocale.c
rm -f pgsleep.c
rm -f md5.c ip.c
rm -f encnames.c wchar.c
-@erase "$(INTDIR)\dirmod.obj"
-@erase "$(INTDIR)\pgsleep.obj"
-@erase "$(INTDIR)\open.obj"
+ -@erase "$(INTDIR)\system.obj"
-@erase "$(INTDIR)\win32error.obj"
-@erase "$(OUTDIR)\$(OUTFILENAME).lib"
-@erase "$(OUTDIR)\$(OUTFILENAME)dll.lib"
"$(INTDIR)\dirmod.obj" \
"$(INTDIR)\pgsleep.obj" \
"$(INTDIR)\open.obj" \
+ "$(INTDIR)\system.obj" \
"$(INTDIR)\win32error.obj" \
"$(INTDIR)\pthread-win32.obj"
$(CPP_PROJ) /I"." ..\..\port\open.c
<<
+"$(INTDIR)\system.obj" : ..\..\port\system.c
+ $(CPP) @<<
+ $(CPP_PROJ) /I"." ..\..\port\system.c
+<<
+
"$(INTDIR)\win32error.obj" : ..\..\port\win32error.c
$(CPP) @<<
$(CPP_PROJ) /I"." ..\..\port\win32error.c
-@erase "$(INTDIR)\dirmod.obj"
-@erase "$(INTDIR)\pgsleep.obj"
-@erase "$(INTDIR)\open.obj"
+ -@erase "$(INTDIR)\system.obj"
-@erase "$(INTDIR)\win32error.obj"
-@erase "$(INTDIR)\win32setlocale.obj"
-@erase "$(OUTDIR)\$(OUTFILENAME).lib"
"$(INTDIR)\dirmod.obj" \
"$(INTDIR)\pgsleep.obj" \
"$(INTDIR)\open.obj" \
+ "$(INTDIR)\system.obj" \
"$(INTDIR)\win32error.obj" \
"$(INTDIR)\win32setlocale.obj" \
"$(INTDIR)\pthread-win32.obj"
$(CPP_PROJ) /I"." ..\..\port\open.c
<<
+"$(INTDIR)\system.obj" : ..\..\port\system.c
+ $(CPP) @<<
+ $(CPP_PROJ) /I"." ..\..\port\system.c
+<<
+
"$(INTDIR)\win32error.obj" : ..\..\port\win32error.c
$(CPP) @<<
$(CPP_PROJ) /I"." ..\..\port\win32error.c
--- /dev/null
+/*-------------------------------------------------------------------------
+ *
+ * system.c
+ * Win32 system() and popen() replacements
+ *
+ *
+ * Win32 needs double quotes at the beginning and end of system()
+ * strings. If not, it gets confused with multiple quoted strings.
+ * It also requires double-quotes around the executable name and
+ * any files used for redirection. Other args can use single-quotes.
+ *
+ * Generated using Win32 "CMD /?":
+ *
+ * 1. If all of the following conditions are met, then quote characters
+ * on the command line are preserved:
+ *
+ * - no /S switch
+ * - exactly two quote characters
+ * - no special characters between the two quote characters, where special
+ * is one of: &<>()@^|
+ * - there are one or more whitespace characters between the two quote
+ * characters
+ * - the string between the two quote characters is the name of an
+ * executable file.
+ *
+ * 2. Otherwise, old behavior is to see if the first character is a quote
+ * character and if so, strip the leading character and remove the last
+ * quote character on the command line, preserving any text after the last
+ * quote character.
+ *
+ * Portions Copyright (c) 1996-2014, PostgreSQL Global Development Group
+ *
+ * src/port/system.c
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#if defined(WIN32) && !defined(__CYGWIN__)
+
+#ifndef FRONTEND
+#include "postgres.h"
+#else
+#include "postgres_fe.h"
+#endif
+
+#include <windows.h>
+#include <fcntl.h>
+
+#undef system
+#undef popen
+
+int
+pgwin32_system(const char *command)
+{
+ size_t cmdlen = strlen(command);
+ char *buf;
+ int save_errno;
+ int res;
+
+ /*
+ * Create a malloc'd copy of the command string, enclosed with an extra
+ * pair of quotes
+ */
+ buf = malloc(cmdlen + 2 + 1);
+ if (buf == NULL)
+ {
+ errno = ENOMEM;
+ return -1;
+ }
+ buf[0] = '"';
+ memcpy(&buf[1], command, cmdlen);
+ buf[cmdlen + 1] = '"';
+ buf[cmdlen + 2] = '\0';
+
+ res = system(buf);
+
+ save_errno = errno;
+ free(buf);
+ errno = save_errno;
+
+ return res;
+}
+
+
+FILE *
+pgwin32_popen(const char *command, const char *type)
+{
+ size_t cmdlen = strlen(command);
+ char *buf;
+ int save_errno;
+ FILE *res;
+
+ /*
+ * Create a malloc'd copy of the command string, enclosed with an extra
+ * pair of quotes
+ */
+ buf = malloc(cmdlen + 2 + 1);
+ if (buf == NULL)
+ {
+ errno = ENOMEM;
+ return NULL;
+ }
+ buf[0] = '"';
+ memcpy(&buf[1], command, cmdlen);
+ buf[cmdlen + 1] = '"';
+ buf[cmdlen + 2] = '\0';
+
+ res = _popen(buf, type);
+
+ save_errno = errno;
+ free(buf);
+ errno = save_errno;
+
+ return res;
+}
+
+#endif
"%s ", launcher);
snprintf(psql_cmd + offset, sizeof(psql_cmd) - offset,
- SYSTEMQUOTE "\"%s\" \"dbname=%s\" < \"%s\" > \"%s\" 2>&1" SYSTEMQUOTE,
+ "\"%s\" \"dbname=%s\" < \"%s\" > \"%s\" 2>&1",
isolation_exec,
dblist->str,
infile,
fflush(stderr);
snprintf(buf, sizeof(buf),
- SYSTEMQUOTE "\"%s/pg_ctl\" stop -D \"%s/data\" -s -m fast" SYSTEMQUOTE,
+ "\"%s/pg_ctl\" stop -D \"%s/data\" -s -m fast",
bindir, temp_install);
r = system(buf);
if (r != 0)
/* And now we can build and execute the shell command */
snprintf(psql_cmd, sizeof(psql_cmd),
- SYSTEMQUOTE "\"%s%spsql\" -X -c \"%s\" \"%s\"" SYSTEMQUOTE,
+ "\"%s%spsql\" -X -c \"%s\" \"%s\"",
psqldir ? psqldir : "",
psqldir ? "/" : "",
query_escaped,
exit(2);
}
- cmdline2 = psprintf("cmd /c %s", cmdline);
+ cmdline2 = psprintf("cmd /c \"%s\"", cmdline);
#ifndef __CYGWIN__
AddUserToTokenDacl(restrictedToken);
/* OK, run the diff */
snprintf(cmd, sizeof(cmd),
- SYSTEMQUOTE "diff %s \"%s\" \"%s\" > \"%s\"" SYSTEMQUOTE,
+ "diff %s \"%s\" \"%s\" > \"%s\"",
basic_diff_opts, expectfile, resultsfile, diff);
/* Is the diff file empty? */
}
snprintf(cmd, sizeof(cmd),
- SYSTEMQUOTE "diff %s \"%s\" \"%s\" > \"%s\"" SYSTEMQUOTE,
+ "diff %s \"%s\" \"%s\" > \"%s\"",
basic_diff_opts, alt_expectfile, resultsfile, diff);
if (run_diff(cmd, diff) == 0)
if (platform_expectfile)
{
snprintf(cmd, sizeof(cmd),
- SYSTEMQUOTE "diff %s \"%s\" \"%s\" > \"%s\"" SYSTEMQUOTE,
+ "diff %s \"%s\" \"%s\" > \"%s\"",
basic_diff_opts, default_expectfile, resultsfile, diff);
if (run_diff(cmd, diff) == 0)
* append to the diffs summary file.
*/
snprintf(cmd, sizeof(cmd),
- SYSTEMQUOTE "diff %s \"%s\" \"%s\" >> \"%s\"" SYSTEMQUOTE,
+ "diff %s \"%s\" \"%s\" >> \"%s\"",
pretty_diff_opts, best_expect_file, resultsfile, difffilename);
run_diff(cmd, difffilename);
/* "make install" */
#ifndef WIN32_ONLY_COMPILER
snprintf(buf, sizeof(buf),
- SYSTEMQUOTE "\"%s\" -C \"%s\" DESTDIR=\"%s/install\" install > \"%s/log/install.log\" 2>&1" SYSTEMQUOTE,
+ "\"%s\" -C \"%s\" DESTDIR=\"%s/install\" install > \"%s/log/install.log\" 2>&1",
makeprog, top_builddir, temp_install, outputdir);
#else
snprintf(buf, sizeof(buf),
- SYSTEMQUOTE "perl \"%s/src/tools/msvc/install.pl\" \"%s/install\" >\"%s/log/install.log\" 2>&1" SYSTEMQUOTE,
+ "perl \"%s/src/tools/msvc/install.pl\" \"%s/install\" >\"%s/log/install.log\" 2>&1",
top_builddir, temp_install, outputdir);
#endif
if (system(buf))
{
#ifndef WIN32_ONLY_COMPILER
snprintf(buf, sizeof(buf),
- SYSTEMQUOTE "\"%s\" -C \"%s/%s\" DESTDIR=\"%s/install\" install >> \"%s/log/install.log\" 2>&1" SYSTEMQUOTE,
+ "\"%s\" -C \"%s/%s\" DESTDIR=\"%s/install\" install >> \"%s/log/install.log\" 2>&1",
makeprog, top_builddir, sl->str, temp_install, outputdir);
#else
fprintf(stderr, _("\n%s: --extra-install option not supported on this platform\n"), progname);
/* initdb */
header(_("initializing database system"));
snprintf(buf, sizeof(buf),
- SYSTEMQUOTE "\"%s/initdb\" -D \"%s/data\" -L \"%s\" --noclean --nosync%s%s > \"%s/log/initdb.log\" 2>&1" SYSTEMQUOTE,
+ "\"%s/initdb\" -D \"%s/data\" -L \"%s\" --noclean --nosync%s%s > \"%s/log/initdb.log\" 2>&1",
bindir, temp_install, datadir,
debug ? " --debug" : "",
nolocale ? " --no-locale" : "",
* Check if there is a postmaster running already.
*/
snprintf(buf2, sizeof(buf2),
- SYSTEMQUOTE "\"%s/psql\" -X postgres <%s 2>%s" SYSTEMQUOTE,
+ "\"%s/psql\" -X postgres <%s 2>%s",
bindir, DEVNULL, DEVNULL);
for (i = 0; i < 16; i++)
*/
header(_("starting postmaster"));
snprintf(buf, sizeof(buf),
- SYSTEMQUOTE "\"%s/postgres\" -D \"%s/data\" -F%s -c \"listen_addresses=%s\" > \"%s/log/postmaster.log\" 2>&1" SYSTEMQUOTE,
+ "\"%s/postgres\" -D \"%s/data\" -F%s -c \"listen_addresses=%s\" > \"%s/log/postmaster.log\" 2>&1",
bindir, temp_install,
debug ? " -d 5" : "",
hostname ? hostname : "",
"%s ", launcher);
snprintf(psql_cmd + offset, sizeof(psql_cmd) - offset,
- SYSTEMQUOTE "\"%s%spsql\" -X -a -q -d \"%s\" < \"%s\" > \"%s\" 2>&1" SYSTEMQUOTE,
+ "\"%s%spsql\" -X -a -q -d \"%s\" < \"%s\" > \"%s\" 2>&1",
psqldir ? psqldir : "",
psqldir ? "/" : "",
dblist->str,
srandom.c getaddrinfo.c gettimeofday.c inet_net_ntop.c kill.c open.c
erand48.c snprintf.c strlcat.c strlcpy.c dirmod.c noblock.c path.c
pgcheckdir.c pg_crc.c pgmkdirp.c pgsleep.c pgstrcasecmp.c pqsignal.c
- qsort.c qsort_arg.c quotes.c
+ qsort.c qsort_arg.c quotes.c system.c
sprompt.c tar.c thread.c getopt.c getopt_long.c dirent.c
win32env.c win32error.c win32setlocale.c);