Skip to content
Snippets Groups Projects
Commit 567cbbc8 authored by Danny Auble's avatar Danny Auble
Browse files

fix for building on aix

parent a79b7948
No related branches found
No related tags found
No related merge requests found
......@@ -527,7 +527,7 @@ typedef struct epilog_complete_msg {
uint32_t job_id;
uint32_t return_code;
char *node_name;
switch_node_info_t switch_nodeinfo;
switch_node_info_t *switch_nodeinfo;
} epilog_complete_msg_t;
typedef struct shutdown_msg {
......@@ -878,7 +878,7 @@ typedef struct slurm_node_registration_status_msg {
uint32_t status; /* node status code, same as return codes */
uint16_t startup; /* slurmd just restarted */
uint32_t up_time; /* seconds since reboot */
switch_node_info_t switch_nodeinfo; /* set only if startup != 0 */
switch_node_info_t *switch_nodeinfo; /* set only if startup != 0 */
} slurm_node_registration_status_msg_t;
......
......@@ -95,14 +95,14 @@ typedef struct slurm_switch_ops {
char * (*switch_strerror) ( int errnum );
int (*switch_errno) ( void );
int (*clear_node) ( void );
int (*alloc_nodeinfo) ( switch_node_info_t *nodeinfo );
int (*build_nodeinfo) ( switch_node_info_t nodeinfo );
int (*pack_nodeinfo) ( switch_node_info_t nodeinfo,
int (*alloc_nodeinfo) ( switch_node_info_t **nodeinfo );
int (*build_nodeinfo) ( switch_node_info_t *nodeinfo );
int (*pack_nodeinfo) ( switch_node_info_t *nodeinfo,
Buf buffer );
int (*unpack_nodeinfo) ( switch_node_info_t nodeinfo,
int (*unpack_nodeinfo) ( switch_node_info_t *nodeinfo,
Buf buffer );
int (*free_nodeinfo) ( switch_node_info_t *nodeinfo );
char * (*sprintf_nodeinfo) ( switch_node_info_t nodeinfo,
int (*free_nodeinfo) ( switch_node_info_t **nodeinfo );
char * (*sprintf_nodeinfo) ( switch_node_info_t *nodeinfo,
char *buf, size_t size );
int (*step_complete) ( switch_jobinfo_t *jobinfo,
char *nodelist );
......@@ -125,14 +125,14 @@ struct slurm_switch_context {
slurm_switch_ops_t ops;
};
static slurm_switch_context_t g_context = NULL;
static slurm_switch_context_t *g_context = NULL;
static pthread_mutex_t context_lock = PTHREAD_MUTEX_INITIALIZER;
static slurm_switch_context_t
static slurm_switch_context_t *
_slurm_switch_context_create(const char *switch_type)
{
slurm_switch_context_t c;
slurm_switch_context_t *c;
if ( switch_type == NULL ) {
debug3( "_slurm_switch_context_create: no switch type" );
......@@ -159,7 +159,7 @@ _slurm_switch_context_create(const char *switch_type)
}
static int
_slurm_switch_context_destroy( slurm_switch_context_t c )
_slurm_switch_context_destroy( slurm_switch_context_t *c )
{
int rc = SLURM_SUCCESS;
/*
......@@ -184,7 +184,7 @@ _slurm_switch_context_destroy( slurm_switch_context_t c )
* Resolve the operations from the plugin.
*/
static slurm_switch_ops_t *
_slurm_switch_get_ops( slurm_switch_context_t c )
_slurm_switch_get_ops( slurm_switch_context_t *c )
{
/*
* These strings must be kept in the same order as the fields
......@@ -510,7 +510,7 @@ extern int switch_g_clear_node_state(void)
return (*(g_context->ops.clear_node))();
}
extern int switch_g_alloc_node_info(switch_node_info_t *switch_node)
extern int switch_g_alloc_node_info(switch_node_info_t **switch_node)
{
if ( switch_init() < 0 )
return SLURM_ERROR;
......@@ -518,7 +518,7 @@ extern int switch_g_alloc_node_info(switch_node_info_t *switch_node)
return (*(g_context->ops.alloc_nodeinfo))( switch_node );
}
extern int switch_g_build_node_info(switch_node_info_t switch_node)
extern int switch_g_build_node_info(switch_node_info_t *switch_node)
{
if ( switch_init() < 0 )
return SLURM_ERROR;
......@@ -526,7 +526,7 @@ extern int switch_g_build_node_info(switch_node_info_t switch_node)
return (*(g_context->ops.build_nodeinfo))( switch_node );
}
extern int switch_g_pack_node_info(switch_node_info_t switch_node,
extern int switch_g_pack_node_info(switch_node_info_t *switch_node,
Buf buffer)
{
if ( switch_init() < 0 )
......@@ -535,7 +535,7 @@ extern int switch_g_pack_node_info(switch_node_info_t switch_node,
return (*(g_context->ops.pack_nodeinfo))( switch_node, buffer );
}
extern int switch_g_unpack_node_info(switch_node_info_t switch_node,
extern int switch_g_unpack_node_info(switch_node_info_t *switch_node,
Buf buffer)
{
if ( switch_init() < 0 )
......@@ -544,7 +544,7 @@ extern int switch_g_unpack_node_info(switch_node_info_t switch_node,
return (*(g_context->ops.unpack_nodeinfo))( switch_node, buffer );
}
extern int switch_g_free_node_info(switch_node_info_t *switch_node)
extern int switch_g_free_node_info(switch_node_info_t **switch_node)
{
if ( switch_init() < 0 )
return SLURM_ERROR;
......@@ -552,7 +552,7 @@ extern int switch_g_free_node_info(switch_node_info_t *switch_node)
return (*(g_context->ops.free_nodeinfo))( switch_node );
}
extern char*switch_g_sprintf_node_info(switch_node_info_t switch_node,
extern char*switch_g_sprintf_node_info(switch_node_info_t *switch_node,
char *buf, size_t size)
{
if ( switch_init() < 0 )
......
......@@ -54,13 +54,13 @@
/* opaque data structures - no peeking! */
#ifndef __switch_jobinfo_t_defined
# define __switch_jobinfo_t_defined
typedef struct switch_jobinfo *switch_jobinfo_t;
typedef struct switch_jobinfo switch_jobinfo_t;
#endif
#ifndef __switch_node_info_t_defined
# define __switch_node_info_t_defined
typedef struct switch_node_info *switch_node_info_t;
typedef struct switch_node_info switch_node_info_t;
#endif
typedef struct slurm_switch_context * slurm_switch_context_t;
typedef struct slurm_switch_context slurm_switch_context_t;
/*****************************************\
* GLOBAL SWITCH STATE MANGEMENT FUNCIONS *
......@@ -314,37 +314,37 @@ extern int switch_g_slurmd_step_init(void);
/*
* Allocate storage for a node's switch state record
*/
extern int switch_g_alloc_node_info(switch_node_info_t *switch_node);
extern int switch_g_alloc_node_info(switch_node_info_t **switch_node);
/*
* Fill in a previously allocated switch state record for the node on which
* this function is executed.
*/
extern int switch_g_build_node_info(switch_node_info_t switch_node);
extern int switch_g_build_node_info(switch_node_info_t *switch_node);
/*
* Pack the data associated with a node's switch state into a buffer
* for network transmission.
*/
extern int switch_g_pack_node_info(switch_node_info_t switch_node,
extern int switch_g_pack_node_info(switch_node_info_t *switch_node,
Buf buffer);
/*
* Unpack the data associated with a node's switch state record
* from a buffer.
*/
extern int switch_g_unpack_node_info(switch_node_info_t switch_node,
extern int switch_g_unpack_node_info(switch_node_info_t *switch_node,
Buf buffer);
/*
* Release the storage associated with a node's switch state record.
*/
extern int switch_g_free_node_info(switch_node_info_t *switch_node);
extern int switch_g_free_node_info(switch_node_info_t **switch_node);
/*
* Print the contents of a node's switch state record to a buffer.
*/
extern char*switch_g_sprintf_node_info(switch_node_info_t switch_node,
extern char*switch_g_sprintf_node_info(switch_node_info_t *switch_node,
char *buf, size_t size);
#endif /* _SWITCH_H */
......@@ -318,12 +318,12 @@ int switch_p_clear_node_state(void)
return SLURM_SUCCESS;
}
int switch_p_alloc_node_info(switch_node_info_t *switch_node)
int switch_p_alloc_node_info(switch_node_info_t **switch_node)
{
return fed_alloc_nodeinfo((fed_nodeinfo_t **)switch_node);
}
int switch_p_build_node_info(switch_node_info_t switch_node)
int switch_p_build_node_info(switch_node_info_t *switch_node)
{
char hostname[256];
char *tmp;
......@@ -337,23 +337,23 @@ int switch_p_build_node_info(switch_node_info_t switch_node)
return fed_build_nodeinfo((fed_nodeinfo_t *)switch_node, hostname);
}
int switch_p_pack_node_info(switch_node_info_t switch_node, Buf buffer)
int switch_p_pack_node_info(switch_node_info_t *switch_node, Buf buffer)
{
return fed_pack_nodeinfo((fed_nodeinfo_t *)switch_node, buffer);
}
int switch_p_unpack_node_info(switch_node_info_t switch_node, Buf buffer)
int switch_p_unpack_node_info(switch_node_info_t *switch_node, Buf buffer)
{
return fed_unpack_nodeinfo((fed_nodeinfo_t *)switch_node, buffer);
}
void switch_p_free_node_info(switch_node_info_t *switch_node)
void switch_p_free_node_info(switch_node_info_t **switch_node)
{
if(switch_node)
fed_free_nodeinfo((fed_nodeinfo_t *)*switch_node, false);
}
char * switch_p_sprintf_node_info(switch_node_info_t switch_node,
char * switch_p_sprintf_node_info(switch_node_info_t *switch_node,
char *buf, size_t size)
{
return fed_print_nodeinfo((fed_nodeinfo_t *)switch_node, buf, size);
......@@ -447,7 +447,7 @@ switch_jobinfo_t *switch_p_copy_jobinfo(switch_jobinfo_t *switch_job)
{
switch_jobinfo_t *j;
j = (switch_jobinfo_t)fed_copy_jobinfo((fed_jobinfo_t *)switch_job);
j = (switch_jobinfo_t *)fed_copy_jobinfo((fed_jobinfo_t *)switch_job);
if (!j)
error("fed_copy_jobinfo failed");
......
......@@ -242,34 +242,34 @@ extern int switch_p_clear_node_state(void)
return SLURM_SUCCESS;
}
extern int switch_p_alloc_node_info(switch_node_info_t *switch_node)
extern int switch_p_alloc_node_info(switch_node_info_t **switch_node)
{
return SLURM_SUCCESS;
}
extern int switch_p_build_node_info(switch_node_info_t switch_node)
extern int switch_p_build_node_info(switch_node_info_t *switch_node)
{
return SLURM_SUCCESS;
}
extern int switch_p_pack_node_info(switch_node_info_t switch_node,
extern int switch_p_pack_node_info(switch_node_info_t *switch_node,
Buf buffer)
{
return 0;
}
extern int switch_p_unpack_node_info(switch_node_info_t switch_node,
extern int switch_p_unpack_node_info(switch_node_info_t *switch_node,
Buf buffer)
{
return SLURM_SUCCESS;
}
extern int switch_p_free_node_info(switch_node_info_t *switch_node)
extern int switch_p_free_node_info(switch_node_info_t **switch_node)
{
return SLURM_SUCCESS;
}
extern char*switch_p_sprintf_node_info(switch_node_info_t switch_node,
extern char*switch_p_sprintf_node_info(switch_node_info_t *switch_node,
char *buf, size_t size)
{
if ((buf != NULL) && size) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment