Commit 49192e54 authored by Pavan Balaji's avatar Pavan Balaji
Browse files

[svn-r5903] Move the demux engine to a utility. We never conditionally compile it;

it's always required.
parent eab2bcf4
......@@ -571,7 +571,6 @@ WARN_LOGFILE =
INPUT = @top_srcdir@/tools/bind/bind.h \
@top_srcdir@/tools/bootstrap/include/bsci.h.in \
@top_srcdir@/tools/ckpoint/ckpoint.h \
@top_srcdir@/tools/demux/demux.h \
@top_srcdir@/rmk/include/rmki.h.in \
@top_srcdir@/pm/include/pmci.h
......
......@@ -263,4 +263,71 @@ char *HYDU_strerror(int error);
int HYDU_strlist_lastidx(char **strlist);
char **HYDU_str_to_strlist(char *str);
/*! \addtogroup demux Demultiplexing Engine
* @{
*/
/**
* \brief HYDU_dmx_register_fd - Register file descriptors for events
*
* \param[in] num_fds Number of file descriptors being provided
* \param[in] fd Array of file descriptors
* \param[in] events Events we are interested in
* \param[in] userp Persistent user storage associated with a descriptor
* (not interpreted by the demux engine)
* \param[in] callback Callback function to call when the event occurs
*
* This function registers all file descriptors to be waited on for an
* event.
*/
HYD_status HYDU_dmx_register_fd(int num_fds, int *fd, HYD_event_t events, void *userp,
HYD_status(*callback) (int fd, HYD_event_t events,
void *userp));
/**
* \brief HYDU_dmx_deregister_fd - Deregister file descriptor
*
* \param[in] fd File descriptor to be deregistered
*
* This function deregisters a file descriptor from the demux
* engine. All registered fd's must be deregistered.
*/
HYD_status HYDU_dmx_deregister_fd(int fd);
/**
* \brief HYDU_dmx_wait_for_event - Wait for event
*
* \param time Time to wait for in seconds (-1 means infinite)
*
* This function waits till either one of the registered fd's has had
* one of its registered events, or till the timeout expires.
*/
HYD_status HYDU_dmx_wait_for_event(int time);
/**
* \brief HYDU_dmx_finalize - Finalize demux engine
*
* This function cleans up any relevant state that the demux engine
* maintained.
*/
HYD_status HYDU_dmx_finalize(void);
/**
* \brief HYDU_dmx_query_fd_registration - Query if an fd is registered
*
* \param[in] fd File descriptor to check whether registered
* \param[out] ret 1 if registered; 0 if not
*
* If a file descriptor is being registered and deregistered by
* different layers, this function allows us to query what its state
* is.
*/
HYD_status HYDU_dmx_query_fd_registration(int fd, int *ret);
/*!
* @}
*/
#endif /* HYDRA_UTILS_H_INCLUDED */
......@@ -7,7 +7,6 @@
#include "hydra.h"
#include "hydra_utils.h"
#include "bsci.h"
#include "demux.h"
#include "pmi_handle.h"
static HYD_status fn_initack(int fd, char *args[])
......@@ -399,7 +398,7 @@ static HYD_status fn_finalize(int fd, char *args[])
HYDU_ERR_POP(status, "error writing PMI line\n");
if (status == HYD_SUCCESS) {
status = HYDT_dmx_deregister_fd(fd);
status = HYDU_dmx_deregister_fd(fd);
HYDU_ERR_POP(status, "unable to register fd\n");
close(fd);
}
......
......@@ -7,7 +7,6 @@
#include "hydra.h"
#include "hydra_utils.h"
#include "bsci.h"
#include "demux.h"
#include "pmi_handle.h"
static HYD_status fn_fullinit(int fd, char *args[]);
......@@ -779,7 +778,7 @@ static HYD_status fn_finalize(int fd, char *args[])
HYDU_FREE(cmd);
if (status == HYD_SUCCESS) {
status = HYDT_dmx_deregister_fd(fd);
status = HYDU_dmx_deregister_fd(fd);
HYDU_ERR_POP(status, "unable to register fd\n");
close(fd);
}
......
......@@ -6,7 +6,6 @@
#include "hydra.h"
#include "hydra_utils.h"
#include "demux.h"
#include "pmi_proxy.h"
struct HYD_pmcd_pmip HYD_pmcd_pmip;
......@@ -32,13 +31,13 @@ int main(int argc, char **argv)
&HYD_pmcd_pmip.local.id, sizeof(HYD_pmcd_pmip.local.id));
HYDU_ERR_POP(status, "unable to send the proxy ID to the server\n");
status = HYDT_dmx_register_fd(1, &HYD_pmcd_pmip.upstream.control,
status = HYDU_dmx_register_fd(1, &HYD_pmcd_pmip.upstream.control,
HYD_POLLIN, NULL, HYD_pmcd_pmi_proxy_control_cmd_cb);
HYDU_ERR_POP(status, "unable to register fd\n");
while (1) {
/* Wait for some event to occur */
status = HYDT_dmx_wait_for_event(-1);
status = HYDU_dmx_wait_for_event(-1);
HYDU_ERR_POP(status, "demux engine error waiting for event\n");
/* Check to see if there's any open read socket left; if there
......@@ -80,7 +79,7 @@ int main(int argc, char **argv)
break;
/* Check if there are any messages from the launcher */
status = HYDT_dmx_wait_for_event(0);
status = HYDU_dmx_wait_for_event(0);
HYDU_ERR_POP(status, "demux engine error waiting for event\n");
}
......@@ -90,7 +89,7 @@ int main(int argc, char **argv)
HYD_pmcd_pmip.local.proxy_process_count * sizeof(int));
HYDU_ERR_POP(status, "unable to return exit status upstream\n");
status = HYDT_dmx_deregister_fd(HYD_pmcd_pmip.upstream.control);
status = HYDU_dmx_deregister_fd(HYD_pmcd_pmip.upstream.control);
HYDU_ERR_POP(status, "unable to deregister fd\n");
close(HYD_pmcd_pmip.upstream.control);
......
......@@ -7,7 +7,6 @@
#include "hydra.h"
#include "hydra_utils.h"
#include "pmi_proxy.h"
#include "demux.h"
#include "ckpoint.h"
struct HYD_pmcd_pmip HYD_pmcd_pmip;
......@@ -26,7 +25,7 @@ HYD_status HYD_pmcd_pmi_proxy_control_cmd_cb(int fd, HYD_event_t events, void *u
HYDU_ERR_POP(status, "error reading command from launcher\n");
if (cmd_len == 0) {
/* The connection has closed */
status = HYDT_dmx_deregister_fd(fd);
status = HYDU_dmx_deregister_fd(fd);
HYDU_ERR_POP(status, "unable to deregister fd\n");
close(fd);
goto fn_exit;
......@@ -80,7 +79,7 @@ HYD_status HYD_pmcd_pmi_proxy_stdout_cb(int fd, HYD_event_t events, void *userp)
if (closed) {
/* The connection has closed */
status = HYDT_dmx_deregister_fd(fd);
status = HYDU_dmx_deregister_fd(fd);
HYDU_ERR_POP(status, "unable to deregister fd\n");
for (i = 0; i < HYD_pmcd_pmip.local.proxy_process_count; i++)
......@@ -111,7 +110,7 @@ HYD_status HYD_pmcd_pmi_proxy_stderr_cb(int fd, HYD_event_t events, void *userp)
if (closed) {
/* The connection has closed */
status = HYDT_dmx_deregister_fd(fd);
status = HYDU_dmx_deregister_fd(fd);
HYDU_ERR_POP(status, "unable to deregister fd\n");
for (i = 0; i < HYD_pmcd_pmip.local.proxy_process_count; i++)
......@@ -141,7 +140,7 @@ HYD_status HYD_pmcd_pmi_proxy_stdin_cb(int fd, HYD_event_t events, void *userp)
HYDU_ERR_POP(status, "stdin forwarding error\n");
if (closed) {
status = HYDT_dmx_deregister_fd(fd);
status = HYDU_dmx_deregister_fd(fd);
HYDU_ERR_POP(status, "unable to deregister fd\n");
close(fd);
......
......@@ -6,7 +6,6 @@
#include "pmi_proxy.h"
#include "bsci.h"
#include "demux.h"
#include "bind.h"
#include "ckpoint.h"
#include "hydra_utils.h"
......@@ -741,7 +740,7 @@ HYD_status HYD_pmcd_pmi_proxy_launch_procs(void)
os_index);
stdin_fd = STDIN_FILENO;
status = HYDT_dmx_register_fd(1, &stdin_fd, HYD_POLLIN, NULL,
status = HYDU_dmx_register_fd(1, &stdin_fd, HYD_POLLIN, NULL,
HYD_pmcd_pmi_proxy_stdin_cb);
HYDU_ERR_POP(status, "unable to register fd\n");
}
......@@ -763,12 +762,12 @@ HYD_status HYD_pmcd_pmi_proxy_launch_procs(void)
fn_spawn_complete:
/* Everything is spawned, register the required FDs */
status = HYDT_dmx_register_fd(HYD_pmcd_pmip.local.proxy_process_count,
status = HYDU_dmx_register_fd(HYD_pmcd_pmip.local.proxy_process_count,
HYD_pmcd_pmip.downstream.out,
HYD_POLLIN, NULL, HYD_pmcd_pmi_proxy_stdout_cb);
HYDU_ERR_POP(status, "unable to register fd\n");
status = HYDT_dmx_register_fd(HYD_pmcd_pmip.local.proxy_process_count,
status = HYDU_dmx_register_fd(HYD_pmcd_pmip.local.proxy_process_count,
HYD_pmcd_pmip.downstream.err,
HYD_POLLIN, NULL, HYD_pmcd_pmi_proxy_stderr_cb);
HYDU_ERR_POP(status, "unable to register fd\n");
......
......@@ -10,7 +10,6 @@
#include "pmi_handle_common.h"
#include "pmci.h"
#include "bsci.h"
#include "demux.h"
#include "pmi_serv.h"
HYD_status HYD_pmcd_pmi_connect_cb(int fd, HYD_event_t events, void *userp)
......@@ -24,7 +23,7 @@ HYD_status HYD_pmcd_pmi_connect_cb(int fd, HYD_event_t events, void *userp)
status = HYDU_sock_accept(fd, &accept_fd);
HYDU_ERR_POP(status, "accept error\n");
status = HYDT_dmx_register_fd(1, &accept_fd, HYD_POLLIN, NULL, HYD_pmcd_pmi_cmd_cb);
status = HYDU_dmx_register_fd(1, &accept_fd, HYD_POLLIN, NULL, HYD_pmcd_pmi_cmd_cb);
HYDU_ERR_POP(status, "unable to register fd\n");
fn_exit:
......@@ -134,7 +133,7 @@ HYD_status HYD_pmcd_pmi_cmd_cb(int fd, HYD_event_t events, void *userp)
goto fn_fail;
}
status = HYDT_dmx_deregister_fd(fd);
status = HYDU_dmx_deregister_fd(fd);
if (status != HYD_SUCCESS) {
HYDU_warn_printf("unable to deregister fd %d\n", fd);
status = HYD_SUCCESS;
......@@ -235,7 +234,7 @@ HYD_status HYD_pmcd_pmi_serv_control_connect_cb(int fd, HYD_event_t events, void
status = HYD_pmcd_pmi_send_exec_info(proxy);
HYDU_ERR_POP(status, "unable to send exec info to proxy\n");
status = HYDT_dmx_register_fd(1, &accept_fd, HYD_POLLIN, proxy,
status = HYDU_dmx_register_fd(1, &accept_fd, HYD_POLLIN, proxy,
HYD_pmcd_pmi_serv_control_cb);
HYDU_ERR_POP(status, "unable to register fd\n");
......@@ -264,7 +263,7 @@ HYD_status HYD_pmcd_pmi_serv_control_cb(int fd, HYD_event_t events, void *userp)
&count, HYDU_SOCK_COMM_MSGWAIT);
HYDU_ERR_POP(status, "unable to read status from proxy\n");
status = HYDT_dmx_deregister_fd(fd);
status = HYDU_dmx_deregister_fd(fd);
HYDU_ERR_POP(status, "error deregistering fd\n");
close(fd);
......
......@@ -8,7 +8,6 @@
#include "pmci.h"
#include "pmi_handle.h"
#include "bsci.h"
#include "demux.h"
#include "pmi_serv.h"
HYD_status HYD_pmci_finalize(void)
......@@ -23,7 +22,7 @@ HYD_status HYD_pmci_finalize(void)
status = HYDT_bsci_finalize();
HYDU_ERR_POP(status, "unable to finalize bootstrap server\n");
status = HYDT_dmx_finalize();
status = HYDU_dmx_finalize();
HYDU_ERR_POP(status, "error returned from demux finalize\n");
fn_exit:
......
......@@ -9,7 +9,6 @@
#include "pmci.h"
#include "pmi_handle.h"
#include "bsci.h"
#include "demux.h"
#include "pmi_serv.h"
static char *pmi_port = NULL;
......@@ -40,7 +39,7 @@ create_and_listen_portstr(HYD_status(*callback) (int fd, HYD_event_t events, voi
HYDU_ERR_POP(status, "unable to listen on port\n");
/* Register the listening socket with the demux engine */
status = HYDT_dmx_register_fd(1, &listenfd, HYD_POLLIN, NULL, callback);
status = HYDU_dmx_register_fd(1, &listenfd, HYD_POLLIN, NULL, callback);
HYDU_ERR_POP(status, "unable to register fd\n");
/* Create a port string for MPI processes to use to connect to */
......
......@@ -7,7 +7,6 @@
#include "hydra.h"
#include "hydra_utils.h"
#include "pmi_serv.h"
#include "demux.h"
HYD_status HYD_pmcd_pmi_send_exec_info(struct HYD_proxy *proxy)
{
......
......@@ -9,4 +9,3 @@ tools_libs =
include tools/bind/Makefile.mk
include tools/bootstrap/Makefile.mk
include tools/ckpoint/Makefile.mk
include tools/demux/Makefile.mk
......@@ -68,16 +68,16 @@ HYD_status HYDT_bscd_fork_launch_procs(
/* Register stdio callbacks for the spawned process */
if (i == 0) {
fd = STDIN_FILENO;
status = HYDT_dmx_register_fd(1, &fd, HYD_POLLIN, &fd_stdin,
status = HYDU_dmx_register_fd(1, &fd, HYD_POLLIN, &fd_stdin,
HYDT_bscu_stdin_cb);
HYDU_ERR_POP(status, "demux returned error registering fd\n");
}
status = HYDT_dmx_register_fd(1, &fd_stdout, HYD_POLLIN, stdout_cb,
status = HYDU_dmx_register_fd(1, &fd_stdout, HYD_POLLIN, stdout_cb,
HYDT_bscu_inter_cb);
HYDU_ERR_POP(status, "demux returned error registering fd\n");
status = HYDT_dmx_register_fd(1, &fd_stderr, HYD_POLLIN, stderr_cb,
status = HYDU_dmx_register_fd(1, &fd_stderr, HYD_POLLIN, stderr_cb,
HYDT_bscu_inter_cb);
HYDU_ERR_POP(status, "demux returned error registering fd\n");
}
......
......@@ -41,7 +41,7 @@ static HYD_status persist_cb(int fd, HYD_event_t events, void *userp)
}
}
else {
status = HYDT_dmx_deregister_fd(fd);
status = HYDU_dmx_deregister_fd(fd);
HYDU_ERR_POP(status, "error deregistering fd\n");
close(fd);
......@@ -90,13 +90,13 @@ HYD_status HYDT_bscd_persist_launch_procs(
if (i == 0) {
tmp_fd = STDIN_FILENO;
status = HYDT_dmx_register_fd(1, &tmp_fd, HYD_POLLIN,
status = HYDU_dmx_register_fd(1, &tmp_fd, HYD_POLLIN,
&HYDT_bscd_persist_control_fd[i],
HYDT_bscu_stdin_cb);
HYDU_ERR_POP(status, "demux returned error registering fd\n");
}
status = HYDT_dmx_register_fd(1, &HYDT_bscd_persist_control_fd[i], HYD_POLLIN, NULL,
status = HYDU_dmx_register_fd(1, &HYDT_bscd_persist_control_fd[i], HYD_POLLIN, NULL,
persist_cb);
HYDU_ERR_POP(status, "demux returned error registering fd\n");
}
......
......@@ -6,7 +6,6 @@
#include "hydra_base.h"
#include "hydra_utils.h"
#include "demux.h"
#include "persist_server.h"
struct HYDT_persist_handle HYDT_persist_handle;
......@@ -79,7 +78,7 @@ static HYD_status stdio_cb(int fd, HYD_event_t events, void *userp)
HYDU_ERR_POP(status, "stdin forwarding error\n");
if (closed) {
status = HYDT_dmx_deregister_fd(private.client_fd);
status = HYDU_dmx_deregister_fd(private.client_fd);
HYDU_ERR_SETANDJUMP1(status, status, "error deregistering fd %d\n",
private.client_fd);
close(private.client_fd);
......@@ -101,7 +100,7 @@ static HYD_status stdio_cb(int fd, HYD_event_t events, void *userp)
HYDU_ERR_POP(status, "error sending stdout to client\n");
}
else {
status = HYDT_dmx_deregister_fd(private.stdout_fd);
status = HYDU_dmx_deregister_fd(private.stdout_fd);
HYDU_ERR_SETANDJUMP1(status, status, "error deregistering fd %d\n",
private.stdout_fd);
close(private.stdout_fd);
......@@ -126,7 +125,7 @@ static HYD_status stdio_cb(int fd, HYD_event_t events, void *userp)
HYDU_ERR_POP(status, "error sending stdout to client\n");
}
else {
status = HYDT_dmx_deregister_fd(private.stderr_fd);
status = HYDU_dmx_deregister_fd(private.stderr_fd);
HYDU_ERR_SETANDJUMP1(status, status, "error deregistering fd %d\n",
private.stderr_fd);
close(private.stderr_fd);
......@@ -170,7 +169,7 @@ static HYD_status listen_cb(int fd, HYD_event_t events, void *userp)
/* This is the slave process. Close and deregister the listen socket */
private.type = SLAVE;
HYDT_dmx_deregister_fd(private.listen_fd);
HYDU_dmx_deregister_fd(private.listen_fd);
close(private.listen_fd);
/* Get the executable information */
......@@ -199,13 +198,13 @@ static HYD_status listen_cb(int fd, HYD_event_t events, void *userp)
HYDU_ERR_POP(status, "unable to create process\n");
/* use the accepted connection for stdio */
status = HYDT_dmx_register_fd(1, &private.client_fd, HYD_POLLIN, NULL, stdio_cb);
status = HYDU_dmx_register_fd(1, &private.client_fd, HYD_POLLIN, NULL, stdio_cb);
HYDU_ERR_POP(status, "unable to register fd\n");
status = HYDT_dmx_register_fd(1, &private.stdout_fd, HYD_POLLIN, NULL, stdio_cb);
status = HYDU_dmx_register_fd(1, &private.stdout_fd, HYD_POLLIN, NULL, stdio_cb);
HYDU_ERR_POP(status, "unable to register fd\n");
status = HYDT_dmx_register_fd(1, &private.stderr_fd, HYD_POLLIN, NULL, stdio_cb);
status = HYDU_dmx_register_fd(1, &private.stderr_fd, HYD_POLLIN, NULL, stdio_cb);
HYDU_ERR_POP(status, "unable to register fd\n");
fn_exit:
......@@ -264,7 +263,7 @@ int main(int argc, char **argv)
HYDU_ERR_POP(status, "unable to listen on port\n");
/* Register the listening socket with the demux engine */
status = HYDT_dmx_register_fd(1, &private.listen_fd, HYD_POLLIN, NULL, listen_cb);
status = HYDU_dmx_register_fd(1, &private.listen_fd, HYD_POLLIN, NULL, listen_cb);
HYDU_ERR_POP(status, "unable to register fd\n");
/* set type to master; when a slave forks out, it'll reset the
......@@ -273,23 +272,23 @@ int main(int argc, char **argv)
while (1) {
/* Wait for some event to occur */
status = HYDT_dmx_wait_for_event(-1);
status = HYDU_dmx_wait_for_event(-1);
HYDU_ERR_POP(status, "demux engine error waiting for event\n");
if (private.type == SLAVE) {
/* check if all stdio fd's have been deregistered */
status = HYDT_dmx_query_fd_registration(private.stdout_fd, &ret);
status = HYDU_dmx_query_fd_registration(private.stdout_fd, &ret);
HYDU_ERR_POP(status, "unable to query fd registration from demux engine\n");
if (ret)
continue;
status = HYDT_dmx_query_fd_registration(private.stderr_fd, &ret);
status = HYDU_dmx_query_fd_registration(private.stderr_fd, &ret);
HYDU_ERR_POP(status, "unable to query fd registration from demux engine\n");
if (ret)
continue;
status = HYDT_dmx_query_fd_registration(private.client_fd, &ret);
status = HYDU_dmx_query_fd_registration(private.client_fd, &ret);
HYDU_ERR_POP(status, "unable to query fd registration from demux engine\n");
if (ret)
continue;
......
......@@ -16,12 +16,12 @@ HYD_status HYDT_bscd_persist_wait_for_completion(int timeout)
HYDU_FUNC_ENTER();
while (1) {
status = HYDT_dmx_wait_for_event(timeout);
status = HYDU_dmx_wait_for_event(timeout);
HYDU_ERR_POP(status, "error waiting for event\n");
all_done = 1;
for (i = 0; i < HYDT_bscd_persist_node_count; i++) {
status = HYDT_dmx_query_fd_registration(HYDT_bscd_persist_control_fd[i], &ret);
status = HYDU_dmx_query_fd_registration(HYDT_bscd_persist_control_fd[i], &ret);
HYDU_ERR_POP(status, "unable to query fd registration from demux engine\n");
if (ret)
......
......@@ -84,16 +84,16 @@ HYD_status HYDT_bscd_rsh_launch_procs(
/* Register stdio callbacks for the spawned process */
if (i == 0) {
status = HYDT_dmx_register_fd(1, &fd_stdin, HYD_POLLIN, &fd_stdin,
status = HYDU_dmx_register_fd(1, &fd_stdin, HYD_POLLIN, &fd_stdin,
HYDT_bscu_stdin_cb);
HYDU_ERR_POP(status, "demux returned error registering fd\n");
}
status = HYDT_dmx_register_fd(1, &fd_stdout, HYD_POLLIN, stdout_cb,
status = HYDU_dmx_register_fd(1, &fd_stdout, HYD_POLLIN, stdout_cb,
HYDT_bscu_inter_cb);
HYDU_ERR_POP(status, "demux returned error registering fd\n");
status = HYDT_dmx_register_fd(1, &fd_stderr, HYD_POLLIN, stderr_cb,
status = HYDU_dmx_register_fd(1, &fd_stderr, HYD_POLLIN, stderr_cb,
HYDT_bscu_inter_cb);
HYDU_ERR_POP(status, "demux returned error registering fd\n");
}
......
......@@ -132,15 +132,15 @@ HYD_status HYDT_bscd_slurm_launch_procs(
HYD_bscu_fd_list[HYD_bscu_fd_count++] = fd_stderr;
/* Register stdio callbacks for the spawned process */
status = HYDT_dmx_register_fd(1, &fd_stdin, HYD_POLLIN, &fd_stdin,
status = HYDU_dmx_register_fd(1, &fd_stdin, HYD_POLLIN, &fd_stdin,
HYDT_bscu_stdin_cb);
HYDU_ERR_POP(status, "demux returned error registering fd\n");
status = HYDT_dmx_register_fd(1, &fd_stdout, HYD_POLLIN, stdout_cb,
status = HYDU_dmx_register_fd(1, &fd_stdout, HYD_POLLIN, stdout_cb,
HYDT_bscu_inter_cb);
HYDU_ERR_POP(status, "demux returned error registering fd\n");
status = HYDT_dmx_register_fd(1, &fd_stderr, HYD_POLLIN, stderr_cb,
status = HYDU_dmx_register_fd(1, &fd_stderr, HYD_POLLIN, stderr_cb,
HYDT_bscu_inter_cb);
HYDU_ERR_POP(status, "demux returned error registering fd\n");
......
......@@ -93,16 +93,16 @@ HYD_status HYDT_bscd_ssh_launch_procs(
/* Register stdio callbacks for the spawned process */
if (i == 0) {
fd = STDIN_FILENO;
status = HYDT_dmx_register_fd(1, &fd, HYD_POLLIN, &fd_stdin,
status = HYDU_dmx_register_fd(1, &fd, HYD_POLLIN, &fd_stdin,
HYDT_bscu_stdin_cb);
HYDU_ERR_POP(status, "demux returned error registering fd\n");
}
status = HYDT_dmx_register_fd(1, &fd_stdout, HYD_POLLIN, stdout_cb,
status = HYDU_dmx_register_fd(1, &fd_stdout, HYD_POLLIN, stdout_cb,
HYDT_bscu_inter_cb);
HYDU_ERR_POP(status, "demux returned error registering fd\n");
status = HYDT_dmx_register_fd(1, &fd_stderr, HYD_POLLIN, stderr_cb,
status = HYDU_dmx_register_fd(1, &fd_stderr, HYD_POLLIN, stderr_cb,
HYDT_bscu_inter_cb);
HYDU_ERR_POP(status, "demux returned error registering fd\n");
}
......
......@@ -24,7 +24,7 @@ HYD_status HYDT_bscu_inter_cb(int fd, HYD_event_t events, void *userp)
if (buflen == 0) {
/* connection has closed */
status = HYDT_dmx_deregister_fd(fd);
status = HYDU_dmx_deregister_fd(fd);
HYDU_ERR_SETANDJUMP1(status, status, "error deregistering fd %d\n", fd);
close(fd);
......@@ -54,7 +54,7 @@ HYD_status HYDT_bscu_stdin_cb(int fd, HYD_event_t events, void *userp)
HYDU_ERR_POP(status, "stdin forwarding error\n");
if (closed) {
status = HYDT_dmx_deregister_fd(fd);
status = HYDU_dmx_deregister_fd(fd);
HYDU_ERR_SETANDJUMP1(status, status, "error deregistering fd %d\n", fd);
close(STDIN_FILENO);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment