popen.c did not compile with __USG defined
This commit is contained in:
parent
fbf6efa8fd
commit
2ad0051a24
1 changed files with 5 additions and 2 deletions
|
@ -17,6 +17,9 @@ typedef int wait_arg;
|
||||||
#include "../stdio/loc_incl.h"
|
#include "../stdio/loc_incl.h"
|
||||||
|
|
||||||
int _close(int d);
|
int _close(int d);
|
||||||
|
#if defined(__USG)
|
||||||
|
static
|
||||||
|
#endif
|
||||||
int _dup2(int oldd, int newd); /* not present in System 5 */
|
int _dup2(int oldd, int newd); /* not present in System 5 */
|
||||||
int _execl(const char *name, ... );
|
int _execl(const char *name, ... );
|
||||||
int _fork(void);
|
int _fork(void);
|
||||||
|
@ -24,7 +27,7 @@ int _pipe(int fildes[2]);
|
||||||
int _wait(wait_arg *status);
|
int _wait(wait_arg *status);
|
||||||
void _exit(int status);
|
void _exit(int status);
|
||||||
|
|
||||||
static int pids[20];
|
static int pids[FOPEN_MAX];
|
||||||
|
|
||||||
FILE *
|
FILE *
|
||||||
popen(const char *command, const char *type)
|
popen(const char *command, const char *type)
|
||||||
|
@ -89,7 +92,7 @@ static int
|
||||||
_dup2(int oldd, int newd)
|
_dup2(int oldd, int newd)
|
||||||
{
|
{
|
||||||
int i = 0, fd, tmp;
|
int i = 0, fd, tmp;
|
||||||
int fdbuf[_NFILES];
|
int fdbuf[FOPEN_MAX];
|
||||||
|
|
||||||
/* ignore the error on the close() */
|
/* ignore the error on the close() */
|
||||||
tmp = errno; (void) _close(newd); errno = tmp;
|
tmp = errno; (void) _close(newd); errno = tmp;
|
||||||
|
|
Loading…
Reference in a new issue