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
31c8e94b
Commit
31c8e94b
authored
Feb 14, 1997
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove WIN32 defines. They never worked.
parent
aaaba5a0
Changes
26
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
39 additions
and
386 deletions
+39
-386
src/backend/libpq/pqcomm.c
src/backend/libpq/pqcomm.c
+1
-32
src/backend/libpq/pqpacket.c
src/backend/libpq/pqpacket.c
+1
-5
src/backend/optimizer/path/costsize.c
src/backend/optimizer/path/costsize.c
+8
-14
src/backend/optimizer/path/xfunc.c
src/backend/optimizer/path/xfunc.c
+1
-6
src/backend/parser/parser.c
src/backend/parser/parser.c
+1
-3
src/backend/parser/scan.l
src/backend/parser/scan.l
+1
-3
src/backend/postmaster/postmaster.c
src/backend/postmaster/postmaster.c
+1
-83
src/backend/storage/file/fd.c
src/backend/storage/file/fd.c
+1
-14
src/backend/storage/ipc/s_lock.c
src/backend/storage/ipc/s_lock.c
+1
-29
src/backend/storage/lmgr/proc.c
src/backend/storage/lmgr/proc.c
+2
-12
src/backend/storage/smgr/md.c
src/backend/storage/smgr/md.c
+1
-8
src/backend/tcop/postgres.c
src/backend/tcop/postgres.c
+4
-44
src/backend/utils/adt/date.c
src/backend/utils/adt/date.c
+1
-9
src/backend/utils/adt/filename.c
src/backend/utils/adt/filename.c
+1
-7
src/backend/utils/adt/float.c
src/backend/utils/adt/float.c
+1
-8
src/backend/utils/error/elog.c
src/backend/utils/error/elog.c
+1
-10
src/backend/utils/fmgr/dfmgr.c
src/backend/utils/fmgr/dfmgr.c
+2
-12
src/backend/utils/init/findbe.c
src/backend/utils/init/findbe.c
+1
-22
src/backend/utils/init/miscinit.c
src/backend/utils/init/miscinit.c
+1
-14
src/backend/utils/init/postinit.c
src/backend/utils/init/postinit.c
+1
-8
src/include/c.h
src/include/c.h
+1
-11
src/include/libpq/libpq-fs.h
src/include/libpq/libpq-fs.h
+1
-7
src/include/storage/fd.h
src/include/storage/fd.h
+1
-6
src/include/storage/proc.h
src/include/storage/proc.h
+1
-8
src/include/utils/dynamic_loader.h
src/include/utils/dynamic_loader.h
+1
-6
src/utils/version.c
src/utils/version.c
+2
-5
No files found.
src/backend/libpq/pqcomm.c
View file @
31c8e94b
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.1
0 1996/12/26 22:07:03
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.1
1 1997/02/14 04:15:29
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -39,16 +39,12 @@
...
@@ -39,16 +39,12 @@
#include <signal.h>
#include <signal.h>
#include <errno.h>
#include <errno.h>
#include <fcntl.h>
#include <fcntl.h>
#ifndef WIN32
#include <unistd.h>
/* for ttyname() */
#include <unistd.h>
/* for ttyname() */
#include <sys/types.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/socket.h>
#include <netdb.h>
#include <netdb.h>
#include <netinet/in.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <arpa/inet.h>
#else
#include <winsock.h>
#endif
/* WIN32 */
#if defined(linux)
#if defined(linux)
#ifndef SOMAXCONN
#ifndef SOMAXCONN
...
@@ -77,17 +73,8 @@ int PQAsyncNotifyWaiting; /* for async. notification */
...
@@ -77,17 +73,8 @@ int PQAsyncNotifyWaiting; /* for async. notification */
void
void
pq_init
(
int
fd
)
pq_init
(
int
fd
)
{
{
#ifdef WIN32
int
in
,
out
;
in
=
_open_osfhandle
(
fd
,
_O_RDONLY
);
out
=
_open_osfhandle
(
fd
,
_O_APPEND
);
Pfin
=
fdopen
(
in
,
"rb"
);
Pfout
=
fdopen
(
out
,
"wb"
);
#else
Pfin
=
fdopen
(
fd
,
"r"
);
Pfin
=
fdopen
(
fd
,
"r"
);
Pfout
=
fdopen
(
dup
(
fd
),
"w"
);
Pfout
=
fdopen
(
dup
(
fd
),
"w"
);
#endif
/* WIN32 */
if
(
!
Pfin
||
!
Pfout
)
if
(
!
Pfin
||
!
Pfout
)
elog
(
FATAL
,
"pq_init: Couldn't initialize socket connection"
);
elog
(
FATAL
,
"pq_init: Couldn't initialize socket connection"
);
PQnotifies_init
();
PQnotifies_init
();
...
@@ -487,10 +474,6 @@ pq_getinserv(struct sockaddr_in *sin, char *host, char *serv)
...
@@ -487,10 +474,6 @@ pq_getinserv(struct sockaddr_in *sin, char *host, char *serv)
void
void
pq_regoob
(
void
(
*
fptr
)())
pq_regoob
(
void
(
*
fptr
)())
{
{
#ifdef WIN32
/* Who knows what to do here? */
return
;
#else
int
fd
=
fileno
(
Pfout
);
int
fd
=
fileno
(
Pfout
);
#if defined(hpux)
#if defined(hpux)
ioctl
(
fd
,
FIOSSAIOOWN
,
getpid
());
ioctl
(
fd
,
FIOSSAIOOWN
,
getpid
());
...
@@ -498,15 +481,12 @@ pq_regoob(void (*fptr)())
...
@@ -498,15 +481,12 @@ pq_regoob(void (*fptr)())
fcntl
(
fd
,
F_SETOWN
,
getpid
());
fcntl
(
fd
,
F_SETOWN
,
getpid
());
#endif
/* hpux */
#endif
/* hpux */
(
void
)
pqsignal
(
SIGURG
,
fptr
);
(
void
)
pqsignal
(
SIGURG
,
fptr
);
#endif
/* WIN32 */
}
}
void
void
pq_unregoob
()
pq_unregoob
()
{
{
#ifndef WIN32
pqsignal
(
SIGURG
,
SIG_DFL
);
pqsignal
(
SIGURG
,
SIG_DFL
);
#endif
/* WIN32 */
}
}
...
@@ -554,15 +534,6 @@ StreamServerPort(char *hostName, short portName, int *fdP)
...
@@ -554,15 +534,6 @@ StreamServerPort(char *hostName, short portName, int *fdP)
int
fd
;
int
fd
;
int
one
=
1
;
int
one
=
1
;
#ifdef WIN32
/* This is necessary to make it possible for a backend to use
** stdio to read from the socket.
*/
int
optionvalue
=
SO_SYNCHRONOUS_NONALERT
;
setsockopt
(
INVALID_SOCKET
,
SOL_SOCKET
,
SO_OPENTYPE
,
(
char
*
)
&
optionvalue
,
sizeof
(
optionvalue
));
#endif
/* WIN32 */
if
(
!
hostName
)
if
(
!
hostName
)
hostName
=
"localhost"
;
hostName
=
"localhost"
;
...
@@ -648,10 +619,8 @@ StreamConnection(int server_fd, Port *port)
...
@@ -648,10 +619,8 @@ StreamConnection(int server_fd, Port *port)
port
->
mask
=
1
<<
port
->
sock
;
port
->
mask
=
1
<<
port
->
sock
;
#ifndef WIN32
/* reset to non-blocking */
/* reset to non-blocking */
fcntl
(
port
->
sock
,
F_SETFL
,
1
);
fcntl
(
port
->
sock
,
F_SETFL
,
1
);
#endif
/* WIN32 */
return
(
STATUS_OK
);
return
(
STATUS_OK
);
}
}
...
...
src/backend/libpq/pqpacket.c
View file @
31c8e94b
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/pqpacket.c,v 1.
3 1997/02/13 08:06:36 scrappy
Exp $
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/pqpacket.c,v 1.
4 1997/02/14 04:15:31 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -38,13 +38,9 @@
...
@@ -38,13 +38,9 @@
*/
*/
#include <stdio.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/types.h>
#ifndef WIN32
#include <sys/socket.h>
#include <sys/socket.h>
#include <netdb.h>
#include <netdb.h>
#include <netinet/in.h>
#include <netinet/in.h>
#else
#include <winsock.h>
#endif
/*WIN32 */
#include <fcntl.h>
#include <fcntl.h>
#include <errno.h>
#include <errno.h>
...
...
src/backend/optimizer/path/costsize.c
View file @
31c8e94b
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/costsize.c,v 1.1
2 1997/01/26 16:06:42 scrappy
Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/costsize.c,v 1.1
3 1997/02/14 04:15:35 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -16,21 +16,15 @@
...
@@ -16,21 +16,15 @@
#include "config.h"
#include "config.h"
#include <math.h>
#include <math.h>
#ifdef WIN32
#ifdef HAVE_LIMITS_H
# include <float.h>
# include <limits.h>
# include <limits.h>
# define MAXINT INT_MAX
# ifndef MAXINT
# define MAXINT INT_MAX
# endif
#else
#else
# ifdef HAVE_LIMITS_H
# ifdef HAVE_VALUES_H
# include <limits.h>
# include <values.h>
# ifndef MAXINT
# endif
# define MAXINT INT_MAX
# endif
# else
# ifdef HAVE_VALUES_H
# include <values.h>
# endif
# endif
#endif
#endif
#include <utils/lsyscache.h>
#include <utils/lsyscache.h>
...
...
src/backend/optimizer/path/xfunc.c
View file @
31c8e94b
...
@@ -9,16 +9,11 @@
...
@@ -9,16 +9,11 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/xfunc.c,v 1.
2 1996/10/23 07:14:43 bryanh
Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/Attic/xfunc.c,v 1.
3 1997/02/14 04:15:39 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
#ifndef WIN32
#include <math.h>
/* for MAXFLOAT on most systems */
#include <math.h>
/* for MAXFLOAT on most systems */
#else
#include <float.h>
#define MAXFLOAT DBL_MAX
#endif
/* WIN32 */
#include <values.h>
/* for MAXFLOAT on SunOS */
#include <values.h>
/* for MAXFLOAT on SunOS */
#include <string.h>
#include <string.h>
...
...
src/backend/parser/parser.c
View file @
31c8e94b
...
@@ -6,15 +6,13 @@
...
@@ -6,15 +6,13 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parser.c,v 1.1
7 1997/01/22 01:43:26
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/parser.c,v 1.1
8 1997/02/14 04:15:49
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
#include <string.h>
#include <string.h>
#include <stdio.h>
#include <stdio.h>
#ifndef WIN32
#include <pwd.h>
#include <pwd.h>
#endif
/*WIN32 */
#include <sys/param.h>
/* for MAXPATHLEN */
#include <sys/param.h>
/* for MAXPATHLEN */
#include "postgres.h"
#include "postgres.h"
...
...
src/backend/parser/scan.l
View file @
31c8e94b
...
@@ -8,14 +8,12 @@
...
@@ -8,14 +8,12 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.
8 1996/12/04 14:23:11
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.
9 1997/02/14 04:15:59
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
#include <ctype.h>
#include <ctype.h>
#ifndef WIN32
#include <unistd.h>
#include <unistd.h>
#endif /* WIN32 */
#ifndef __linux__
#ifndef __linux__
#include <math.h>
#include <math.h>
#else
#else
...
...
src/backend/postmaster/postmaster.c
View file @
31c8e94b
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.
39 1997/02/13 08:31:09 scrappy
Exp $
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.
40 1997/02/14 04:16:12 momjian
Exp $
*
*
* NOTES
* NOTES
*
*
...
@@ -198,11 +198,7 @@ checkDataDir(const char *DataDir, bool *DataDirOK)
...
@@ -198,11 +198,7 @@ checkDataDir(const char *DataDir, bool *DataDirOK)
fclose
(
fp
);
fclose
(
fp
);
#ifndef WIN32
ValidatePgVersion
(
DataDir
,
&
reason
);
ValidatePgVersion
(
DataDir
,
&
reason
);
#else
reason
=
NULL
;
#endif
/* WIN32 */
if
(
reason
)
{
if
(
reason
)
{
fprintf
(
stderr
,
fprintf
(
stderr
,
"Database system in directory %s "
"Database system in directory %s "
...
@@ -231,9 +227,6 @@ PostmasterMain(int argc, char *argv[])
...
@@ -231,9 +227,6 @@ PostmasterMain(int argc, char *argv[])
int
silentflag
=
0
;
int
silentflag
=
0
;
char
hostbuf
[
MAXHOSTNAMELEN
];
char
hostbuf
[
MAXHOSTNAMELEN
];
bool
DataDirOK
;
/* We have a usable PGDATA value */
bool
DataDirOK
;
/* We have a usable PGDATA value */
#if defined(WIN32)
WSADATA
WSAData
;
#endif
/* WIN32 */
progname
=
argv
[
0
];
progname
=
argv
[
0
];
...
@@ -363,18 +356,6 @@ PostmasterMain(int argc, char *argv[])
...
@@ -363,18 +356,6 @@ PostmasterMain(int argc, char *argv[])
}
}
#if defined(WIN32)
if
((
status
=
WSAStartup
(
MAKEWORD
(
1
,
1
),
&
WSAData
))
==
0
)
(
void
)
printf
(
"%s
\n
Initializing WinSock: %s
\n
"
,
WSAData
.
szDescription
,
WSAData
.
szSystemStatus
);
else
{
fprintf
(
stderr
,
"Error initializing WinSock: %d is the err"
,
status
);
exit
(
1
);
}
_nt_init
();
_nt_attach
();
#endif
/* WIN32 */
status
=
StreamServerPort
(
hostName
,
PostPortName
,
&
ServerSock
);
status
=
StreamServerPort
(
hostName
,
PostPortName
,
&
ServerSock
);
if
(
status
!=
STATUS_OK
)
{
if
(
status
!=
STATUS_OK
)
{
fprintf
(
stderr
,
"%s: cannot create stream port
\n
"
,
fprintf
(
stderr
,
"%s: cannot create stream port
\n
"
,
...
@@ -397,15 +378,12 @@ PostmasterMain(int argc, char *argv[])
...
@@ -397,15 +378,12 @@ PostmasterMain(int argc, char *argv[])
pmdaemonize
();
pmdaemonize
();
pqsignal
(
SIGINT
,
pmdie
);
pqsignal
(
SIGINT
,
pmdie
);
#ifndef WIN32
pqsignal
(
SIGCHLD
,
reaper
);
pqsignal
(
SIGCHLD
,
reaper
);
pqsignal
(
SIGTTIN
,
SIG_IGN
);
pqsignal
(
SIGTTIN
,
SIG_IGN
);
pqsignal
(
SIGTTOU
,
SIG_IGN
);
pqsignal
(
SIGTTOU
,
SIG_IGN
);
pqsignal
(
SIGHUP
,
pmdie
);
pqsignal
(
SIGHUP
,
pmdie
);
pqsignal
(
SIGTERM
,
pmdie
);
pqsignal
(
SIGTERM
,
pmdie
);
pqsignal
(
SIGCONT
,
dumpstatus
);
pqsignal
(
SIGCONT
,
dumpstatus
);
#endif
/* WIN32 */
status
=
ServerLoop
();
status
=
ServerLoop
();
...
@@ -845,7 +823,6 @@ reaper(SIGNAL_ARGS)
...
@@ -845,7 +823,6 @@ reaper(SIGNAL_ARGS)
if
(
DebugLvl
)
if
(
DebugLvl
)
fprintf
(
stderr
,
"%s: reaping dead processes...
\n
"
,
fprintf
(
stderr
,
"%s: reaping dead processes...
\n
"
,
progname
);
progname
);
#ifndef WIN32
#ifdef HAVE_WAITPID
#ifdef HAVE_WAITPID
while
((
pid
=
waitpid
(
-
1
,
&
status
,
WNOHANG
))
>
0
)
while
((
pid
=
waitpid
(
-
1
,
&
status
,
WNOHANG
))
>
0
)
CleanupProc
(
pid
,
status
);
CleanupProc
(
pid
,
status
);
...
@@ -853,7 +830,6 @@ reaper(SIGNAL_ARGS)
...
@@ -853,7 +830,6 @@ reaper(SIGNAL_ARGS)
while
((
pid
=
wait3
(
&
statusp
,
WNOHANG
,
NULL
))
>
0
)
while
((
pid
=
wait3
(
&
statusp
,
WNOHANG
,
NULL
))
>
0
)
CleanupProc
(
pid
,
statusp
.
w_status
);
CleanupProc
(
pid
,
statusp
.
w_status
);
#endif
#endif
#endif
/* WIN32 */
}
}
/*
/*
...
@@ -914,7 +890,6 @@ CleanupProc(int pid,
...
@@ -914,7 +890,6 @@ CleanupProc(int pid,
* collect core dumps from all backends by hand.
* collect core dumps from all backends by hand.
* -----------------
* -----------------
*/
*/
#ifndef WIN32
sig
=
(
SendStop
)
?
SIGSTOP
:
SIGUSR1
;
sig
=
(
SendStop
)
?
SIGSTOP
:
SIGUSR1
;
if
(
bp
->
pid
!=
pid
)
{
if
(
bp
->
pid
!=
pid
)
{
if
(
DebugLvl
)
if
(
DebugLvl
)
...
@@ -925,7 +900,6 @@ CleanupProc(int pid,
...
@@ -925,7 +900,6 @@ CleanupProc(int pid,
bp
->
pid
);
bp
->
pid
);
(
void
)
kill
(
bp
->
pid
,
sig
);
(
void
)
kill
(
bp
->
pid
,
sig
);
}
}
#endif
/* WIN32 */
ProcRemove
(
bp
->
pid
);
ProcRemove
(
bp
->
pid
);
prev
=
DLGetPred
(
curr
);
prev
=
DLGetPred
(
curr
);
...
@@ -1006,7 +980,6 @@ BackendStartup(StartupInfo *packet, /* client's startup packet */
...
@@ -1006,7 +980,6 @@ BackendStartup(StartupInfo *packet, /* client's startup packet */
fprintf
(
stderr
,
"-----------------------------------------
\n
"
);
fprintf
(
stderr
,
"-----------------------------------------
\n
"
);
}
}
#ifndef WIN32
if
((
pid
=
FORK
())
==
0
)
{
/* child */
if
((
pid
=
FORK
())
==
0
)
{
/* child */
if
(
DoExec
(
packet
,
port
->
sock
))
if
(
DoExec
(
packet
,
port
->
sock
))
fprintf
(
stderr
,
"%s child[%d]: BackendStartup: execv failed
\n
"
,
fprintf
(
stderr
,
"%s child[%d]: BackendStartup: execv failed
\n
"
,
...
@@ -1021,14 +994,6 @@ BackendStartup(StartupInfo *packet, /* client's startup packet */
...
@@ -1021,14 +994,6 @@ BackendStartup(StartupInfo *packet, /* client's startup packet */
progname
);
progname
);
return
(
STATUS_ERROR
);
return
(
STATUS_ERROR
);
}
}
#else
pid
=
DoExec
(
packet
,
port
->
sock
);
if
(
pid
==
FALSE
)
{
fprintf
(
stderr
,
"%s: BackendStartup: CreateProcess failed
\n
"
,
progname
);
return
(
STATUS_ERROR
);
}
#endif
/* WIN32 */
if
(
DebugLvl
)
if
(
DebugLvl
)
fprintf
(
stderr
,
"%s: BackendStartup: pid %d user %s db %s socket %d
\n
"
,
fprintf
(
stderr
,
"%s: BackendStartup: pid %d user %s db %s socket %d
\n
"
,
...
@@ -1119,12 +1084,6 @@ DoExec(StartupInfo *packet, int portFd)
...
@@ -1119,12 +1084,6 @@ DoExec(StartupInfo *packet, int portFd)
char
dbbuf
[
ARGV_SIZE
+
1
];
char
dbbuf
[
ARGV_SIZE
+
1
];
int
ac
=
0
;
int
ac
=
0
;
int
i
;
int
i
;
#if defined(WIN32)
char
win32_args
[(
2
*
ARGV_SIZE
)
+
1
];
PROCESS_INFORMATION
piProcInfo
;
STARTUPINFO
siStartInfo
;
BOOL
fSuccess
;
#endif
/* WIN32 */
(
void
)
strncpy
(
execbuf
,
Execfile
,
MAXPATHLEN
);
(
void
)
strncpy
(
execbuf
,
Execfile
,
MAXPATHLEN
);
execbuf
[
MAXPATHLEN
-
1
]
=
'\0'
;
execbuf
[
MAXPATHLEN
-
1
]
=
'\0'
;
...
@@ -1152,16 +1111,7 @@ DoExec(StartupInfo *packet, int portFd)
...
@@ -1152,16 +1111,7 @@ DoExec(StartupInfo *packet, int portFd)
if
(
packet
->
tty
[
0
])
{
if
(
packet
->
tty
[
0
])
{
(
void
)
strncpy
(
ttybuf
,
packet
->
tty
,
ARGV_SIZE
);
(
void
)
strncpy
(
ttybuf
,
packet
->
tty
,
ARGV_SIZE
);
av
[
ac
++
]
=
"-o"
;
av
[
ac
++
]
=
"-o"
;
#if defined(WIN32)
/* BIG HACK - The front end is passing "/dev/null" here which
** causes new backends to fail. So, as a very special case,
** use a real NT filename.
*/
av
[
ac
++
]
=
"CON"
;
#else
av
[
ac
++
]
=
ttybuf
;
av
[
ac
++
]
=
ttybuf
;
#endif
/* WIN32 */
}
}
/* tell the backend we're using European dates */
/* tell the backend we're using European dates */
...
@@ -1200,39 +1150,7 @@ DoExec(StartupInfo *packet, int portFd)
...
@@ -1200,39 +1150,7 @@ DoExec(StartupInfo *packet, int portFd)
fprintf
(
stderr
,
")
\n
"
);
fprintf
(
stderr
,
")
\n
"
);
}
}
#ifndef WIN32
return
(
execv
(
av
[
0
],
av
));
return
(
execv
(
av
[
0
],
av
));
#else
/* Copy all the arguments into one char array */
win32_args
[
0
]
=
'\0'
;
for
(
i
=
0
;
i
<
ac
;
i
++
)
{
strcat
(
win32_args
,
av
[
i
]);
strcat
(
win32_args
,
" "
);
}
siStartInfo
.
cb
=
sizeof
(
STARTUPINFO
);
siStartInfo
.
lpReserved
=
NULL
;
siStartInfo
.
lpDesktop
=
NULL
;
siStartInfo
.
lpTitle
=
NULL
;
siStartInfo
.
lpReserved2
=
NULL
;
siStartInfo
.
cbReserved2
=
0
;
siStartInfo
.
dwFlags
=
0
;
fSuccess
=
CreateProcess
(
progname
,
win32_args
,
NULL
,
NULL
,
TRUE
,
0
,
NULL
,
NULL
,
&
siStartInfo
,
&
piProcInfo
);
if
(
fSuccess
)
{
/* The parent process doesn't need the handles */
CloseHandle
(
piProcInfo
.
hThread
);
CloseHandle
(
piProcInfo
.
hProcess
);
return
(
piProcInfo
.
dwProcessId
);
}
else
return
(
FALSE
);
#endif
/* WIN32 */
}
}
/*
/*
...
...
src/backend/storage/file/fd.c
View file @
31c8e94b
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Id: fd.c,v 1.1
4 1997/01/27 00:09:43 scrappy
Exp $
* $Id: fd.c,v 1.1
5 1997/02/14 04:16:26 momjian
Exp $
*
*
* NOTES:
* NOTES:
*
*
...
@@ -134,13 +134,8 @@ static int nfile = 0;
...
@@ -134,13 +134,8 @@ static int nfile = 0;
* that we can open it and find out if we really have any descriptors
* that we can open it and find out if we really have any descriptors
* available or not.
* available or not.
*/
*/
#ifndef WIN32
static
char
*
Nulldev
=
"/dev/null"
;
static
char
*
Nulldev
=
"/dev/null"
;
static
char
Sep_char
=
'/'
;
static
char
Sep_char
=
'/'
;
#else
static
char
*
Nulldev
=
"NUL"
;
static
char
Sep_char
=
'\\'
;
#endif
/* WIN32 */
/*
/*
* Private Routines
* Private Routines
...
@@ -471,12 +466,7 @@ filepath(char *filename)
...
@@ -471,12 +466,7 @@ filepath(char *filename)
char
basename
[
16
];
char
basename
[
16
];
int
len
;
int
len
;
#ifndef WIN32
if
(
*
filename
!=
Sep_char
)
{
if
(
*
filename
!=
Sep_char
)
{
#else
if
(
!
(
filename
[
1
]
==
':'
&&
filename
[
2
]
==
Sep_char
))
{
#endif
/* WIN32 */
/* Either /base/ or \base\ */
/* Either /base/ or \base\ */
sprintf
(
basename
,
"%cbase%c"
,
Sep_char
,
Sep_char
);
sprintf
(
basename
,
"%cbase%c"
,
Sep_char
,
Sep_char
);
...
@@ -576,9 +566,6 @@ fileNameOpenFile(FileName fileName,
...
@@ -576,9 +566,6 @@ fileNameOpenFile(FileName fileName,
close
(
tmpfd
);
close
(
tmpfd
);
}
}
#ifdef WIN32
fileFlags
|=
_O_BINARY
;
#endif
/* WIN32 */
vfdP
->
fd
=
open
(
fileName
,
fileFlags
,
fileMode
);
vfdP
->
fd
=
open
(
fileName
,
fileFlags
,
fileMode
);
vfdP
->
fdstate
=
0x0
;
vfdP
->
fdstate
=
0x0
;
...
...
src/backend/storage/ipc/s_lock.c
View file @
31c8e94b
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/Attic/s_lock.c,v 1.1
0 1997/01/26 20:15:00
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/Attic/s_lock.c,v 1.1
1 1997/02/14 04:16:43
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -37,10 +37,6 @@
...
@@ -37,10 +37,6 @@
* manual for POWER in any case.
* manual for POWER in any case.
*
*
*/
*/
#ifdef WIN32
#include <windows.h>
#endif
/* WIN32 */
#include "postgres.h"
#include "postgres.h"
#include "storage/ipc.h"
#include "storage/ipc.h"
...
@@ -414,27 +410,3 @@ S_INIT_LOCK(slock_t *lock)
...
@@ -414,27 +410,3 @@ S_INIT_LOCK(slock_t *lock)
#endif
/* HAS_TEST_AND_SET */
#endif
/* HAS_TEST_AND_SET */
#ifdef WIN32
void
S_LOCK
(
HANDLE
*
lock
)
{
int
x
=
0
;
x
=
x
/
x
;
}
void
S_UNLOCK
(
HANDLE
*
lock
)
{
int
x
=
0
;
x
=
x
/
x
;
}
void
S_INIT_LOCK
(
HANDLE
*
lock
)
{
int
x
=
0
;
x
=
x
/
x
;
}
#endif
/*WIN32*/
src/backend/storage/lmgr/proc.c
View file @
31c8e94b
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.1
6 1997/02/13 15:55:01
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.1
7 1997/02/14 04:16:56
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -46,12 +46,10 @@
...
@@ -46,12 +46,10 @@
* This is so that we can support more backends. (system-wide semaphore
* This is so that we can support more backends. (system-wide semaphore
* sets run out pretty fast.) -ay 4/95
* sets run out pretty fast.) -ay 4/95
*
*
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.1
6 1997/02/13 15:55:01
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.1
7 1997/02/14 04:16:56
momjian Exp $
*/
*/
#include <sys/time.h>
#include <sys/time.h>
#ifndef WIN32
#include <unistd.h>
#include <unistd.h>
#endif
/* WIN32 */
#include <string.h>
#include <string.h>
#include <signal.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/types.h>
...
@@ -157,9 +155,7 @@ InitProcess(IPCKey key)
...
@@ -157,9 +155,7 @@ InitProcess(IPCKey key)
* Routine called if deadlock timer goes off. See ProcSleep()
* Routine called if deadlock timer goes off. See ProcSleep()
* ------------------
* ------------------
*/
*/
#ifndef WIN32
pqsignal
(
SIGALRM
,
HandleDeadLock
);
pqsignal
(
SIGALRM
,
HandleDeadLock
);
#endif
/* WIN32 we'll have to figure out how to handle this later */
SpinAcquire
(
ProcStructLock
);
SpinAcquire
(
ProcStructLock
);
...
@@ -456,9 +452,7 @@ ProcSleep(PROC_QUEUE *queue,
...
@@ -456,9 +452,7 @@ ProcSleep(PROC_QUEUE *queue,
{
{
int
i
;
int
i
;
PROC
*
proc
;
PROC
*
proc
;
#ifndef WIN32
/* figure this out later */
struct
itimerval
timeval
,
dummy
;
struct
itimerval
timeval
,
dummy
;
#endif
/* WIN32 */
proc
=
(
PROC
*
)
MAKE_PTR
(
queue
->
links
.
prev
);
proc
=
(
PROC
*
)
MAKE_PTR
(
queue
->
links
.
prev
);
for
(
i
=
0
;
i
<
queue
->
size
;
i
++
)
for
(
i
=
0
;
i
<
queue
->
size
;
i
++
)
...
@@ -501,13 +495,11 @@ ProcSleep(PROC_QUEUE *queue,
...
@@ -501,13 +495,11 @@ ProcSleep(PROC_QUEUE *queue,
* to 0.
* to 0.
* --------------
* --------------
*/
*/
#ifndef WIN32
memset
(
&
timeval
,
0
,
sizeof
(
struct
itimerval
));
memset
(
&
timeval
,
0
,
sizeof
(
struct
itimerval
));
timeval
.
it_value
.
tv_sec
=
DEADLOCK_TIMEOUT
;
timeval
.
it_value
.
tv_sec
=
DEADLOCK_TIMEOUT
;
if
(
setitimer
(
ITIMER_REAL
,
&
timeval
,
&
dummy
))
if
(
setitimer
(
ITIMER_REAL
,
&
timeval
,
&
dummy
))
elog
(
FATAL
,
"ProcSleep: Unable to set timer for process wakeup"
);
elog
(
FATAL
,
"ProcSleep: Unable to set timer for process wakeup"
);
#endif
/* WIN32 */
/* --------------
/* --------------
* if someone wakes us between SpinRelease and IpcSemaphoreLock,
* if someone wakes us between SpinRelease and IpcSemaphoreLock,
...
@@ -521,13 +513,11 @@ ProcSleep(PROC_QUEUE *queue,
...
@@ -521,13 +513,11 @@ ProcSleep(PROC_QUEUE *queue,
* We were awoken before a timeout - now disable the timer
* We were awoken before a timeout - now disable the timer
* ---------------
* ---------------
*/
*/
#ifndef WIN32
timeval
.
it_value
.
tv_sec
=
0
;
timeval
.
it_value
.
tv_sec
=
0
;
if
(
setitimer
(
ITIMER_REAL
,
&
timeval
,
&
dummy
))
if
(
setitimer
(
ITIMER_REAL
,
&
timeval
,
&
dummy
))
elog
(
FATAL
,
"ProcSleep: Unable to diable timer for process wakeup"
);
elog
(
FATAL
,
"ProcSleep: Unable to diable timer for process wakeup"
);
#endif
/* WIN32 */
/* ----------------
/* ----------------
* We were assumed to be in a critical section when we went
* We were assumed to be in a critical section when we went
...
...
src/backend/storage/smgr/md.c
View file @
31c8e94b
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.1
0 1996/11/27 07:24:02 vadim
Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.1
1 1997/02/14 04:17:08 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -154,10 +154,6 @@ mdunlink(Relation reln)
...
@@ -154,10 +154,6 @@ mdunlink(Relation reln)
/* On Windows NT you can't unlink a file if it is open so we have
/* On Windows NT you can't unlink a file if it is open so we have
** to do this.
** to do this.
*/
*/
#ifdef WIN32
(
void
)
mdclose
(
reln
);
#endif
/* WIN32 */
memset
(
fname
,
0
,
NAMEDATALEN
);
memset
(
fname
,
0
,
NAMEDATALEN
);
strncpy
(
fname
,
RelationGetRelationName
(
reln
)
->
data
,
NAMEDATALEN
);
strncpy
(
fname
,
RelationGetRelationName
(
reln
)
->
data
,
NAMEDATALEN
);
...
@@ -167,9 +163,6 @@ mdunlink(Relation reln)
...
@@ -167,9 +163,6 @@ mdunlink(Relation reln)
/* unlink all the overflow files for large relations */
/* unlink all the overflow files for large relations */
for
(
i
=
1
;
;
i
++
)
{
for
(
i
=
1
;
;
i
++
)
{
#ifdef WIN32
(
void
)
mdclose
(
reln
);
#endif
/* WIN32 */
sprintf
(
tname
,
"%s.%d"
,
fname
,
i
);
sprintf
(
tname
,
"%s.%d"
,
fname
,
i
);
if
(
FileNameUnlink
(
tname
)
<
0
)
if
(
FileNameUnlink
(
tname
)
<
0
)
break
;
break
;
...
...
src/backend/tcop/postgres.c
View file @
31c8e94b
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.3
0 1997/02/12 05:24:22 scrappy
Exp $
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.3
1 1997/02/14 04:17:21 momjian
Exp $
*
*
* NOTES
* NOTES
* this is the "main" module of the postgres backend and
* this is the "main" module of the postgres backend and
...
@@ -105,13 +105,13 @@ static bool IsEmptyQuery = false;
...
@@ -105,13 +105,13 @@ static bool IsEmptyQuery = false;
char
relname
[
80
];
/* current relation name */
char
relname
[
80
];
/* current relation name */
#if defined(
WIN32) || defined(
nextstep)
#if defined(nextstep)
jmp_buf
Warn_restart
;
jmp_buf
Warn_restart
;
#define sigsetjmp(x,y) setjmp(x)
#define sigsetjmp(x,y) setjmp(x)
#define siglongjmp longjmp
#define siglongjmp longjmp
#else
#else
sigjmp_buf
Warn_restart
;
sigjmp_buf
Warn_restart
;
#endif
/*
defined(WIN32) ||
defined(nextstep) */
#endif
/* defined(nextstep) */
int
InWarn
;
int
InWarn
;
extern
int
NBuffers
;
extern
int
NBuffers
;
...
@@ -816,10 +816,6 @@ PostgresMain(int argc, char *argv[])
...
@@ -816,10 +816,6 @@ PostgresMain(int argc, char *argv[])
Dlelem
*
curr
;
Dlelem
*
curr
;
int
status
;
int
status
;
#ifdef WIN32
WSADATA
WSAData
;
#endif
/* WIN32 */
extern
int
optind
;
extern
int
optind
;
extern
char
*
optarg
;
extern
char
*
optarg
;
extern
short
DebugLvl
;
extern
short
DebugLvl
;
...
@@ -830,14 +826,12 @@ PostgresMain(int argc, char *argv[])
...
@@ -830,14 +826,12 @@ PostgresMain(int argc, char *argv[])
*/
*/
pqsignal
(
SIGINT
,
die
);
pqsignal
(
SIGINT
,
die
);
#ifndef WIN32
pqsignal
(
SIGHUP
,
die
);
pqsignal
(
SIGHUP
,
die
);
pqsignal
(
SIGTERM
,
die
);
pqsignal
(
SIGTERM
,
die
);
pqsignal
(
SIGPIPE
,
die
);
pqsignal
(
SIGPIPE
,
die
);
pqsignal
(
SIGUSR1
,
quickdie
);
pqsignal
(
SIGUSR1
,
quickdie
);
pqsignal
(
SIGUSR2
,
Async_NotifyHandler
);
pqsignal
(
SIGUSR2
,
Async_NotifyHandler
);
pqsignal
(
SIGFPE
,
FloatExceptionHandler
);
pqsignal
(
SIGFPE
,
FloatExceptionHandler
);
#endif
/* WIN32 */
/* --------------------
/* --------------------
* initialize globals
* initialize globals
...
@@ -988,13 +982,6 @@ PostgresMain(int argc, char *argv[])
...
@@ -988,13 +982,6 @@ PostgresMain(int argc, char *argv[])
*/
*/
multiplexedBackend
=
true
;
multiplexedBackend
=
true
;
serverPortnum
=
atoi
(
optarg
);
serverPortnum
=
atoi
(
optarg
);
#ifdef WIN32
/* There was no postmaster started so the shared memory
** for the shared memory table hasn't been allocated so
** do it now.
*/
_nt_init
();
#endif
/* WIN32 */
break
;
break
;
case
'M'
:
case
'M'
:
exit
(
PostmasterMain
(
argc
,
argv
));
exit
(
PostmasterMain
(
argc
,
argv
));
...
@@ -1196,15 +1183,6 @@ PostgresMain(int argc, char *argv[])
...
@@ -1196,15 +1183,6 @@ PostgresMain(int argc, char *argv[])
pq_init
(
Portfd
);
pq_init
(
Portfd
);
}
}
#ifdef WIN32
if
((
status
=
WSAStartup
(
MAKEWORD
(
1
,
1
),
&
WSAData
))
==
0
)
(
void
)
printf
(
"%s
\n
Initializing WinSock: %s
\n
"
,
WSAData
.
szDescription
,
WSAData
.
szSystemStatus
);
else
{
fprintf
(
stderr
,
"Error initializing WinSock: %d is the err"
,
status
);
exit
(
1
);
}
#endif
/* WIN32 */
if
(
multiplexedBackend
)
{
if
(
multiplexedBackend
)
{
if
(
serverPortnum
==
0
||
if
(
serverPortnum
==
0
||
StreamServerPort
(
hostName
,
serverPortnum
,
&
serverSock
)
!=
STATUS_OK
)
StreamServerPort
(
hostName
,
serverPortnum
,
&
serverSock
)
!=
STATUS_OK
)
...
@@ -1256,10 +1234,6 @@ PostgresMain(int argc, char *argv[])
...
@@ -1256,10 +1234,6 @@ PostgresMain(int argc, char *argv[])
puts
(
"
\t
InitPostgres().."
);
puts
(
"
\t
InitPostgres().."
);
}
}
#if WIN32
_nt_attach
();
#endif
/* WIN32 */
InitPostgres
(
DBName
);
InitPostgres
(
DBName
);
/* ----------------
/* ----------------
...
@@ -1274,13 +1248,9 @@ PostgresMain(int argc, char *argv[])
...
@@ -1274,13 +1248,9 @@ PostgresMain(int argc, char *argv[])
* ----------------
* ----------------
*/
*/
#ifndef WIN32
pqsignal
(
SIGHUP
,
handle_warn
);
pqsignal
(
SIGHUP
,
handle_warn
);
if
(
sigsetjmp
(
Warn_restart
,
1
)
!=
0
)
{
if
(
sigsetjmp
(
Warn_restart
,
1
)
!=
0
)
{
#else
if
(
setjmp
(
Warn_restart
)
!=
0
)
{
#endif
/* WIN32 */
InWarn
=
1
;
InWarn
=
1
;
time
(
&
tim
);
time
(
&
tim
);
...
@@ -1300,7 +1270,7 @@ PostgresMain(int argc, char *argv[])
...
@@ -1300,7 +1270,7 @@ PostgresMain(int argc, char *argv[])
*/
*/
if
(
IsUnderPostmaster
==
false
)
{
if
(
IsUnderPostmaster
==
false
)
{
puts
(
"
\n
POSTGRES backend interactive interface"
);
puts
(
"
\n
POSTGRES backend interactive interface"
);
puts
(
"$Revision: 1.3
0 $ $Date: 1997/02/12 05:24:22
$"
);
puts
(
"$Revision: 1.3
1 $ $Date: 1997/02/14 04:17:21
$"
);
}
}
/* ----------------
/* ----------------
...
@@ -1497,7 +1467,6 @@ PostgresMain(int argc, char *argv[])
...
@@ -1497,7 +1467,6 @@ PostgresMain(int argc, char *argv[])
return
1
;
return
1
;
}
}
#ifndef WIN32
#ifdef HAVE_RUSAGE
#ifdef HAVE_RUSAGE
#include "rusagestub.h"
#include "rusagestub.h"
#else
/* HAVE_RUSAGE */
#else
/* HAVE_RUSAGE */
...
@@ -1597,12 +1566,3 @@ ShowUsage(void)
...
@@ -1597,12 +1566,3 @@ ShowUsage(void)
PrintBufferUsage
(
StatFp
);
PrintBufferUsage
(
StatFp
);
/* DisplayTupleCount(StatFp); */
/* DisplayTupleCount(StatFp); */
}
}
#else
void
ShowUsage
()
{}
void
ResetUsage
()
{}
#endif
/* WIN32 */
src/backend/utils/adt/date.c
View file @
31c8e94b
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.
4 1996/11/10 03:03:0
5 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.
5 1997/02/14 04:17:3
5 momjian Exp $
*
*
* NOTES
* NOTES
* This code is actually (almost) unused.
* This code is actually (almost) unused.
...
@@ -855,16 +855,13 @@ text *
...
@@ -855,16 +855,13 @@ text *
timeofday
(
void
)
timeofday
(
void
)
{
{
#ifndef WIN32
struct
timeval
tp
;
struct
timeval
tp
;
struct
timezone
tpz
;
struct
timezone
tpz
;
#endif
/* WIN32 */
char
templ
[
500
];
char
templ
[
500
];
char
buf
[
500
];
char
buf
[
500
];
text
*
tm
;
text
*
tm
;
int
len
=
0
;
int
len
=
0
;
#ifndef WIN32
gettimeofday
(
&
tp
,
&
tpz
);
gettimeofday
(
&
tp
,
&
tpz
);
(
void
)
strftime
(
templ
,
sizeof
(
templ
),
"%a %b %d %H:%M:%S.%%d %Y %Z"
,
(
void
)
strftime
(
templ
,
sizeof
(
templ
),
"%a %b %d %H:%M:%S.%%d %Y %Z"
,
localtime
((
time_t
*
)
&
tp
.
tv_sec
));
localtime
((
time_t
*
)
&
tp
.
tv_sec
));
...
@@ -875,9 +872,4 @@ timeofday(void)
...
@@ -875,9 +872,4 @@ timeofday(void)
VARSIZE
(
tm
)
=
len
;
VARSIZE
(
tm
)
=
len
;
strncpy
(
VARDATA
(
tm
),
buf
,
strlen
(
buf
));
strncpy
(
VARDATA
(
tm
),
buf
,
strlen
(
buf
));
return
tm
;
return
tm
;
#else
len
=
len
/
len
;
return
tm
;
#endif
/* WIN32 */
}
}
src/backend/utils/adt/filename.c
View file @
31c8e94b
...
@@ -7,16 +7,14 @@
...
@@ -7,16 +7,14 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/filename.c,v 1.
5 1996/11/08 05:59:43
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/filename.c,v 1.
6 1997/02/14 04:17:47
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
#include <string.h>
#include <string.h>
#include <stdio.h>
#include <stdio.h>
#ifndef WIN32
#include <pwd.h>
#include <pwd.h>
#endif
/* WIN32 */
#include <sys/param.h>
#include <sys/param.h>
...
@@ -35,7 +33,6 @@ filename_in(char *file)
...
@@ -35,7 +33,6 @@ filename_in(char *file)
* should let the shell do expansions (shexpand)
* should let the shell do expansions (shexpand)
*/
*/
#ifndef WIN32
str
=
(
char
*
)
palloc
(
MAXPATHLEN
*
sizeof
(
*
str
));
str
=
(
char
*
)
palloc
(
MAXPATHLEN
*
sizeof
(
*
str
));
str
[
0
]
=
'\0'
;
str
[
0
]
=
'\0'
;
if
(
file
[
0
]
==
'~'
)
{
if
(
file
[
0
]
==
'~'
)
{
...
@@ -103,9 +100,6 @@ filename_in(char *file)
...
@@ -103,9 +100,6 @@ filename_in(char *file)
}
}
strcat
(
str
,
file
+
ind
);
strcat
(
str
,
file
+
ind
);
return
(
str
);
return
(
str
);
#else
return
(
NULL
);
#endif
/* WIN32 */
}
}
char
*
char
*
...
...
src/backend/utils/adt/float.c
View file @
31c8e94b
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.1
0 1997/01/24 18:17:06 scrappy
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.1
1 1997/02/14 04:17:52 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -220,17 +220,10 @@ char *float8out(float64 num)
...
@@ -220,17 +220,10 @@ char *float8out(float64 num)
if
(
!
num
)
if
(
!
num
)
return
strcpy
(
ascii
,
"(null)"
);
return
strcpy
(
ascii
,
"(null)"
);
#ifndef WIN32
if
(
isnan
(
*
num
))
if
(
isnan
(
*
num
))
return
strcpy
(
ascii
,
"NaN"
);
return
strcpy
(
ascii
,
"NaN"
);
if
(
isinf
(
*
num
))
if
(
isinf
(
*
num
))
return
strcpy
(
ascii
,
"Infinity"
);
return
strcpy
(
ascii
,
"Infinity"
);
#else
if
(
_isnan
(
*
num
))
return
strcpy
(
ascii
,
"NaN"
);
if
(
!
_finite
(
*
num
))
return
strcpy
(
ascii
,
"Infinity"
);
#endif
sprintf
(
ascii
,
"%.*g"
,
DBL_DIG
,
*
num
);
sprintf
(
ascii
,
"%.*g"
,
DBL_DIG
,
*
num
);
return
(
ascii
);
return
(
ascii
);
...
...
src/backend/utils/error/elog.c
View file @
31c8e94b
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.1
1 1996/11/14 10:24:22 bryanh
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.1
2 1997/02/14 04:17:57 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -34,9 +34,6 @@ static int Err_file = -1;
...
@@ -34,9 +34,6 @@ static int Err_file = -1;
static
int
ElogDebugIndentLevel
=
0
;
static
int
ElogDebugIndentLevel
=
0
;
extern
char
OutputFileName
[];
extern
char
OutputFileName
[];
#ifdef WIN32
extern
jmp_buf
Warn_restart
;
#endif
/*
/*
* elog --
* elog --
...
@@ -160,12 +157,8 @@ elog(int lev, const char *fmt, ... )
...
@@ -160,12 +157,8 @@ elog(int lev, const char *fmt, ... )
extern
int
InWarn
;
extern
int
InWarn
;
ProcReleaseSpins
(
NULL
);
/* get rid of spinlocks we hold */
ProcReleaseSpins
(
NULL
);
/* get rid of spinlocks we hold */
if
(
!
InWarn
)
{
if
(
!
InWarn
)
{
#ifndef WIN32
kill
(
getpid
(),
1
);
/* abort to traffic cop */
kill
(
getpid
(),
1
);
/* abort to traffic cop */
pause
();
pause
();
#else
longjmp
(
Warn_restart
,
1
);
#endif
/* WIN32 */
}
}
/*
/*
* The pause(3) is just to avoid race conditions where the
* The pause(3) is just to avoid race conditions where the
...
@@ -227,7 +220,6 @@ DebugFileOpen(void)
...
@@ -227,7 +220,6 @@ DebugFileOpen(void)
Err_file
=
Debugfile
=
fileno
(
stderr
);
Err_file
=
Debugfile
=
fileno
(
stderr
);
return
(
Debugfile
);
return
(
Debugfile
);
}
}
#ifndef WIN32
/* If no filename was specified, send debugging output to stderr.
/* If no filename was specified, send debugging output to stderr.
* If stderr has been hosed, try to open a file.
* If stderr has been hosed, try to open a file.
*/
*/
...
@@ -237,7 +229,6 @@ DebugFileOpen(void)
...
@@ -237,7 +229,6 @@ DebugFileOpen(void)
DataDir
,
(
int
)
getpid
());
DataDir
,
(
int
)
getpid
());
fd
=
open
(
OutputFileName
,
O_CREAT
|
O_APPEND
|
O_WRONLY
,
0666
);
fd
=
open
(
OutputFileName
,
O_CREAT
|
O_APPEND
|
O_WRONLY
,
0666
);
}
}
#endif
/* WIN32 */
if
(
fd
<
0
)
if
(
fd
<
0
)
elog
(
FATAL
,
"DebugFileOpen: could not open debugging file"
);
elog
(
FATAL
,
"DebugFileOpen: could not open debugging file"
);
...
...
src/backend/utils/fmgr/dfmgr.c
View file @
31c8e94b
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/fmgr/dfmgr.c,v 1.
5 1997/02/13 09:54:04 scrappy
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/fmgr/dfmgr.c,v 1.
6 1997/02/14 04:18:02 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -118,11 +118,7 @@ handle_load(char *filename, char *funcname)
...
@@ -118,11 +118,7 @@ handle_load(char *filename, char *funcname)
DynamicFileList
*
file_scanner
=
(
DynamicFileList
*
)
NULL
;
DynamicFileList
*
file_scanner
=
(
DynamicFileList
*
)
NULL
;
func_ptr
retval
=
(
func_ptr
)
NULL
;
func_ptr
retval
=
(
func_ptr
)
NULL
;
char
*
load_error
;
char
*
load_error
;
#ifdef WIN32
struct
_stat
stat_buf
;
#else
struct
stat
stat_buf
;
struct
stat
stat_buf
;
#endif
/* WIN32 */
/*
/*
* Do this because loading files may screw up the dynamic function
* Do this because loading files may screw up the dynamic function
...
@@ -180,10 +176,8 @@ handle_load(char *filename, char *funcname)
...
@@ -180,10 +176,8 @@ handle_load(char *filename, char *funcname)
memset
((
char
*
)
file_scanner
,
0
,
sizeof
(
DynamicFileList
));
memset
((
char
*
)
file_scanner
,
0
,
sizeof
(
DynamicFileList
));
(
void
)
strcpy
(
file_scanner
->
filename
,
filename
);
(
void
)
strcpy
(
file_scanner
->
filename
,
filename
);
#ifndef WIN32
file_scanner
->
device
=
stat_buf
.
st_dev
;
file_scanner
->
device
=
stat_buf
.
st_dev
;
file_scanner
->
inode
=
stat_buf
.
st_ino
;
file_scanner
->
inode
=
stat_buf
.
st_ino
;
#endif
/* WIN32 */
file_scanner
->
next
=
(
DynamicFileList
*
)
NULL
;
file_scanner
->
next
=
(
DynamicFileList
*
)
NULL
;
file_scanner
->
handle
=
pg_dlopen
(
filename
);
file_scanner
->
handle
=
pg_dlopen
(
filename
);
...
@@ -232,11 +226,7 @@ void
...
@@ -232,11 +226,7 @@ void
load_file
(
char
*
filename
)
load_file
(
char
*
filename
)
{
{
DynamicFileList
*
file_scanner
,
*
p
;
DynamicFileList
*
file_scanner
,
*
p
;
#ifdef WIN32
struct
stat
stat_buf
;
struct
_stat
stat_buf
;
#else
struct
stat
stat_buf
;
#endif
/* WIN32 */
int
done
=
0
;
int
done
=
0
;
...
...
src/backend/utils/init/findbe.c
View file @
31c8e94b
...
@@ -6,16 +6,12 @@
...
@@ -6,16 +6,12 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/init/Attic/findbe.c,v 1.
2 1996/11/06 10:31:52 scrappy
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/init/Attic/findbe.c,v 1.
3 1997/02/14 04:18:08 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
#include <stdio.h>
#include <stdio.h>
#ifndef WIN32
#include <grp.h>
#include <grp.h>
#else
#include <windows.h>
#endif
/* WIN32 */
#include <pwd.h>
#include <pwd.h>
#include <string.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/stat.h>
...
@@ -47,7 +43,6 @@
...
@@ -47,7 +43,6 @@
int
int
ValidateBackend
(
char
*
path
)
ValidateBackend
(
char
*
path
)
{
{
#ifndef WIN32
struct
stat
buf
;
struct
stat
buf
;
uid_t
euid
;
uid_t
euid
;
struct
group
*
gp
;
struct
group
*
gp
;
...
@@ -56,9 +51,6 @@ ValidateBackend(char *path)
...
@@ -56,9 +51,6 @@ ValidateBackend(char *path)
int
is_r
=
0
;
int
is_r
=
0
;
int
is_x
=
0
;
int
is_x
=
0
;
int
in_grp
=
0
;
int
in_grp
=
0
;
#else
DWORD
file_attributes
;
#endif
/* WIN32 */
/*
/*
* Ensure that the file exists and is a regular file.
* Ensure that the file exists and is a regular file.
...
@@ -73,7 +65,6 @@ ValidateBackend(char *path)
...
@@ -73,7 +65,6 @@ ValidateBackend(char *path)
return
(
-
1
);
return
(
-
1
);
}
}
#ifndef WIN32
if
(
stat
(
path
,
&
buf
)
<
0
)
{
if
(
stat
(
path
,
&
buf
)
<
0
)
{
if
(
DebugLvl
>
1
)
if
(
DebugLvl
>
1
)
fprintf
(
stderr
,
"ValidateBackend: can't stat
\"
%s
\"\n
"
,
fprintf
(
stderr
,
"ValidateBackend: can't stat
\"
%s
\"\n
"
,
...
@@ -139,13 +130,6 @@ ValidateBackend(char *path)
...
@@ -139,13 +130,6 @@ ValidateBackend(char *path)
fprintf
(
stderr
,
"ValidateBackend:
\"
%s
\"
is not other read/execute
\n
"
,
fprintf
(
stderr
,
"ValidateBackend:
\"
%s
\"
is not other read/execute
\n
"
,
path
);
path
);
return
(
is_x
?
(
is_r
?
0
:
-
2
)
:
-
1
);
return
(
is_x
?
(
is_r
?
0
:
-
2
)
:
-
1
);
#else
file_attributes
=
GetFileAttributes
(
path
);
if
(
file_attributes
!=
0xFFFFFFFF
)
return
(
0
);
else
return
(
-
1
);
#endif
/* WIN32 */
}
}
/*
/*
...
@@ -163,11 +147,6 @@ FindBackend(char *backend, char *argv0)
...
@@ -163,11 +147,6 @@ FindBackend(char *backend, char *argv0)
char
*
path
,
*
startp
,
*
endp
;
char
*
path
,
*
startp
,
*
endp
;
int
pathlen
;
int
pathlen
;
#ifdef WIN32
strcpy
(
backend
,
argv0
);
return
(
0
);
#endif
/* WIN32 */
/*
/*
* for the postmaster:
* for the postmaster:
* First try: use the backend that's located in the same directory
* First try: use the backend that's located in the same directory
...
...
src/backend/utils/init/miscinit.c
View file @
31c8e94b
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.
3 1996/11/14 10:24:41 bryanh
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.
4 1997/02/14 04:18:17 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -18,10 +18,8 @@
...
@@ -18,10 +18,8 @@
#include <sys/file.h>
#include <sys/file.h>
#include <stdio.h>
#include <stdio.h>
#include <unistd.h>
#include <unistd.h>
#ifndef WIN32
#include <grp.h>
/* for getgrgid */
#include <grp.h>
/* for getgrgid */
#include <pwd.h>
/* for getpwuid */
#include <pwd.h>
/* for getpwuid */
#endif
/* WIN32 */
#include "postgres.h"
#include "postgres.h"
...
@@ -58,9 +56,7 @@ extern char *DatabasePath;
...
@@ -58,9 +56,7 @@ extern char *DatabasePath;
* Define USE_ENVIRONMENT to get PGDATA, etc. from environment variables.
* Define USE_ENVIRONMENT to get PGDATA, etc. from environment variables.
* This is the default on UNIX platforms.
* This is the default on UNIX platforms.
*/
*/
#ifndef WIN32
#define USE_ENVIRONMENT
#define USE_ENVIRONMENT
#endif
/* ----------------------------------------------------------------
/* ----------------------------------------------------------------
* some of the 19 ways to leave postgres
* some of the 19 ways to leave postgres
...
@@ -294,15 +290,6 @@ SetPgUserName()
...
@@ -294,15 +290,6 @@ SetPgUserName()
UserName
=
malloc
(
strlen
(
p
)
+
1
);
UserName
=
malloc
(
strlen
(
p
)
+
1
);
strcpy
(
UserName
,
p
);
strcpy
(
UserName
,
p
);
#endif
/* NO_SECURITY */
#endif
/* NO_SECURITY */
#ifdef WIN32
/* XXX We'll figure out how to get the user name later */
if
(
UserName
)
free
(
UserName
);
UserName
=
malloc
(
strlen
(
p
)
+
1
);
strcpy
(
UserName
,
"postgres"
);
#endif
/* WIN32 */
}
}
/* ----------------------------------------------------------------
/* ----------------------------------------------------------------
...
...
src/backend/utils/init/postinit.c
View file @
31c8e94b
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.
7 1997/01/08 08:33:07 bryanh
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.
8 1997/02/14 04:18:20 momjian
Exp $
*
*
* NOTES
* NOTES
* InitPostgres() is the function called from PostgresMain
* InitPostgres() is the function called from PostgresMain
...
@@ -135,9 +135,6 @@ InitMyDatabaseId()
...
@@ -135,9 +135,6 @@ InitMyDatabaseId()
dbfname
=
(
char
*
)
palloc
(
strlen
(
DataDir
)
+
strlen
(
"pg_database"
)
+
2
);
dbfname
=
(
char
*
)
palloc
(
strlen
(
DataDir
)
+
strlen
(
"pg_database"
)
+
2
);
sprintf
(
dbfname
,
"%s%cpg_database"
,
DataDir
,
SEP_CHAR
);
sprintf
(
dbfname
,
"%s%cpg_database"
,
DataDir
,
SEP_CHAR
);
fileflags
=
O_RDONLY
;
fileflags
=
O_RDONLY
;
#ifdef WIN32
fileflags
|=
_O_BINARY
;
#endif
/* WIN32 */
if
((
dbfd
=
open
(
dbfname
,
O_RDONLY
,
0666
))
<
0
)
if
((
dbfd
=
open
(
dbfname
,
O_RDONLY
,
0666
))
<
0
)
elog
(
FATAL
,
"Cannot open %s"
,
dbfname
);
elog
(
FATAL
,
"Cannot open %s"
,
dbfname
);
...
@@ -259,11 +256,7 @@ static void
...
@@ -259,11 +256,7 @@ static void
DoChdirAndInitDatabaseNameAndPath
(
char
*
name
)
{
DoChdirAndInitDatabaseNameAndPath
(
char
*
name
)
{
char
*
reason
;
char
*
reason
;
/* Failure reason returned by some function. NULL if no failure */
/* Failure reason returned by some function. NULL if no failure */
#ifndef WIN32
struct
stat
statbuf
;
struct
stat
statbuf
;
#else
struct
_stat
statbuf
;
#endif
char
errormsg
[
1000
];
char
errormsg
[
1000
];
if
(
stat
(
DataDir
,
&
statbuf
)
<
0
)
if
(
stat
(
DataDir
,
&
statbuf
)
<
0
)
...
...
src/include/c.h
View file @
31c8e94b
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: c.h,v 1.
8 1997/02/09 04:50:25 scrappy
Exp $
* $Id: c.h,v 1.
9 1997/02/14 04:18:27 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -742,19 +742,9 @@ extern char *form(char *fmt, ...);
...
@@ -742,19 +742,9 @@ extern char *form(char *fmt, ...);
#endif
#endif
/* These are for things that are one way on Unix and another on NT */
/* These are for things that are one way on Unix and another on NT */
#ifndef WIN32
#define NULL_DEV "/dev/null"
#define NULL_DEV "/dev/null"
#define COPY_CMD "cp"
#define COPY_CMD "cp"
#define SEP_CHAR '/'
#define SEP_CHAR '/'
#else
#define NULL_DEV "NUL"
#define COPY_CMD "copy"
#define SEP_CHAR '\\'
#endif
/* WIN32 */
#if defined(WIN32)
#include "port/win32/nt.h"
#endif
/* WIN32 */
/* ----------------
/* ----------------
* end of c.h
* end of c.h
...
...
src/include/libpq/libpq-fs.h
View file @
31c8e94b
...
@@ -6,19 +6,13 @@
...
@@ -6,19 +6,13 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: libpq-fs.h,v 1.
2 1996/11/06 10:30:02 scrappy
Exp $
* $Id: libpq-fs.h,v 1.
3 1997/02/14 04:18:33 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
#ifndef LIBPQ_FS_H
#ifndef LIBPQ_FS_H
#define LIBPQ_FS_H
#define LIBPQ_FS_H
#ifndef WIN32
#endif
/* WIN32 */
#ifndef SEEK_SET
#endif
/* SEEK_SET */
/* UNIX compatibility junk. This should be in all systems' include files,
/* UNIX compatibility junk. This should be in all systems' include files,
but this is not always the case. */
but this is not always the case. */
...
...
src/include/storage/fd.h
View file @
31c8e94b
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: fd.h,v 1.
5 1996/11/08 06:02:1
2 momjian Exp $
* $Id: fd.h,v 1.
6 1997/02/14 04:18:4
2 momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -43,11 +43,6 @@
...
@@ -43,11 +43,6 @@
/*
/*
* FileSeek uses the standard UNIX lseek(2) flags.
* FileSeek uses the standard UNIX lseek(2) flags.
*/
*/
#ifndef WIN32
#else
#ifndef SEEK_SET
#endif
/* SEEK_SET */
#endif
/* WIN32 */
typedef
char
*
FileName
;
typedef
char
*
FileName
;
...
...
src/include/storage/proc.h
View file @
31c8e94b
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: proc.h,v 1.
3 1996/11/05 06:11:03 scrappy
Exp $
* $Id: proc.h,v 1.
4 1997/02/14 04:18:51 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -15,13 +15,6 @@
...
@@ -15,13 +15,6 @@
#include <storage/lock.h>
#include <storage/lock.h>
#ifndef WIN32
#else
/* This is because WIN32 already defines PROC */
#define PROC PGL_PROC
#endif
/* WIN32 */
typedef
struct
{
typedef
struct
{
int
sleeplock
;
int
sleeplock
;
int
semNum
;
int
semNum
;
...
...
src/include/utils/dynamic_loader.h
View file @
31c8e94b
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: dynamic_loader.h,v 1.
4 1996/12/28 02:12:51
momjian Exp $
* $Id: dynamic_loader.h,v 1.
5 1997/02/14 04:18:56
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -29,13 +29,8 @@
...
@@ -29,13 +29,8 @@
typedef
struct
df_files
{
typedef
struct
df_files
{
char
filename
[
MAXPATHLEN
];
/* Full pathname of file */
char
filename
[
MAXPATHLEN
];
/* Full pathname of file */
#ifdef WIN32
_dev_t
device
;
/* Device file is on */
_ino_t
inode
;
/* Inode number of file */
#else
dev_t
device
;
/* Device file is on */
dev_t
device
;
/* Device file is on */
ino_t
inode
;
/* Inode number of file */
ino_t
inode
;
/* Inode number of file */
#endif
/* WIN32 */
void
*
handle
;
/* a handle for pg_dl* functions */
void
*
handle
;
/* a handle for pg_dl* functions */
struct
df_files
*
next
;
struct
df_files
*
next
;
}
DynamicFileList
;
}
DynamicFileList
;
...
...
src/utils/version.c
View file @
31c8e94b
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/utils/Attic/version.c,v 1.
3 1996/11/26 01:17:56 bryanh
Exp $
* $Header: /cvsroot/pgsql/src/utils/Attic/version.c,v 1.
4 1997/02/14 04:19:07 momjian
Exp $
*
*
* NOTES
* NOTES
* XXX eventually, should be able to handle version identifiers
* XXX eventually, should be able to handle version identifiers
...
@@ -63,11 +63,8 @@ ValidatePgVersion(const char *path, char **reason_p) {
...
@@ -63,11 +63,8 @@ ValidatePgVersion(const char *path, char **reason_p) {
int
fd
;
int
fd
;
char
version
[
4
];
char
version
[
4
];
char
full_path
[
MAXPGPATH
+
1
];
char
full_path
[
MAXPGPATH
+
1
];
#ifndef WIN32
struct
stat
statbuf
;
struct
stat
statbuf
;
#else
struct
_stat
statbuf
;
#endif
PathSetVersionFilePath
(
path
,
full_path
);
PathSetVersionFilePath
(
path
,
full_path
);
if
(
stat
(
full_path
,
&
statbuf
)
<
0
)
{
if
(
stat
(
full_path
,
&
statbuf
)
<
0
)
{
...
...
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