Commit 77ae7d8b authored by Pavan Balaji's avatar Pavan Balaji
Browse files

[svn-r6071] Warning squash.

parent c75b50c7
......@@ -210,7 +210,8 @@ HYD_status HYDU_set_common_signals(void (*handler) (int));
/* Sock utilities */
enum HYDU_sock_comm_flag {
HYDU_SOCK_COMM_MSGWAIT = 0x01
HYDU_SOCK_COMM_NONE = 0,
HYDU_SOCK_COMM_MSGWAIT = 1
};
HYD_status HYDU_sock_listen(int *listen_fd, char *port_range, uint16_t * port);
......@@ -259,7 +260,7 @@ HYDU_sock_create_and_listen_portstr(char *port_range, char **port_str,
#define HYDU_FREE(p) \
{ \
HYDU_free(p); \
HYDU_free((void *) p); \
}
#define HYDU_STRLIST_CONSOLIDATE(strlist, i, status) \
......
......@@ -50,12 +50,10 @@ void HYD_pmcd_free_tokens(struct HYD_pmcd_token *tokens, int token_count)
HYDU_FREE(tokens);
}
HYD_status HYD_pmcd_segment_tokens(struct HYD_pmcd_token *tokens, int token_count,
struct HYD_pmcd_token_segment *segment_list,
int *num_segments)
void HYD_pmcd_segment_tokens(struct HYD_pmcd_token *tokens, int token_count,
struct HYD_pmcd_token_segment *segment_list, int *num_segments)
{
int i, j;
HYD_status status = HYD_SUCCESS;
j = 0;
segment_list[j].start_idx = 0;
......@@ -71,12 +69,6 @@ HYD_status HYD_pmcd_segment_tokens(struct HYD_pmcd_token *tokens, int token_coun
}
}
*num_segments = j + 1;
fn_exit:
return status;
fn_fail:
goto fn_exit;
}
char *HYD_pmcd_find_token_keyval(struct HYD_pmcd_token *tokens, int count, const char *key)
......@@ -325,10 +317,6 @@ HYD_status HYD_pmcd_pmi_finalize(void)
HYDU_FUNC_ENTER();
fn_exit:
HYDU_FUNC_EXIT();
return status;
fn_fail:
goto fn_exit;
}
......@@ -74,8 +74,8 @@ struct HYD_pmcd_pmi_pg_scratch {
HYD_status HYD_pmcd_args_to_tokens(char *args[], struct HYD_pmcd_token **tokens, int *count);
void HYD_pmcd_free_tokens(struct HYD_pmcd_token *tokens, int token_count);
HYD_status HYD_pmcd_segment_tokens(struct HYD_pmcd_token *tokens, int token_count,
struct HYD_pmcd_token_segment *segment_list, int *num_segments);
void HYD_pmcd_segment_tokens(struct HYD_pmcd_token *tokens, int token_count,
struct HYD_pmcd_token_segment *segment_list, int *num_segments);
char *HYD_pmcd_find_token_keyval(struct HYD_pmcd_token *tokens, int count, const char *key);
HYD_status HYD_pmcd_pmi_add_process_to_pg(struct HYD_pg *pg, int fd, int rank);
HYD_status HYD_pmcd_pmi_id_to_rank(int id, int pgid, int *rank);
......
......@@ -568,8 +568,7 @@ static HYD_status fn_spawn(int fd, int pgid, char *args[])
HYDU_MALLOC(segment_list, struct HYD_pmcd_token_segment *,
total_spawns * sizeof(struct HYD_pmcd_token_segment), status);
status = HYD_pmcd_segment_tokens(tokens, token_count, segment_list, &num_segments);
HYDU_ERR_POP(status, "unable to segment tokens\n");
HYD_pmcd_segment_tokens(tokens, token_count, segment_list, &num_segments);
if (num_segments != total_spawns) {
/* We didn't read the entire PMI string; wait for the rest to
......
......@@ -95,8 +95,7 @@ int main(int argc, char **argv)
close(HYD_pmcd_pmip.upstream.control);
/* cleanup the params structure for the next job */
status = HYD_pmcd_pmi_proxy_cleanup_params();
HYDU_ERR_POP(status, "unable to cleanup params\n");
HYD_pmcd_pmi_proxy_cleanup_params();
fn_exit:
if (status != HYD_SUCCESS)
......
......@@ -62,7 +62,7 @@ extern struct HYD_pmcd_pmip HYD_pmcd_pmip;
/* utils */
HYD_status HYD_pmcd_pmi_proxy_get_params(char **t_argv);
HYD_status HYD_pmcd_pmi_proxy_cleanup_params(void);
void HYD_pmcd_pmi_proxy_cleanup_params(void);
HYD_status HYD_pmcd_pmi_proxy_procinfo(int fd);
HYD_status HYD_pmcd_pmi_proxy_launch_procs(void);
void HYD_pmcd_pmi_proxy_killjob(void);
......
......@@ -48,10 +48,9 @@ static HYD_status init_params(void)
return status;
}
HYD_status HYD_pmcd_pmi_proxy_cleanup_params(void)
void HYD_pmcd_pmi_proxy_cleanup_params(void)
{
struct HYD_exec *exec, *texec;
HYD_status status = HYD_SUCCESS;
HYDU_FUNC_ENTER();
......@@ -129,12 +128,7 @@ HYD_status HYD_pmcd_pmi_proxy_cleanup_params(void)
HYDT_bind_finalize();
fn_exit:
HYDU_FUNC_EXIT();
return status;
fn_fail:
goto fn_exit;
}
static HYD_status control_port_fn(char *arg, char ***argv)
......
......@@ -10,6 +10,7 @@
#include "pmi_handle_common.h"
#include "pmci.h"
#include "bsci.h"
#include "debugger.h"
#include "pmi_serv.h"
#include "pmi_utils.h"
......
......@@ -150,7 +150,7 @@ HYD_status HYDT_bind_init(char *binding, char *bindlib)
topo_end = HYDT_TOPO_END;
for (i = HYDT_TOPO_MACHINE; i < HYDT_TOPO_END; i++) {
if (use_topo_obj[i] == 0) {
topo_end = i;
topo_end = (HYDT_topo_obj_type_t) i;
break;
}
}
......
......@@ -86,7 +86,8 @@ static HYD_status stdio_cb(int fd, HYD_event_t events, void *userp)
}
else if (fd == private.stdout_fd) {
/* stdout event */
status = HYDU_sock_read(private.stdout_fd, buf, HYD_TMPBUF_SIZE, &count, 0);
status = HYDU_sock_read(private.stdout_fd, buf, HYD_TMPBUF_SIZE, &count,
HYDU_SOCK_COMM_NONE);
HYDU_ERR_POP(status, "error reading stdout from upstream\n");
hdr.io_type = HYDT_PERSIST_STDOUT;
......@@ -111,7 +112,8 @@ static HYD_status stdio_cb(int fd, HYD_event_t events, void *userp)
hdr.io_type = HYDT_PERSIST_STDERR;
hdr.buflen = 0;
status = HYDU_sock_read(private.stderr_fd, buf, HYD_TMPBUF_SIZE, &count, 0);
status = HYDU_sock_read(private.stderr_fd, buf, HYD_TMPBUF_SIZE, &count,
HYDU_SOCK_COMM_NONE);
HYDU_ERR_POP(status, "error reading stdout from upstream\n");
hdr.io_type = HYDT_PERSIST_STDOUT;
......@@ -279,19 +281,9 @@ int main(int argc, char **argv)
if (private.type == SLAVE) {
/* check if all stdio fd's have been deregistered */
status = HYDT_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);
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);
HYDU_ERR_POP(status, "unable to query fd registration from demux engine\n");
if (ret)
if (HYDT_dmx_query_fd_registration(private.stdout_fd) ||
HYDT_dmx_query_fd_registration(private.stderr_fd) ||
HYDT_dmx_query_fd_registration(private.client_fd))
continue;
/* wait for the app process to terminate */
......
......@@ -21,9 +21,7 @@ HYD_status HYDT_bscd_persist_wait_for_completion(int timeout)
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);
HYDU_ERR_POP(status, "unable to query fd registration from demux engine\n");
ret = HYDT_dmx_query_fd_registration(HYDT_bscd_persist_control_fd[i]);
if (ret)
all_done = 0;
}
......
......@@ -19,7 +19,7 @@ HYD_status HYDT_bscu_inter_cb(int fd, HYD_event_t events, void *userp)
/* Get the callback information */
cb = (HYD_status(*)(void *buf, int buflen)) userp;
status = HYDU_sock_read(fd, buf, HYD_TMPBUF_SIZE, &buflen, 0);
status = HYDU_sock_read(fd, buf, HYD_TMPBUF_SIZE, &buflen, HYDU_SOCK_COMM_NONE);
HYDU_ERR_POP(status, "error reading from fd\n");
if (buflen == 0 || (events & HYD_POLLHUP)) {
......
......@@ -32,9 +32,7 @@ HYD_status HYDT_bscu_wait_for_completion(int timeout)
if (HYD_bscu_fd_list[i] == -1)
continue;
status = HYDT_dmx_query_fd_registration(HYD_bscu_fd_list[i], &ret);
HYDU_ERR_POP(status, "unable to query fd registration from demux engine\n");
ret = HYDT_dmx_query_fd_registration(HYD_bscu_fd_list[i]);
if (ret) { /* still registered */
count++; /* We still need to wait */
......
......@@ -36,8 +36,10 @@ HYD_status HYDT_ckpoint_init(char *ckpointlib, char *ckpoint_prefix)
HYDU_FUNC_EXIT();
return status;
#if defined HAVE_BLCR
fn_fail:
goto fn_exit;
#endif /* HAVE_BLCR */
}
HYD_status HYDT_ckpoint_suspend(void)
......
......@@ -152,32 +152,28 @@ HYD_status HYDT_dmx_wait_for_event(int wtime)
return HYDT_dmxu_fns.wait_for_event(wtime);
}
HYD_status HYDT_dmx_query_fd_registration(int fd, int *ret)
int HYDT_dmx_query_fd_registration(int fd)
{
struct HYDT_dmxu_callback *run;
int i;
HYD_status status = HYD_SUCCESS;
int i, ret;
HYDU_FUNC_ENTER();
*ret = 0;
ret = 0;
for (run = HYDT_dmxu_cb_list; run; run = run->next) {
for (i = 0; i < run->num_fds; i++) {
if (run->fd[i] == fd) { /* found it */
*ret = 1;
ret = 1;
break;
}
}
if (*ret)
if (ret)
break;
}
fn_exit:
HYDU_FUNC_EXIT();
return status;
fn_fail:
goto fn_exit;
return ret;
}
HYD_status HYDT_dmx_finalize(void)
......
......@@ -74,13 +74,13 @@ HYD_status HYDT_dmx_finalize(void);
* \brief HYDT_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.
* is. A return value of 1 means that the fd is still registered; 0
* means that it isn't.
*/
HYD_status HYDT_dmx_query_fd_registration(int fd, int *ret);
int HYDT_dmx_query_fd_registration(int fd);
HYD_status HYDT_dmx_stdin_valid(int *out);
......
......@@ -17,10 +17,6 @@ HYD_status HYD_rmku_query_node_list(struct HYD_node **node_list)
/* We don't know anything about nodes or resources */
*node_list = NULL;
fn_exit:
HYDU_FUNC_EXIT();
return status;
fn_fail:
goto fn_exit;
}
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