Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
c55de22d
Commit
c55de22d
authored
Oct 13, 2004
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable service use by Cygwin of pg_ctl.
parent
4855d7eb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
12 deletions
+16
-12
src/bin/pg_ctl/pg_ctl.c
src/bin/pg_ctl/pg_ctl.c
+16
-12
No files found.
src/bin/pg_ctl/pg_ctl.c
View file @
c55de22d
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
*
*
* Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
* Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
*
*
* $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.3
4 2004/10/12 21:54:43 petere
Exp $
* $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.3
5 2004/10/13 10:35:05 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -21,6 +21,10 @@
...
@@ -21,6 +21,10 @@
#include "libpq/pqsignal.h"
#include "libpq/pqsignal.h"
#include "getopt_long.h"
#include "getopt_long.h"
#if defined(__CYGWIN__)
#include <windows.h>
#endif
#ifndef HAVE_OPTRESET
#ifndef HAVE_OPTRESET
int
optreset
;
int
optreset
;
#endif
#endif
...
@@ -95,7 +99,7 @@ static void do_reload(void);
...
@@ -95,7 +99,7 @@ static void do_reload(void);
static
void
do_status
(
void
);
static
void
do_status
(
void
);
static
void
do_kill
(
pgpid_t
pid
);
static
void
do_kill
(
pgpid_t
pid
);
#if
def WIN32
#if
defined(WIN32) || defined(__CYGWIN__)
static
bool
pgwin32_IsInstalled
(
SC_HANDLE
);
static
bool
pgwin32_IsInstalled
(
SC_HANDLE
);
static
char
*
pgwin32_CommandLine
(
bool
);
static
char
*
pgwin32_CommandLine
(
bool
);
static
void
pgwin32_doRegister
();
static
void
pgwin32_doRegister
();
...
@@ -116,7 +120,7 @@ static char pid_file[MAXPGPATH];
...
@@ -116,7 +120,7 @@ static char pid_file[MAXPGPATH];
static
char
conf_file
[
MAXPGPATH
];
static
char
conf_file
[
MAXPGPATH
];
#if
def WIN32
#if
defined(WIN32) || defined(__CYGWIN__)
static
void
static
void
write_eventlog
(
int
level
,
const
char
*
line
)
write_eventlog
(
int
level
,
const
char
*
line
)
{
{
...
@@ -154,7 +158,7 @@ write_stderr(const char *fmt,...)
...
@@ -154,7 +158,7 @@ write_stderr(const char *fmt,...)
va_list
ap
;
va_list
ap
;
va_start
(
ap
,
fmt
);
va_start
(
ap
,
fmt
);
#if
ndef WIN32
#if
!defined(WIN32) && !defined(__CYGWIN__)
/* On Unix, we just fprintf to stderr */
/* On Unix, we just fprintf to stderr */
vfprintf
(
stderr
,
fmt
,
ap
);
vfprintf
(
stderr
,
fmt
,
ap
);
#else
#else
...
@@ -318,7 +322,7 @@ start_postmaster(void)
...
@@ -318,7 +322,7 @@ start_postmaster(void)
* http://dev.remotenetworktechnology.com/cmd/cmdfaq.htm
* http://dev.remotenetworktechnology.com/cmd/cmdfaq.htm
*/
*/
if
(
log_file
!=
NULL
)
if
(
log_file
!=
NULL
)
#if
ndef WIN32
#if
!defined(WIN32) && !defined(__CYGWIN__)
snprintf
(
cmd
,
MAXPGPATH
,
"%s
\"
%s
\"
%s%s <
\"
%s
\"
>>
\"
%s
\"
2>&1 &%s"
,
snprintf
(
cmd
,
MAXPGPATH
,
"%s
\"
%s
\"
%s%s <
\"
%s
\"
>>
\"
%s
\"
2>&1 &%s"
,
#else
#else
snprintf
(
cmd
,
MAXPGPATH
,
"%sSTART /B
\"\"
\"
%s
\"
%s%s <
\"
%s
\"
>>
\"
%s
\"
2>&1%s"
,
snprintf
(
cmd
,
MAXPGPATH
,
"%sSTART /B
\"\"
\"
%s
\"
%s%s <
\"
%s
\"
>>
\"
%s
\"
2>&1%s"
,
...
@@ -326,7 +330,7 @@ start_postmaster(void)
...
@@ -326,7 +330,7 @@ start_postmaster(void)
SYSTEMQUOTE
,
postgres_path
,
pgdata_opt
,
post_opts
,
SYSTEMQUOTE
,
postgres_path
,
pgdata_opt
,
post_opts
,
DEVNULL
,
log_file
,
SYSTEMQUOTE
);
DEVNULL
,
log_file
,
SYSTEMQUOTE
);
else
else
#if
ndef WIN32
#if
!defined(WIN32) && !defined(__CYGWIN__)
snprintf
(
cmd
,
MAXPGPATH
,
"%s
\"
%s
\"
%s%s <
\"
%s
\"
2>&1 &%s"
,
snprintf
(
cmd
,
MAXPGPATH
,
"%s
\"
%s
\"
%s%s <
\"
%s
\"
2>&1 &%s"
,
#else
#else
snprintf
(
cmd
,
MAXPGPATH
,
"%sSTART /B
\"\"
\"
%s
\"
%s%s <
\"
%s
\"
2>&1%s"
,
snprintf
(
cmd
,
MAXPGPATH
,
"%sSTART /B
\"\"
\"
%s
\"
%s%s <
\"
%s
\"
2>&1%s"
,
...
@@ -807,7 +811,7 @@ do_kill(pgpid_t pid)
...
@@ -807,7 +811,7 @@ do_kill(pgpid_t pid)
}
}
}
}
#if
def WIN32
#if
defined(WIN32) || defined(__CYGWIN__)
static
bool
static
bool
pgwin32_IsInstalled
(
SC_HANDLE
hSCM
)
pgwin32_IsInstalled
(
SC_HANDLE
hSCM
)
...
@@ -1085,14 +1089,14 @@ do_help(void)
...
@@ -1085,14 +1089,14 @@ do_help(void)
printf
(
_
(
" %s reload [-D DATADIR] [-s]
\n
"
),
progname
);
printf
(
_
(
" %s reload [-D DATADIR] [-s]
\n
"
),
progname
);
printf
(
_
(
" %s status [-D DATADIR]
\n
"
),
progname
);
printf
(
_
(
" %s status [-D DATADIR]
\n
"
),
progname
);
printf
(
_
(
" %s kill SIGNALNAME PROCESSID
\n
"
),
progname
);
printf
(
_
(
" %s kill SIGNALNAME PROCESSID
\n
"
),
progname
);
#if
def WIN32
#if
defined(WIN32) || defined(__CYGWIN__)
printf
(
_
(
" %s register [-N SERVICENAME] [-U USERNAME] [-P PASSWORD] [-D DATADIR] [-w] [-o
\"
OPTIONS
\"
]
\n
"
),
progname
);
printf
(
_
(
" %s register [-N SERVICENAME] [-U USERNAME] [-P PASSWORD] [-D DATADIR] [-w] [-o
\"
OPTIONS
\"
]
\n
"
),
progname
);
printf
(
_
(
" %s unregister [-N SERVICENAME]
\n
"
),
progname
);
printf
(
_
(
" %s unregister [-N SERVICENAME]
\n
"
),
progname
);
#endif
#endif
printf
(
_
(
"Common options:
\n
"
));
printf
(
_
(
"Common options:
\n
"
));
printf
(
_
(
" -D, --pgdata DATADIR location of the database storage area
\n
"
));
printf
(
_
(
" -D, --pgdata DATADIR location of the database storage area
\n
"
));
printf
(
_
(
" -s, --silent only print errors, no informational messages
\n
"
));
printf
(
_
(
" -s, --silent only print errors, no informational messages
\n
"
));
#if
def WIN32
#if
defined(WIN32) || defined(__CYGWIN__)
printf
(
_
(
" -N service name with which to register PostgreSQL server
\n
"
));
printf
(
_
(
" -N service name with which to register PostgreSQL server
\n
"
));
printf
(
_
(
" -P password of account to register PostgreSQL server
\n
"
));
printf
(
_
(
" -P password of account to register PostgreSQL server
\n
"
));
printf
(
_
(
" -U user name of account to register PostgreSQL server
\n
"
));
printf
(
_
(
" -U user name of account to register PostgreSQL server
\n
"
));
...
@@ -1201,7 +1205,7 @@ main(int argc, char **argv)
...
@@ -1201,7 +1205,7 @@ main(int argc, char **argv)
int
c
;
int
c
;
pgpid_t
killproc
=
0
;
pgpid_t
killproc
=
0
;
#if
def WIN32
#if
defined(WIN32) || defined(__CYGWIN__)
setvbuf
(
stderr
,
NULL
,
_IONBF
,
0
);
setvbuf
(
stderr
,
NULL
,
_IONBF
,
0
);
#endif
#endif
...
@@ -1348,7 +1352,7 @@ main(int argc, char **argv)
...
@@ -1348,7 +1352,7 @@ main(int argc, char **argv)
set_sig
(
argv
[
++
optind
]);
set_sig
(
argv
[
++
optind
]);
killproc
=
atol
(
argv
[
++
optind
]);
killproc
=
atol
(
argv
[
++
optind
]);
}
}
#if
def WIN32
#if
defined(WIN32) || defined(__CYGWIN__)
else
if
(
strcmp
(
argv
[
optind
],
"register"
)
==
0
)
else
if
(
strcmp
(
argv
[
optind
],
"register"
)
==
0
)
ctl_command
=
REGISTER_COMMAND
;
ctl_command
=
REGISTER_COMMAND
;
else
if
(
strcmp
(
argv
[
optind
],
"unregister"
)
==
0
)
else
if
(
strcmp
(
argv
[
optind
],
"unregister"
)
==
0
)
...
@@ -1438,7 +1442,7 @@ main(int argc, char **argv)
...
@@ -1438,7 +1442,7 @@ main(int argc, char **argv)
case
KILL_COMMAND
:
case
KILL_COMMAND
:
do_kill
(
killproc
);
do_kill
(
killproc
);
break
;
break
;
#if
def WIN32
#if
defined(WIN32) || defined(__CYGWIN__)
case
REGISTER_COMMAND
:
case
REGISTER_COMMAND
:
pgwin32_doRegister
();
pgwin32_doRegister
();
break
;
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment