mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-30 19:20:53 +02:00
11567: FD_CLOEXEC in zftp.c
This commit is contained in:
parent
6959ffd962
commit
5bed7d645b
2 changed files with 7 additions and 6 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
2000-05-25 Peter Stephenson <pws@cambridgesiliconradio.com>
|
||||||
|
|
||||||
|
* 11567: Src/Modules/zftp.c: fix fcntl() argument for FD_CLOEXEC.
|
||||||
|
|
||||||
2000-05-25 Sven Wischnowsky <wischnow@zsh.org>
|
2000-05-25 Sven Wischnowsky <wischnow@zsh.org>
|
||||||
|
|
||||||
* 11565: Completion/Base/_in_vared, Completion/Commands/_complete_debug,
|
* 11565: Completion/Base/_in_vared, Completion/Commands/_complete_debug,
|
||||||
|
|
|
@ -1303,8 +1303,7 @@ zfgetdata(char *name, char *rest, char *cmd, int getsize)
|
||||||
#endif
|
#endif
|
||||||
#if defined(F_SETFD) && defined(FD_CLOEXEC)
|
#if defined(F_SETFD) && defined(FD_CLOEXEC)
|
||||||
/* If the shell execs a program, we don't want this fd left open. */
|
/* If the shell execs a program, we don't want this fd left open. */
|
||||||
len = FD_CLOEXEC;
|
fcntl(zfsess->dfd, F_SETFD, FD_CLOEXEC);
|
||||||
fcntl(zfsess->dfd, F_SETFD, &len);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1988,8 +1987,7 @@ zftp_open(char *name, char **args, int flags)
|
||||||
|
|
||||||
#if defined(F_SETFD) && defined(FD_CLOEXEC)
|
#if defined(F_SETFD) && defined(FD_CLOEXEC)
|
||||||
/* If the shell execs a program, we don't want this fd left open. */
|
/* If the shell execs a program, we don't want this fd left open. */
|
||||||
len = FD_CLOEXEC;
|
fcntl(zfsess->cfd, F_SETFD, FD_CLOEXEC);
|
||||||
fcntl(zfsess->cfd, F_SETFD, &len);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
len = sizeof(zfsess->sock);
|
len = sizeof(zfsess->sock);
|
||||||
|
@ -2057,8 +2055,7 @@ zftp_open(char *name, char **args, int flags)
|
||||||
DPUTS(zfstatfd == -1, "zfstatfd not created");
|
DPUTS(zfstatfd == -1, "zfstatfd not created");
|
||||||
#if defined(F_SETFD) && defined(FD_CLOEXEC)
|
#if defined(F_SETFD) && defined(FD_CLOEXEC)
|
||||||
/* If the shell execs a program, we don't want this fd left open. */
|
/* If the shell execs a program, we don't want this fd left open. */
|
||||||
len = FD_CLOEXEC;
|
fcntl(zfstatfd, F_SETFD, FD_CLOEXEC);
|
||||||
fcntl(zfstatfd, F_SETFD, &len);
|
|
||||||
#endif
|
#endif
|
||||||
unlink(fname);
|
unlink(fname);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue