From 6773c8a6a4a642624c7a461550c0214ae753173f Mon Sep 17 00:00:00 2001 From: tewk <tewk@unknown> Date: Thu, 25 Jul 2002 00:38:21 +0000 Subject: [PATCH] changed all info and debug calls to error calls --- src/common/slurm_protocol_api.c | 22 ++++++++-------- src/common/slurm_protocol_pack.c | 2 +- .../slurm_protocol_socket_implementation.c | 26 +++++++++---------- src/common/slurm_protocol_util.c | 4 +-- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/common/slurm_protocol_api.c b/src/common/slurm_protocol_api.c index 55c617a9e74..632726b56f0 100644 --- a/src/common/slurm_protocol_api.c +++ b/src/common/slurm_protocol_api.c @@ -90,7 +90,7 @@ int read_slurm_port_config ( ) slurm_spec_file = fopen (SLURM_CONFIG_FILE, "r"); if (slurm_spec_file == NULL) { - fprintf (stderr, "read_slurm_conf error %d opening file %s", + error ( "read_slurm_conf error %d opening file %s", errno, SLURM_CONFIG_FILE); exit (1); } @@ -223,11 +223,11 @@ slurm_fd slurm_open_controller_conn ( ) /* try to send to primary first then secondary */ if ( ( connection_fd = slurm_open_msg_conn ( & proto_conf -> primary_controller ) ) == SLURM_SOCKET_ERROR ) { - info ( "Send message to primary controller failed" ) ; + error ( "Send message to primary controller failed" ) ; if ( ( connection_fd = slurm_open_msg_conn ( & proto_conf -> secondary_controller ) ) == SLURM_SOCKET_ERROR ) { - info ( "Send messge to secondary controller failed" ) ; + error ( "Send messge to secondary controller failed" ) ; } } return connection_fd ; @@ -272,7 +272,7 @@ int slurm_receive_msg ( slurm_fd open_fd , slurm_msg_t * msg ) if ( ( rc = _slurm_msg_recvfrom ( open_fd , buffer , receive_len, SLURM_PROTOCOL_NO_SEND_RECV_FLAGS , & (msg)->address ) ) == SLURM_SOCKET_ERROR ) { - info ( "Error receiving msg socket: errno %i", errno ) ; + error ( "Error receiving msg socket: errno %i", errno ) ; return rc ; } @@ -306,11 +306,11 @@ int slurm_send_controller_msg ( slurm_fd open_fd , slurm_msg_t * msg ) msg -> address = proto_conf -> primary_controller ; if ( (rc = slurm_send_node_msg ( open_fd , msg ) ) == SLURM_SOCKET_ERROR ) { - info ( "Send message to primary controller failed" ) ; + error ( "Send message to primary controller failed" ) ; msg -> address = proto_conf -> secondary_controller ; if ( (rc = slurm_send_node_msg ( open_fd , msg ) ) == SLURM_SOCKET_ERROR ) { - info ( "Send messge to secondary controller failed" ) ; + error ( "Send messge to secondary controller failed" ) ; } } return rc ; @@ -343,7 +343,7 @@ int slurm_send_node_msg ( slurm_fd open_fd , slurm_msg_t * msg ) /* send msg */ if ( ( rc = _slurm_msg_sendto ( open_fd , buf_temp , SLURM_PROTOCOL_MAX_MESSAGE_BUFFER_SIZE - pack_len , SLURM_PROTOCOL_NO_SEND_RECV_FLAGS , &msg->address ) ) == SLURM_SOCKET_ERROR ) { - info ( "Error sending msg socket: errno %i", errno ) ; + error ( "Error sending msg socket: errno %i", errno ) ; } return rc ; } @@ -368,7 +368,7 @@ int slurm_receive_buffer ( slurm_fd open_fd , slurm_addr * source_address , slur if ( ( rc = _slurm_msg_recvfrom ( open_fd , buffer , receive_len, SLURM_PROTOCOL_NO_SEND_RECV_FLAGS , source_address ) ) == SLURM_SOCKET_ERROR ) ; { - info ( "Error receiving msg socket: errno %i", errno ) ; + error ( "Error receiving msg socket: errno %i", errno ) ; return rc ; } @@ -405,11 +405,11 @@ int slurm_send_controller_buffer ( slurm_fd open_fd , slurm_msg_type_t msg_type /* try to send to primary first then secondary */ if ( ( rc = slurm_send_node_buffer ( open_fd , & proto_conf -> primary_controller , msg_type , data_buffer , buf_len ) ) == SLURM_SOCKET_ERROR ) { - info ( "Send message to primary controller failed" ) ; + error ( "Send message to primary controller failed" ) ; if ( ( rc = slurm_send_node_buffer ( open_fd , & proto_conf -> secondary_controller , msg_type , data_buffer , buf_len ) ) == SLURM_SOCKET_ERROR ) { - info ( "Send messge to secondary controller failed" ) ; + error ( "Send messge to secondary controller failed" ) ; } } return rc ; @@ -445,7 +445,7 @@ int slurm_send_node_buffer ( slurm_fd open_fd , slurm_addr * destination_address if ( ( rc = _slurm_msg_sendto ( open_fd , buf_temp , SLURM_PROTOCOL_MAX_MESSAGE_BUFFER_SIZE - pack_len , SLURM_PROTOCOL_NO_SEND_RECV_FLAGS , destination_address ) ) == SLURM_SOCKET_ERROR ) { - info ( "Error sending msg socket: errno %i", errno ) ; + error ( "Error sending msg socket: errno %i", errno ) ; } return rc ; } diff --git a/src/common/slurm_protocol_pack.c b/src/common/slurm_protocol_pack.c index ee72d347720..2743e805a80 100644 --- a/src/common/slurm_protocol_pack.c +++ b/src/common/slurm_protocol_pack.c @@ -365,7 +365,7 @@ int unpack_msg ( slurm_msg_t * msg , char ** buffer , uint32_t * buf_len ) unpack_job_step_create_request_msg(( job_step_create_request_msg_t ** ) &msg -> data , ( void ** ) buffer , buf_len ) ; break; default : - debug ( "No pack method for msg type %i", msg -> msg_type ) ; + error ( "No pack method for msg type %i", msg -> msg_type ) ; return EINVAL ; break; diff --git a/src/common/slurm_protocol_socket_implementation.c b/src/common/slurm_protocol_socket_implementation.c index dcfcd47025d..1d862bf4aca 100644 --- a/src/common/slurm_protocol_socket_implementation.c +++ b/src/common/slurm_protocol_socket_implementation.c @@ -79,12 +79,12 @@ ssize_t _slurm_msg_recvfrom ( slurm_fd open_fd, char *buffer , size_t size , uin } else if ( recv_len == 0 ) { - info ( "Error receiving length of datagram. errno %i", errno ) ; + error ( "Error receiving length of datagram. errno %i", errno ) ; return SLURM_PROTOCOL_ERROR ; } else { - fatal ( "We don't handle negative return codes > -1") ; + error ( "We don't handle negative return codes > -1") ; } } unpack32 ( & transmit_size , ( void ** ) & size_buffer , & size_buffer_len ) ; @@ -101,7 +101,7 @@ ssize_t _slurm_msg_recvfrom ( slurm_fd open_fd, char *buffer , size_t size , uin } else { - info ( "Error receiving datagram. errno %i", errno ) ; + error ( "Error receiving datagram. errno %i", errno ) ; return SLURM_PROTOCOL_ERROR ; } return recv_len ; @@ -113,12 +113,12 @@ ssize_t _slurm_msg_recvfrom ( slurm_fd open_fd, char *buffer , size_t size , uin } else if ( recv_len == 0 ) { - info ( "Error receiving datagram. errno %i", errno ) ; + error ( "Error receiving datagram. errno %i", errno ) ; return SLURM_PROTOCOL_ERROR ; } else { - fatal ( "We don't handle negative return codes > -1") ; + error ( "We don't handle negative return codes > -1") ; } } @@ -186,7 +186,7 @@ ssize_t _slurm_msg_sendto ( slurm_fd open_fd, char *buffer , size_t size , uint3 } else if ( send_len != size ) { - info ( "_slurm_msg_sendto only transmitted %i of %i bytes", send_len , size ) ; + error ( "_slurm_msg_sendto only transmitted %i of %i bytes", send_len , size ) ; sigaction(SIGPIPE, &oldaction , &newaction); return SLURM_PROTOCOL_ERROR ; } @@ -212,24 +212,24 @@ slurm_fd _slurm_listen_stream ( slurm_addr * slurm_address ) const int one = 1; if ( ( connection_fd =_slurm_create_socket ( SLURM_STREAM ) ) == SLURM_SOCKET_ERROR ) { - info ( "Error creating slurm stream socket: errno %i", errno ) ; + error ( "Error creating slurm stream socket: errno %i", errno ) ; return connection_fd ; } if ( ( rc = _slurm_setsockopt(connection_fd , SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one) ) ) ) { - info ("setsockopt SO_REUSEADDR"); + error ("setsockopt SO_REUSEADDR failed"); return rc ; } if ( ( rc = _slurm_bind ( connection_fd , ( struct sockaddr const * ) slurm_address , sizeof ( slurm_addr ) ) ) == SLURM_SOCKET_ERROR ) { - info ( "Error binding slurm stream socket: errno %i" , errno ) ; + error ( "Error binding slurm stream socket: errno %i" , errno ) ; return rc ; } if ( ( rc = _slurm_listen ( connection_fd , SLURM_PROTOCOL_DEFAULT_LISTEN_BACKLOG ) ) == SLURM_SOCKET_ERROR ) { - info ( "Error listening on slurm stream socket: errno %i" , errno ) ; + error ( "Error listening on slurm stream socket: errno %i" , errno ) ; return rc ; } @@ -242,7 +242,7 @@ slurm_fd _slurm_accept_stream ( slurm_fd open_fd , slurm_addr * slurm_address ) slurm_fd connection_fd ; if ( ( connection_fd = _slurm_accept ( open_fd , ( struct sockaddr * ) slurm_address , & addr_len ) ) == SLURM_SOCKET_ERROR ) { - info ( "Error accepting slurm stream socket: errno %i", errno ) ; + error ( "Error accepting slurm stream socket: errno %i", errno ) ; } return connection_fd ; @@ -254,13 +254,13 @@ slurm_fd _slurm_open_stream ( slurm_addr * slurm_address ) slurm_fd connection_fd ; if ( ( connection_fd =_slurm_create_socket ( SLURM_STREAM ) ) == SLURM_SOCKET_ERROR ) { - info ( "Error creating slurm stream socket: errno %i", errno ) ; + error ( "Error creating slurm stream socket: errno %i", errno ) ; return connection_fd ; } if ( ( rc = _slurm_connect ( connection_fd , ( struct sockaddr const * ) slurm_address , sizeof ( slurm_addr ) ) ) == SLURM_SOCKET_ERROR ) { - info ( "Error connecting on slurm stream socket: errno %i" , errno ) ; + error ( "Error connecting on slurm stream socket: errno %i" , errno ) ; return rc ; } diff --git a/src/common/slurm_protocol_util.c b/src/common/slurm_protocol_util.c index 6a3e3a0cd80..8a41df8c570 100644 --- a/src/common/slurm_protocol_util.c +++ b/src/common/slurm_protocol_util.c @@ -11,7 +11,7 @@ uint32_t check_header_version( header_t * header) { if ( header -> version != SLURM_PROTOCOL_VERSION ) { - info ( "Invalid Protocol Version %d ", header -> version ) ; + error ( "Invalid Protocol Version %d ", header -> version ) ; return SLURM_PROTOCOL_VERSION_ERROR ; } return SLURM_PROTOCOL_SUCCESS ; @@ -30,7 +30,7 @@ uint32_t check_io_stream_header_version( slurm_io_stream_header_t * header) { if ( header -> version != SLURM_PROTOCOL_VERSION ) { - info ( "Invalid Protocol Version %d ", header -> version ) ; + error ( "Invalid Protocol Version %d ", header -> version ) ; return SLURM_PROTOCOL_VERSION_ERROR ; } return SLURM_PROTOCOL_SUCCESS ; -- GitLab