Home
last modified time | relevance | path

Searched refs:fd (Results 1 – 25 of 53) sorted by relevance

123

/openssh-portable/openbsd-compat/
H A Dbsd-poll.c50 fd = fds[i].fd; in poll()
51 if (fd >= FD_SETSIZE) { in poll()
55 maxfd = MAX(maxfd, fd); in poll()
69 fd = fds[i].fd; in poll()
70 if (fd == -1) in poll()
73 FD_SET(fd, readfds); in poll()
74 FD_SET(fd, exceptfds); in poll()
77 FD_SET(fd, writefds); in poll()
78 FD_SET(fd, exceptfds); in poll()
94 fd = fds[i].fd; in poll()
[all …]
H A Dport-net.c79 int fd; in sys_valid_rdomain() local
90 close(fd); in sys_valid_rdomain()
93 close(fd); in sys_valid_rdomain()
146 int fd = -1; in sys_tun_open() local
191 return (fd); in sys_tun_open()
194 close(fd); in sys_tun_open()
243 if (fd < 0) { in sys_tun_open()
256 close(fd); in sys_tun_open()
279 return (fd); in sys_tun_open()
282 if (fd >= 0) in sys_tun_open()
[all …]
H A Dbsd-misc.c141 if (fd != AT_FDCWD) { in utimensat()
154 ret = futimes(fd, tv); in utimensat()
155 close(fd); in utimensat()
172 if (fd != AT_FDCWD) { in fchownat()
186 close(fd); in fchownat()
203 if (fd != AT_FDCWD) { in fchmodat()
217 close(fd); in fchmodat()
226 int fd, ret, saverrno; in truncate() local
229 if (fd < 0) in truncate()
234 close(fd); in truncate()
[all …]
H A Dbsd-closefrom.c68 long fd, maxfd; in closefrom_fallback() local
83 for (fd = lowfd; fd < maxfd; fd++) in closefrom_fallback()
84 (void) close((int) fd); in closefrom_fallback()
127 long fd; in closefrom() local
137 fd = strtol(dent->d_name, &endp, 10); in closefrom()
139 fd >= 0 && fd < INT_MAX && fd >= lowfd && fd != dirfd(dirp)) in closefrom()
140 (void) close((int) fd); in closefrom()
H A Ddaemon.c54 int fd; in daemon() local
71 if (!noclose && (fd = open(_PATH_DEVNULL, O_RDWR, 0)) != -1) { in daemon()
72 (void)dup2(fd, STDIN_FILENO); in daemon()
73 (void)dup2(fd, STDOUT_FILENO); in daemon()
74 (void)dup2(fd, STDERR_FILENO); in daemon()
75 if (fd > 2) in daemon()
76 (void)close (fd); in daemon()
H A Dbsd-nextstep.c47 tcgetattr(int fd, struct termios *t) in tcgetattr() argument
49 return (ioctl(fd, TIOCGETA, t)); in tcgetattr()
53 tcsetattr(int fd, int opt, const struct termios *t) in tcsetattr() argument
64 return (ioctl(fd, TIOCSETA, t)); in tcsetattr()
66 return (ioctl(fd, TIOCSETAW, t)); in tcsetattr()
68 return (ioctl(fd, TIOCSETAF, t)); in tcsetattr()
75 int tcsetpgrp(int fd, pid_t pgrp) in tcsetpgrp() argument
77 return (ioctl(fd, TIOCSPGRP, &pgrp)); in tcsetpgrp()
H A Dport-uw.c98 FILE *fd; in nischeck() local
101 if ((fd = fopen (password_file, "r")) == NULL) { in nischeck()
115 while (ent = fgetpwent(fd)) { in nischeck()
118 fclose (fd); in nischeck()
123 fclose (fd); in nischeck()
H A Dmktemp.c54 int fd; in mktemp_internal() local
82 fd = open(path, O_CREAT|O_EXCL|O_RDWR, S_IRUSR|S_IWUSR); in mktemp_internal()
83 if (fd != -1 || errno != EEXIST) in mktemp_internal()
84 return(fd); in mktemp_internal()
/openssh-portable/
H A Dsshpty.c101 int fd; in pty_make_controlling_tty() local
106 if (fd >= 0) { in pty_make_controlling_tty()
108 close(fd); in pty_make_controlling_tty()
119 if (fd >= 0) { in pty_make_controlling_tty()
121 close(fd); in pty_make_controlling_tty()
134 if (fd == -1) in pty_make_controlling_tty()
137 close(fd); in pty_make_controlling_tty()
141 if (fd == -1) in pty_make_controlling_tty()
145 close(fd); in pty_make_controlling_tty()
224 int fd; in disconnect_controlling_tty() local
[all …]
H A Dsshbuf-io.c34 sshbuf_load_fd(int fd, struct sshbuf **blobp) in sshbuf_load_fd() argument
44 if (fstat(fd, &st) == -1) in sshbuf_load_fd()
52 if ((len = atomicio(read, fd, buf, sizeof(buf))) == 0) { in sshbuf_load_fd()
83 int r, fd, oerrno; in sshbuf_load_file() local
86 if ((fd = open(path, O_RDONLY)) == -1) in sshbuf_load_file()
88 if ((r = sshbuf_load_fd(fd, bufp)) != 0) in sshbuf_load_file()
94 close(fd); in sshbuf_load_file()
103 int fd, oerrno; in sshbuf_write_file() local
107 if (atomicio(vwrite, fd, sshbuf_mutable_ptr(buf), in sshbuf_write_file()
108 sshbuf_len(buf)) != sshbuf_len(buf) || close(fd) != 0) { in sshbuf_write_file()
[all …]
H A Dmonitor_fdpass.c52 mm_send_fd(int sock, int fd) in mm_send_fd() argument
70 msg.msg_accrights = (caddr_t)&fd; in mm_send_fd()
71 msg.msg_accrightslen = sizeof(fd); in mm_send_fd()
80 *(int *)CMSG_DATA(cmsg) = fd; in mm_send_fd()
88 pfd.fd = sock; in mm_send_fd()
127 int fd; in mm_receive_fd() local
136 msg.msg_accrights = (caddr_t)&fd; in mm_receive_fd()
137 msg.msg_accrightslen = sizeof(fd); in mm_receive_fd()
144 pfd.fd = sock; in mm_receive_fd()
180 fd = (*(int *)CMSG_DATA(cmsg)); in mm_receive_fd()
[all …]
H A Dloginrec.c913 close(fd); in utmp_write_direct()
1106 close(fd); in wtmp_write()
1196 close(fd); in wtmp_get_entry()
1203 close(fd); in wtmp_get_entry()
1244 close(fd); in wtmp_get_entry()
1279 close(fd); in wtmpx_write()
1403 close(fd); in wtmpx_get_entry()
1536 int fd; in lastlog_write_entry() local
1595 close(fd); in lastlog_get_entry()
1661 int fd; in record_failed_login() local
[all …]
H A Datomicio.c52 atomicio6(ssize_t (*f) (int, void *, size_t), int fd, void *_s, size_t n, in atomicio6() argument
60 pfd.fd = fd; in atomicio6()
67 res = (f) (fd, s + pos, n - pos); in atomicio6()
97 atomicio(ssize_t (*f) (int, void *, size_t), int fd, void *_s, size_t n) in atomicio() argument
99 return atomicio6(f, fd, _s, n, NULL, NULL); in atomicio()
106 atomiciov6(ssize_t (*f) (int, const struct iovec *, int), int fd, in atomiciov6() argument
122 pfd.fd = fd; in atomiciov6()
129 res = (f) (fd, iov, iovcnt); in atomiciov6()
176 atomiciov(ssize_t (*f) (int, const struct iovec *, int), int fd, in atomiciov() argument
179 return atomiciov6(f, fd, _iov, iovcnt, NULL, NULL); in atomiciov()
H A Dauthfile.c94 if (fstat(fd, &st) == -1) in sshkey_perm_ok()
121 int fd, r; in sshkey_load_private_type() local
128 if ((fd = open(filename, O_RDONLY)) == -1) in sshkey_load_private_type()
131 r = sshkey_perm_ok(fd, filename); in sshkey_load_private_type()
139 close(fd); in sshkey_load_private_type()
170 int r, fd; in sshkey_load_private() local
179 if (sshkey_perm_ok(fd, filename) != 0) { in sshkey_load_private()
192 close(fd); in sshkey_load_private()
499 int fd, oerrno; in sshkey_save_public() local
505 if ((f = fdopen(fd, "w")) == NULL) { in sshkey_save_public()
[all …]
H A Dentropy.c82 int fd, addr_len, rval, errors; in get_random_bytes_prngd() local
118 fd = socket(addr.ss_family, SOCK_STREAM, 0); in get_random_bytes_prngd()
119 if (fd == -1) { in get_random_bytes_prngd()
124 if (connect(fd, (struct sockaddr*)&addr, addr_len) == -1) { in get_random_bytes_prngd()
139 if (atomicio(vwrite, fd, msg, sizeof(msg)) != sizeof(msg)) { in get_random_bytes_prngd()
141 close(fd); in get_random_bytes_prngd()
150 if (atomicio(read, fd, buf, len) != (size_t)len) { in get_random_bytes_prngd()
152 close(fd); in get_random_bytes_prngd()
164 if (fd != -1) in get_random_bytes_prngd()
165 close(fd); in get_random_bytes_prngd()
H A Dmsg.c45 ssh_msg_send(int fd, u_char type, struct sshbuf *m) in ssh_msg_send() argument
54 if (atomicio(vwrite, fd, buf, sizeof(buf)) != sizeof(buf)) { in ssh_msg_send()
58 if (atomicio(vwrite, fd, sshbuf_mutable_ptr(m), mlen) != mlen) { in ssh_msg_send()
66 ssh_msg_recv(int fd, struct sshbuf *m) in ssh_msg_recv() argument
74 if (atomicio(read, fd, buf, sizeof(buf)) != sizeof(buf)) { in ssh_msg_recv()
89 if (atomicio(read, fd, p, msg_len) != msg_len) { in ssh_msg_recv()
H A Dssh-agent.c111 int fd; member
173 close(e->fd); in close_socket()
174 e->fd = -1; in close_socket()
884 sockets[i].fd = fd; in new_socket()
900 sockets[old_alloc].fd = fd; in new_socket()
917 int fd; in handle_socket_read() local
927 close(fd); in handle_socket_read()
933 close(fd); in handle_socket_read()
1003 if (pfd[i].fd == sockets[socknum].fd) in after_poll()
1080 pfd[j].fd = sockets[i].fd; in prepare_poll()
[all …]
H A Dauth-rhosts.c62 int fd; in check_rhosts_file() local
66 if ((fd = open(filename, O_RDONLY|O_NONBLOCK)) == -1) in check_rhosts_file()
68 if (fstat(fd, &st) == -1) { in check_rhosts_file()
69 close(fd); in check_rhosts_file()
75 close(fd); in check_rhosts_file()
78 unset_nonblock(fd); in check_rhosts_file()
79 if ((f = fdopen(fd, "r")) == NULL) { in check_rhosts_file()
80 close(fd); in check_rhosts_file()
H A Dssh-keysign.c171 int r, key_fd[NUM_KEYTYPES], i, found, version = 2, fd; in main() local
180 if ((fd = open(_PATH_DEVNULL, O_RDWR)) < 2) in main()
183 if (fd > 2) in main()
184 close(fd); in main()
251 if ((r = sshbuf_get_u32(b, (u_int *)&fd)) != 0) in main()
253 if (fd < 0 || fd == STDIN_FILENO || fd == STDOUT_FILENO) in main()
254 fatal("bad fd = %d", fd); in main()
255 if ((host = get_local_name(fd)) == NULL) in main()
H A Dmisc.c96 set_nonblock(int fd) in set_nonblock() argument
153 set_nodelay(int fd) in set_nodelay() argument
175 set_reuseaddr(int fd) in set_reuseaddr() argument
188 get_rdomain(int fd) in get_rdomain() argument
253 pfd.fd = fd; in waitfd()
1160 if (fd == -1) { in tun_open()
1191 return fd; in tun_open()
1194 if (fd >= 0) in tun_open()
1195 close(fd); in tun_open()
1710 int fd; in daemonized() local
[all …]
H A Dsftp-server.c279 int fd; member
321 handles[i].fd = fd; in handle_new()
706 if (fd == -1) { in process_open()
711 close(fd); in process_open()
758 if (fd >= 0) { in process_read()
796 if (fd < 0) in process_write()
872 if (fd >= 0) { in process_fstat()
961 int handle, fd, r; in process_fsetstat() local
970 if (fd < 0) in process_fsetstat()
1336 int r, handle, fd; in process_extended_fstatvfs() local
[all …]
H A Dssh-pkcs11-client.c52 static int fd = -1; variable
63 if (atomicio(vwrite, fd, buf, 4) != 4 || in send_msg()
64 atomicio(vwrite, fd, sshbuf_mutable_ptr(m), in send_msg()
78 if ((len = atomicio(read, fd, buf, 4)) != 4) { in recv_msg()
91 if (atomicio(read, fd, buf, l) != l) { in recv_msg()
113 if (fd >= 0) in pkcs11_terminate()
114 close(fd); in pkcs11_terminate()
310 fd = pair[0]; in pkcs11_start_helper()
326 if (fd < 0 && pkcs11_start_helper() < 0) in pkcs11_add_provider()
H A Dmux.c1485 pfd.fd = fd; in mux_client_read()
1494 len = read(fd, p + have, need - have); in mux_client_read()
1527 pfd.fd = fd; in mux_client_write_packet()
1606 mux_client_hello_exchange(int fd) in mux_client_hello_exchange() argument
1668 mux_client_request_alive(int fd) in mux_client_request_alive() argument
1719 mux_client_request_terminate(int fd) in mux_client_request_terminate() argument
1898 mux_client_request_session(int fd) in mux_client_request_session() argument
2073 close(fd); in mux_client_request_session()
2093 mux_client_proxy(int fd) in mux_client_proxy() argument
2134 mux_client_request_stdio_fwd(int fd) in mux_client_request_stdio_fwd() argument
[all …]
H A Dttymodes.c279 ssh_tty_make_modes(struct ssh *ssh, int fd, struct termios *tiop) in ssh_tty_make_modes() argument
289 if (fd == -1) { in ssh_tty_make_modes()
293 if (tcgetattr(fd, &tio) == -1) { in ssh_tty_make_modes()
343 ssh_tty_parse_modes(struct ssh *ssh, int fd) in ssh_tty_parse_modes() argument
367 if (tcgetattr(fd, &tio) == -1) { in ssh_tty_parse_modes()
454 if (tcsetattr(fd, TCSANOW, &tio) == -1) in ssh_tty_parse_modes()
/openssh-portable/regress/
H A Dnetcat.c680 pfd.fd = s; in timeout_connect()
807 if (pfd[POLL_STDIN].fd == -1 && pfd[POLL_NETIN].fd == -1 in readwrite()
813 if (pfd[POLL_NETOUT].fd == -1 && pfd[POLL_STDOUT].fd == -1) { in readwrite()
846 pfd[n].fd = -1; in readwrite()
853 pfd[POLL_STDIN].fd = -1; in readwrite()
858 pfd[POLL_NETIN].fd = -1; in readwrite()
863 pfd[POLL_NETOUT].fd = -1; in readwrite()
867 pfd[POLL_STDOUT].fd = -1; in readwrite()
870 pfd[POLL_STDIN].fd = -1; in readwrite()
875 pfd[POLL_NETIN].fd = -1; in readwrite()
[all …]

Completed in 146 milliseconds

123