Skip to content

Commit 6d8c3d4

Browse files
committed
Add popen/pclose -> _popen/_pclose() mapping for Win32.
1 parent 5bd06b2 commit 6d8c3d4

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/bin/psql/common.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
*
44
* Copyright 2000 by PostgreSQL Global Development Group
55
*
6-
* $Header: /cvsroot/pgsql/src/bin/psql/common.c,v 1.50 2002/10/24 01:33:50 momjian Exp $
6+
* $Header: /cvsroot/pgsql/src/bin/psql/common.c,v 1.51 2002/10/29 19:35:33 momjian Exp $
77
*/
88
#include "postgres_fe.h"
9-
109
#include "common.h"
1110

1211
#include <errno.h>
@@ -27,9 +26,6 @@
2726

2827
#ifndef WIN32
2928
#include <sys/ioctl.h> /* for ioctl() */
30-
#else
31-
#define popen(x,y) _popen(x,y)
32-
#define pclose(x) _pclose(x)
3329
#endif
3430

3531
#ifdef HAVE_TERMIOS_H

src/bin/psql/common.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright 2000 by PostgreSQL Global Development Group
55
*
6-
* $Header: /cvsroot/pgsql/src/bin/psql/common.h,v 1.20 2002/10/23 19:23:56 momjian Exp $
6+
* $Header: /cvsroot/pgsql/src/bin/psql/common.h,v 1.21 2002/10/29 19:35:33 momjian Exp $
77
*/
88
#ifndef COMMON_H
99
#define COMMON_H
@@ -42,4 +42,10 @@ extern FILE *PageOutput(int lines, bool pager);
4242
/* sprompt.h */
4343
extern char *simple_prompt(const char *prompt, int maxlen, bool echo);
4444

45+
/* Used for all Win32 popen/pclose calls */
46+
#ifdef WIN32
47+
#define popen(x,y) _popen(x,y)
48+
#define pclose(x) _pclose(x)
49+
#endif
50+
4551
#endif /* COMMON_H */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy