int super_clnt_do_pass_fd( int sock_fd, int fds_num, int *fds) { int n; if (sock_fd < 0) return -SSERV_ERR_NOT_CONNECTED; if (fds_num <= 0 || fds_num > 2 || !fds) return -SSERV_ERR_INVALID_FD; for (n = 0; n < fds_num; n++) if (fds[n] < 0) return -SSERV_ERR_INVALID_FD; if (sock_op_put_fds(sock_fd, fds_num, fds) < 0) { err("super_clnt_do_pass_fd: sock_op_put_fds failed"); return -SSERV_ERR_WRITE_TO_SERVER; } return 0; }
int userlist_clnt_do_pass_fd( struct userlist_clnt *clnt, int fds_num, int *fds) { #if !defined PYTHON ASSERT(clnt); ASSERT(fds_num > 0 && fds_num <= 32); ASSERT(fds); #endif if (sock_op_put_fds(clnt->fd, fds_num, fds) < 0) { #if defined PYTHON PyErr_SetString(PyExc_IOError, "sock_op_put_fds failed"); return -1; #else err("%s: sock_op_put_fds failed", __FUNCTION__); return -ULS_ERR_WRITE_ERROR; #endif } return 0; }