Commit 35929ad8 authored by Pavan Balaji's avatar Pavan Balaji
Browse files

[svn-r6576] Make __VA_ARGS__ a requirement for Hydra.

parent 1ed50be2
......@@ -542,10 +542,10 @@ int main()
EOF
pac_tmp_compile='$CC $CFLAGS conftest.c -o conftest'
if AC_TRY_EVAL(pac_tmp_compile) && test -s conftest ; then
AC_DEFINE(COMPILER_ACCEPTS_VA_ARGS,1,[Define if compiler supports __VA_ARGS__])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
AC_ERROR([Hydra needs a compiler that supports __VA_ARGS__])
fi
rm -f conftest*
......
......@@ -10,6 +10,26 @@
#include "hydra_base.h"
#include "mpl.h"
extern char *HYD_dbg_prefix;
#define HYDU_dump_prefix(fp) \
{ \
fprintf(fp, "[%s] ", HYD_dbg_prefix); \
fflush(fp); \
}
#define HYDU_dump_noprefix(fp, ...) \
{ \
fprintf(fp, __VA_ARGS__); \
fflush(fp); \
}
#define HYDU_dump(fp, ...) \
{ \
HYDU_dump_prefix(fp); \
HYDU_dump_noprefix(fp, __VA_ARGS__); \
}
#if defined HAVE__FUNC__
#define HYDU_FUNC __func__
#elif defined HAVE_CAP__FUNC__
......@@ -18,9 +38,7 @@
#define HYDU_FUNC __FUNCTION__
#endif
#if !defined COMPILER_ACCEPTS_VA_ARGS
#define HYDU_error_printf printf
#elif defined __FILE__ && defined HYDU_FUNC
#if defined __FILE__ && defined HYDU_FUNC
#define HYDU_error_printf(...) \
{ \
HYDU_dump_prefix(stderr); \
......@@ -45,7 +63,7 @@
#define HYDU_ASSERT(x, status) \
{ \
if (!(x)) { \
HYDU_ERR_SETANDJUMP1(status, HYD_INTERNAL_ERROR, \
HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR, \
"assert (%s) failed\n", #x); \
} \
}
......@@ -56,48 +74,10 @@
(status) = HYD_SUCCESS; \
}
#define HYDU_ERR_POP(status, message) \
{ \
if (status && !HYD_SILENT_ERROR(status)) { \
if (strlen(message)) \
HYDU_error_printf(message); \
goto fn_fail; \
} \
else if (HYD_SILENT_ERROR(status)) { \
goto fn_exit; \
} \
}
#define HYDU_ERR_POP1(status, message, arg1) \
{ \
if (status && !HYD_SILENT_ERROR(status)) { \
if (strlen(message)) \
HYDU_error_printf(message, arg1); \
goto fn_fail; \
} \
else if (HYD_SILENT_ERROR(status)) { \
goto fn_exit; \
} \
}
#define HYDU_ERR_POP2(status, message, arg1, arg2) \
{ \
if (status && !HYD_SILENT_ERROR(status)) { \
if (strlen(message)) \
HYDU_error_printf(message, arg1, arg2); \
goto fn_fail; \
} \
else if (HYD_SILENT_ERROR(status)) { \
goto fn_exit; \
} \
}
#define HYDU_ERR_SETANDJUMP(status, error, message) \
#define HYDU_ERR_POP(status, ...) \
{ \
status = error; \
if (status && !HYD_SILENT_ERROR(status)) { \
if (strlen(message)) \
HYDU_error_printf(message); \
HYDU_error_printf(__VA_ARGS__); \
goto fn_fail; \
} \
else if (HYD_SILENT_ERROR(status)) { \
......@@ -105,42 +85,16 @@
} \
}
#define HYDU_ERR_SETANDJUMP1(status, error, message, arg1) \
#define HYDU_ERR_SETANDJUMP(status, error, ...) \
{ \
status = error; \
if (status && !HYD_SILENT_ERROR(status)) { \
if (strlen(message)) \
HYDU_error_printf(message, arg1); \
goto fn_fail; \
} \
else if (HYD_SILENT_ERROR(status)) { \
goto fn_exit; \
} \
}
#define HYDU_ERR_SETANDJUMP2(status, error, message, arg1, arg2) \
{ \
status = error; \
if (status && !HYD_SILENT_ERROR(status)) { \
if (strlen(message)) \
HYDU_error_printf(message, arg1, arg2); \
goto fn_fail; \
} \
else if (HYD_SILENT_ERROR(status)) { \
goto fn_exit; \
} \
}
#define HYDU_ERR_CHKANDJUMP(status, chk, error, message) \
{ \
if ((chk)) \
HYDU_ERR_SETANDJUMP(status, error, message); \
HYDU_ERR_POP(status, __VA_ARGS__); \
}
#define HYDU_ERR_CHKANDJUMP1(status, chk, error, message, arg1) \
#define HYDU_ERR_CHKANDJUMP(status, chk, error, ...) \
{ \
if ((chk)) \
HYDU_ERR_SETANDJUMP1(status, error, message, arg1); \
HYDU_ERR_SETANDJUMP(status, error, __VA_ARGS__); \
}
#if defined ENABLE_WARNINGS || !defined COMPILER_ACCEPTS_VA_ARGS
......@@ -185,9 +139,6 @@ HYD_status HYDU_send_strlist(int fd, char **strlist);
/* debug */
HYD_status HYDU_dbg_init(const char *str);
void HYDU_dump_prefix(FILE * fp);
void HYDU_dump_noprefix(FILE * fp, const char *str, ...);
void HYDU_dump(FILE * fp, const char *str, ...);
void HYDU_dbg_finalize(void);
/* env */
......@@ -286,9 +237,9 @@ HYD_status HYDU_sock_cloexec(int fd);
{ \
(p) = (type) HYDU_malloc((size)); \
if ((p) == NULL) \
HYDU_ERR_SETANDJUMP1((status), HYD_NO_MEM, \
"failed to allocate %d bytes\n", \
(size)); \
HYDU_ERR_SETANDJUMP((status), HYD_NO_MEM, \
"failed to allocate %d bytes\n", \
(int) (size)); \
}
#define HYDU_FREE(p) \
......
......@@ -11,6 +11,7 @@
#include "bind.h"
struct HYD_pmcd_pmip HYD_pmcd_pmip;
char *HYD_dbg_prefix = (char *) "unknown";
static HYD_status init_params(void)
{
......@@ -195,7 +196,7 @@ int main(int argc, char **argv)
status = HYDU_sock_connect(HYD_pmcd_pmip.upstream.server_name,
HYD_pmcd_pmip.upstream.server_port,
&HYD_pmcd_pmip.upstream.control);
HYDU_ERR_POP2(status, "unable to connect to server %s at port %d\n",
HYDU_ERR_POP(status, "unable to connect to server %s at port %d\n",
HYD_pmcd_pmip.upstream.server_name, HYD_pmcd_pmip.upstream.server_port);
}
......
......@@ -595,9 +595,9 @@ static HYD_status launch_procs(void)
}
if (exec->wdir && chdir(exec->wdir) < 0)
HYDU_ERR_SETANDJUMP2(status, HYD_INTERNAL_ERROR,
"unable to change wdir to %s (%s)\n", exec->wdir,
HYDU_strerror(errno));
HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR,
"unable to change wdir to %s (%s)\n", exec->wdir,
HYDU_strerror(errno));
for (i = 0; i < exec->proc_count; i++) {
......
......@@ -103,8 +103,8 @@ static HYD_status fn_init(int fd, char *args[])
else if (pmi_version == 2 && pmi_subversion == 0)
tmp = HYDU_strdup("cmd=response_to_init pmi_version=2 pmi_subversion=0 rc=0\n");
else /* PMI version mismatch */
HYDU_ERR_SETANDJUMP2(status, HYD_INTERNAL_ERROR,
"PMI version mismatch; %d.%d\n", pmi_version, pmi_subversion);
HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR,
"PMI version mismatch; %d.%d\n", pmi_version, pmi_subversion);
status = send_cmd_downstream(fd, tmp);
HYDU_ERR_POP(status, "error sending PMI response\n");
......
......@@ -48,8 +48,8 @@ static HYD_status handle_pmi_cmd(int fd, int pgid, int pid, char *buf, int pmi_v
}
if (!h->handler) {
/* We don't understand the command */
HYDU_ERR_SETANDJUMP1(status, HYD_INTERNAL_ERROR,
"Unrecognized PMI command: %s | cleaning up processes\n", cmd);
HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR,
"Unrecognized PMI command: %s | cleaning up processes\n", cmd);
}
fn_exit:
......@@ -241,7 +241,7 @@ static HYD_status control_cb(int fd, HYD_event_t events, void *userp)
HYDU_FREE(buf);
}
else {
HYDU_ERR_SETANDJUMP1(status, HYD_INTERNAL_ERROR, "unhandled command = %d\n", cmd);
HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR, "unhandled command = %d\n", cmd);
}
fn_exit:
......@@ -301,16 +301,16 @@ HYD_status HYD_pmcd_pmiserv_proxy_init_cb(int fd, HYD_event_t events, void *user
if (pg->pgid == pgid)
break;
if (!pg)
HYDU_ERR_SETANDJUMP1(status, HYD_INTERNAL_ERROR, "could not find pg with ID %d\n",
pgid);
HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR, "could not find pg with ID %d\n",
pgid);
/* Find the proxy */
for (proxy = pg->proxy_list; proxy; proxy = proxy->next) {
if (proxy->proxy_id == proxy_id)
break;
}
HYDU_ERR_CHKANDJUMP1(status, proxy == NULL, HYD_INTERNAL_ERROR,
"cannot find proxy with ID %d\n", proxy_id);
HYDU_ERR_CHKANDJUMP(status, proxy == NULL, HYD_INTERNAL_ERROR,
"cannot find proxy with ID %d\n", proxy_id);
/* This will be the control socket for this proxy */
proxy->control_fd = fd;
......@@ -350,8 +350,8 @@ HYD_status HYD_pmcd_pmiserv_control_listen_cb(int fd, HYD_event_t events, void *
if (pg->pgid == pgid)
break;
if (!pg)
HYDU_ERR_SETANDJUMP1(status, HYD_INTERNAL_ERROR, "could not find pg with ID %d\n",
pgid);
HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR, "could not find pg with ID %d\n",
pgid);
pg_scratch = (struct HYD_pmcd_pmi_pg_scratch *) pg->pg_scratch;
pg_scratch->control_listen_fd = fd;
......
......@@ -120,9 +120,9 @@ static HYD_status fn_put(int fd, int pid, int pgid, char *args[])
pg_scratch = (struct HYD_pmcd_pmi_pg_scratch *) proxy->pg->pg_scratch;
if (strcmp(pg_scratch->kvs->kvs_name, kvsname))
HYDU_ERR_SETANDJUMP2(status, HYD_INTERNAL_ERROR,
"kvsname (%s) does not match this group's kvs space (%s)\n",
kvsname, pg_scratch->kvs->kvs_name);
HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR,
"kvsname (%s) does not match this group's kvs space (%s)\n",
kvsname, pg_scratch->kvs->kvs_name);
status = HYD_pmcd_pmi_add_kvs(key, val, pg_scratch->kvs, &ret);
HYDU_ERR_POP(status, "unable to add keypair to kvs\n");
......@@ -188,9 +188,9 @@ static HYD_status fn_get(int fd, int pid, int pgid, char *args[])
pg_scratch = (struct HYD_pmcd_pmi_pg_scratch *) proxy->pg->pg_scratch;
if (strcmp(pg_scratch->kvs->kvs_name, kvsname))
HYDU_ERR_SETANDJUMP2(status, HYD_INTERNAL_ERROR,
"kvsname (%s) does not match this group's kvs space (%s)\n",
kvsname, pg_scratch->kvs->kvs_name);
HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR,
"kvsname (%s) does not match this group's kvs space (%s)\n",
kvsname, pg_scratch->kvs->kvs_name);
/* Try to find the key */
found = 0;
......@@ -388,15 +388,15 @@ static HYD_status fn_spawn(int fd, int pid, int pgid, char *args[])
HYDU_snprintf(key, MAXKEYLEN, "info_key_%d", i);
val = HYD_pmcd_pmi_find_token_keyval(&tokens[segment_list[j].start_idx],
segment_list[j].token_count, key);
HYDU_ERR_CHKANDJUMP1(status, val == NULL, HYD_INTERNAL_ERROR,
"unable to find token: %s\n", key);
HYDU_ERR_CHKANDJUMP(status, val == NULL, HYD_INTERNAL_ERROR,
"unable to find token: %s\n", key);
info_key = val;
HYDU_snprintf(key, MAXKEYLEN, "info_val_%d", i);
val = HYD_pmcd_pmi_find_token_keyval(&tokens[segment_list[j].start_idx],
segment_list[j].token_count, key);
HYDU_ERR_CHKANDJUMP1(status, val == NULL, HYD_INTERNAL_ERROR,
"unable to find token: %s\n", key);
HYDU_ERR_CHKANDJUMP(status, val == NULL, HYD_INTERNAL_ERROR,
"unable to find token: %s\n", key);
info_val = val;
if (!strcmp(info_key, "path")) {
......@@ -408,8 +408,8 @@ static HYD_status fn_spawn(int fd, int pid, int pgid, char *args[])
else {
/* FIXME: Unrecognized info key; what should we do
* here? Abort? */
HYDU_ERR_SETANDJUMP1(status, HYD_INTERNAL_ERROR, "unrecognized info key: %s\n",
info_key);
HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR, "unrecognized info key: %s\n",
info_key);
}
}
......@@ -441,8 +441,8 @@ static HYD_status fn_spawn(int fd, int pid, int pgid, char *args[])
HYDU_snprintf(key, MAXKEYLEN, "arg%d", k + 1);
val = HYD_pmcd_pmi_find_token_keyval(&tokens[segment_list[j].start_idx],
segment_list[j].token_count, key);
HYDU_ERR_CHKANDJUMP1(status, val == NULL, HYD_INTERNAL_ERROR,
"unable to find token: %s\n", key);
HYDU_ERR_CHKANDJUMP(status, val == NULL, HYD_INTERNAL_ERROR,
"unable to find token: %s\n", key);
exec->exec[i++] = HYDU_strdup(val);
HYDU_FREE(key);
}
......@@ -478,14 +478,14 @@ static HYD_status fn_spawn(int fd, int pid, int pgid, char *args[])
HYDU_MALLOC(key, char *, MAXKEYLEN, status);
HYDU_snprintf(key, MAXKEYLEN, "preput_key_%d", i);
val = HYD_pmcd_pmi_find_token_keyval(tokens, token_count, key);
HYDU_ERR_CHKANDJUMP1(status, val == NULL, HYD_INTERNAL_ERROR,
"unable to find token: %s\n", key);
HYDU_ERR_CHKANDJUMP(status, val == NULL, HYD_INTERNAL_ERROR,
"unable to find token: %s\n", key);
preput_key = val;
HYDU_snprintf(key, HYD_TMP_STRLEN, "preput_val_%d", i);
val = HYD_pmcd_pmi_find_token_keyval(tokens, token_count, key);
HYDU_ERR_CHKANDJUMP1(status, val == NULL, HYD_INTERNAL_ERROR,
"unable to find token: %s\n", key);
HYDU_ERR_CHKANDJUMP(status, val == NULL, HYD_INTERNAL_ERROR,
"unable to find token: %s\n", key);
preput_val = val;
HYDU_FREE(key);
......
......@@ -571,15 +571,15 @@ static HYD_status fn_spawn(int fd, int pid, int pgid, char *args[])
HYDU_snprintf(key, MAXKEYLEN, "infokey%d", i);
val = HYD_pmcd_pmi_find_token_keyval(&tokens[segment_list[j].start_idx],
segment_list[j].token_count, key);
HYDU_ERR_CHKANDJUMP1(status, val == NULL, HYD_INTERNAL_ERROR,
"unable to find token: %s\n", key);
HYDU_ERR_CHKANDJUMP(status, val == NULL, HYD_INTERNAL_ERROR,
"unable to find token: %s\n", key);
info_key = val;
HYDU_snprintf(key, MAXKEYLEN, "infoval%d", i);
val = HYD_pmcd_pmi_find_token_keyval(&tokens[segment_list[j].start_idx],
segment_list[j].token_count, key);
HYDU_ERR_CHKANDJUMP1(status, val == NULL, HYD_INTERNAL_ERROR,
"unable to find token: %s\n", key);
HYDU_ERR_CHKANDJUMP(status, val == NULL, HYD_INTERNAL_ERROR,
"unable to find token: %s\n", key);
info_val = val;
if (!strcmp(info_key, "path")) {
......@@ -591,8 +591,8 @@ static HYD_status fn_spawn(int fd, int pid, int pgid, char *args[])
else {
/* FIXME: Unrecognized info key; what should we do
* here? Abort? */
HYDU_ERR_SETANDJUMP1(status, HYD_INTERNAL_ERROR, "unrecognized info key: %s\n",
info_key);
HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR, "unrecognized info key: %s\n",
info_key);
}
}
......@@ -624,8 +624,8 @@ static HYD_status fn_spawn(int fd, int pid, int pgid, char *args[])
HYDU_snprintf(key, MAXKEYLEN, "argv%d", k);
val = HYD_pmcd_pmi_find_token_keyval(&tokens[segment_list[j].start_idx],
segment_list[j].token_count, key);
HYDU_ERR_CHKANDJUMP1(status, val == NULL, HYD_INTERNAL_ERROR,
"unable to find token: %s\n", key);
HYDU_ERR_CHKANDJUMP(status, val == NULL, HYD_INTERNAL_ERROR,
"unable to find token: %s\n", key);
exec->exec[i++] = HYDU_strdup(val);
HYDU_FREE(key);
}
......@@ -661,14 +661,14 @@ static HYD_status fn_spawn(int fd, int pid, int pgid, char *args[])
HYDU_MALLOC(key, char *, MAXKEYLEN, status);
HYDU_snprintf(key, MAXKEYLEN, "ppkey%d", i);
val = HYD_pmcd_pmi_find_token_keyval(tokens, token_count, key);
HYDU_ERR_CHKANDJUMP1(status, val == NULL, HYD_INTERNAL_ERROR,
"unable to find token: %s\n", key);
HYDU_ERR_CHKANDJUMP(status, val == NULL, HYD_INTERNAL_ERROR,
"unable to find token: %s\n", key);
preput_key = val;
HYDU_snprintf(key, HYD_TMP_STRLEN, "ppval%d", i);
val = HYD_pmcd_pmi_find_token_keyval(tokens, token_count, key);
HYDU_ERR_CHKANDJUMP1(status, val == NULL, HYD_INTERNAL_ERROR,
"unable to find token: %s\n", key);
HYDU_ERR_CHKANDJUMP(status, val == NULL, HYD_INTERNAL_ERROR,
"unable to find token: %s\n", key);
preput_val = val;
HYDU_FREE(key);
......
......@@ -8,6 +8,7 @@
#include "hydra_utils.h"
#include "persist_server.h"
char *HYD_dbg_prefix = (char *) "unknown";
struct HYDT_persist_handle HYDT_persist_handle;
static struct {
enum {
......@@ -79,8 +80,8 @@ static HYD_status stdio_cb(int fd, HYD_event_t events, void *userp)
if (closed) {
status = HYDT_dmx_deregister_fd(private.client_fd);
HYDU_ERR_SETANDJUMP1(status, status, "error deregistering fd %d\n",
private.client_fd);
HYDU_ERR_SETANDJUMP(status, status, "error deregistering fd %d\n",
private.client_fd);
close(private.client_fd);
}
}
......@@ -105,8 +106,8 @@ static HYD_status stdio_cb(int fd, HYD_event_t events, void *userp)
}
else {
status = HYDT_dmx_deregister_fd(private.stdout_fd);
HYDU_ERR_SETANDJUMP1(status, status, "error deregistering fd %d\n",
private.stdout_fd);
HYDU_ERR_SETANDJUMP(status, status, "error deregistering fd %d\n",
private.stdout_fd);
close(private.stdout_fd);
}
}
......@@ -134,8 +135,8 @@ static HYD_status stdio_cb(int fd, HYD_event_t events, void *userp)
}
else {
status = HYDT_dmx_deregister_fd(private.stderr_fd);
HYDU_ERR_SETANDJUMP1(status, status, "error deregistering fd %d\n",
private.stderr_fd);
HYDU_ERR_SETANDJUMP(status, status, "error deregistering fd %d\n",
private.stderr_fd);
close(private.stderr_fd);
}
}
......
......@@ -51,8 +51,8 @@ HYD_status HYDT_bsci_init(const char *user_bootstrap, const char *user_bootstrap
HYDT_bsci_info.debug = debug;
if (HYDT_bsci_comp_array[i] == NULL)
HYDU_ERR_SETANDJUMP1(status, HYD_INTERNAL_ERROR,
"unrecognized bootstrap server: %s\n", bootstrap);
HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR,
"unrecognized bootstrap server: %s\n", bootstrap);
/* This function is mandatory */
if (HYDT_bsci_fns.launch_procs == NULL)
......
......@@ -25,7 +25,7 @@ HYD_status HYDT_bscu_inter_cb(int fd, HYD_event_t events, void *userp)
if (closed || (events & HYD_POLLHUP)) {
/* connection has closed */
status = HYDT_dmx_deregister_fd(fd);
HYDU_ERR_SETANDJUMP1(status, status, "error deregistering fd %d\n", fd);
HYDU_ERR_SETANDJUMP(status, status, "error deregistering fd %d\n", fd);
for (i = 0; i < HYD_bscu_fd_count; i++) {
if (HYD_bscu_fd_list[i] == fd) {
......@@ -64,7 +64,7 @@ HYD_status HYDT_bscu_stdin_cb(int fd, HYD_event_t events, void *userp)
if (closed || (events & HYD_POLLHUP)) {
status = HYDT_dmx_deregister_fd(fd);
HYDU_ERR_SETANDJUMP1(status, status, "error deregistering fd %d\n", fd);
HYDU_ERR_SETANDJUMP(status, status, "error deregistering fd %d\n", fd);
for (i = 0; i < HYD_bscu_fd_count; i++) {
if (HYD_bscu_fd_list[i] == fd) {
......
......@@ -45,12 +45,12 @@ static HYD_status create_fifo(const char *fname_template, int rank, int *fd)
snprintf(filename, sizeof(filename), fname_template, (int) getpid(), rank);
ret = mkfifo(filename, 0600);
HYDU_ERR_CHKANDJUMP1(status, ret, HYD_INTERNAL_ERROR, "mkfifo failed: %s\n",
strerror(errno));
HYDU_ERR_CHKANDJUMP(status, ret, HYD_INTERNAL_ERROR, "mkfifo failed: %s\n",
strerror(errno));
*fd = open(filename, O_RDWR);
HYDU_ERR_CHKANDJUMP1(status, *fd < 0, HYD_INTERNAL_ERROR, "open failed: %s\n",
strerror(errno));
HYDU_ERR_CHKANDJUMP(status, *fd < 0, HYD_INTERNAL_ERROR, "open failed: %s\n",
strerror(errno));
fn_exit:
HYDU_FUNC_EXIT();
......@@ -110,16 +110,16 @@ static HYD_status create_env_file(const struct HYD_env *envlist, int num_ranks,
ranks[r]);
f = fopen(filename, "w");
HYDU_ERR_CHKANDJUMP1(status, f == NULL, HYD_INTERNAL_ERROR, "fopen failed: %s\n",
strerror(errno));
HYDU_ERR_CHKANDJUMP(status, f == NULL, HYD_INTERNAL_ERROR, "fopen failed: %s\n",
strerror(errno));
for (e = envlist; e; e = e->next) {
fprintf(f, "%s=%s\n", e->env_name, e->env_value);
}
ret = fclose(f);
HYDU_ERR_CHKANDJUMP1(status, ret, HYD_INTERNAL_ERROR, "fclose failed: %s\n",
strerror(errno));
HYDU_ERR_CHKANDJUMP(status, ret, HYD_INTERNAL_ERROR, "fclose failed: %s\n",
strerror(errno));
}
fn_exit:
......@@ -149,8 +149,8 @@ HYD_status HYDT_ckpoint_blcr_suspend(const char *prefix)
/* open the checkpoint file */
fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC /* | O_LARGEFILE */ , 0600);
HYDU_ERR_CHKANDJUMP1(status, fd < 0, HYD_INTERNAL_ERROR, "open failed: %s\n",
strerror(errno));
HYDU_ERR_CHKANDJUMP(status, fd < 0, HYD_INTERNAL_ERROR, "open failed: %s\n",
strerror(errno));
cr_initialize_checkpoint_args_t(&my_args);
my_args.cr_fd = fd;
......@@ -159,10 +159,10 @@ HYD_status HYDT_ckpoint_blcr_suspend(const char *prefix)
/* issue the request */
ret = cr_request_checkpoint(&my_args, &my_handle);
if (ret < 0) {
HYDU_ERR_CHKANDJUMP1(status, errno == CR_ENOSUPPORT, HYD_INTERNAL_ERROR,
"cr_request_checkpoint failed, %s\n", strerror(errno));
HYDU_ERR_SETANDJUMP1(status, HYD_INTERNAL_ERROR, "cr_request_checkpoint failed, %s\n",
strerror(errno));
HYDU_ERR_CHKANDJUMP(status, errno == CR_ENOSUPPORT, HYD_INTERNAL_ERROR,
"cr_request_checkpoint failed, %s\n", strerror(errno));
HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR, "cr_request_checkpoint failed, %s\n",
strerror(errno));
}
/* wait for the request to complete */
while (0) {
......@@ -176,8 +176,8 @@ HYD_status HYDT_ckpoint_blcr_suspend(const char *prefix)
/* poll was interrupted by a signal -- retry */
}
else {
HYDU_ERR_SETANDJUMP1(status, HYD_INTERNAL_ERROR,
"cr_poll_checkpoint failed: %s\n", strerror(errno));
HYDU_ERR_SETANDJUMP(status, HYD_INTERNAL_ERROR,
"cr_poll_checkpoint failed: %s\n", strerror(errno));
}
}
else if (ret == 0) {
......@@ -190,8 +190,8 @@ HYD_status HYDT_ckpoint_blcr_suspend(const char *prefix)
}
ret = close(my_args.cr_fd);
HYDU_ERR_CHKANDJUMP1(status, ret, HYD_INTERNAL_ERROR, "close failed, %s\n",
strerror(errno));
HYDU_ERR_CHKANDJUMP(status, ret, HYD_INTERNAL_ERROR, "close failed, %s\n",
strerror(errno));
fn_exit:
HYDU_FUNC_EXIT();
......@@ -227,8 +227,8 @@ HYD_status HYDT_ckpoint_blcr_restart(const char *prefix, struct HYD_env *envlist
snprintf(filename, sizeof(filename), "%s/context", prefix);
context_fd = open(filename, O_RDONLY /* | O_LARGEFILE */);
HYDU_ERR_CHKANDJUMP1(status, context_fd < 0, HYD_INTERNAL_ERROR, "open failed, %s\n",
strerror(errno));
HYDU_ERR_CHKANDJUMP(status, context_fd < 0, HYD_INTERNAL_ERROR, "open failed, %s\n",
strerror(errno));
/* ... initialize the request structure */
cr_initialize_restart_args_t(&args);
......@@ -237,12 +237,12 @@ HYD_status HYDT_ckpoint_blcr_restart(const char *prefix, struct HYD_env *envlist
/* ... issue the request */
ret = cr_request_restart(&args, &cr_handle);
HYDU_ERR_CHKANDJUMP1(status, ret, HYD_INTERNAL_ERROR, "cr_request_restart failed, %s\n",
strerror(errno));
HYDU_ERR_CHKANDJUMP(status, ret, HYD_INTERNAL_ERROR, "cr_request_restart failed, %s\n",
strerror(errno));
ret = close(context_fd);
HYDU_ERR_CHKANDJUMP1(status, ret, HYD_INTERNAL_ERROR, "close failed, %s\n",
strerror(errno));
HYDU_ERR_CHKANDJUMP(status, ret, HYD_INTERNAL_ERROR, "close failed, %s\n",
strerror(errno));
fn_exit:
HYDU_FUNC_EXIT();
......
......@@ -68,14 +68,14 @@ HYD_status HYDT_dmx_register_fd(int num_fds, int *fd, HYD_event_t events, void *
#if defined HAVE_ERROR_CHECKING
for (i = 0; i<