diff --git a/src/common/slurm_protocol_errno.h b/src/common/slurm_protocol_errno.h index c5cb398a8bee7bee05aaf5ad41d62759c212014f..f57778805b0adfe442fb136ba6686f8cd008ef03 100644 --- a/src/common/slurm_protocol_errno.h +++ b/src/common/slurm_protocol_errno.h @@ -15,7 +15,7 @@ #define SLURM_PROTOCOL_VERSION_ERROR -1910 /* _info.c/ocommuncation layer RESPONSE_SLURM_RC message codes */ -#define SLURM_NO_CHANGE_IN_DATA 100 +#define SLURM_NO_CHANGE_IN_DATA -1920 /* job_mgr.c/job_create */ #define ESLURM_INVALID_PARTITION_SPECIFIED -2000 diff --git a/src/common/slurm_protocol_socket_implementation.c b/src/common/slurm_protocol_socket_implementation.c index 704cf152cfc2e67e667b2918b5a956d7aa5c064f..b38523479c3afe0749f8513ab2e2a44ab322f7ae 100644 --- a/src/common/slurm_protocol_socket_implementation.c +++ b/src/common/slurm_protocol_socket_implementation.c @@ -102,8 +102,14 @@ ssize_t _slurm_msg_sendto ( slurm_fd open_fd, char *buffer , size_t size , uint3 char * size_buffer = size_buffer_temp ; unsigned int size_buffer_len = 8 ; + struct sigaction newaction ; + struct sigaction oldaction ; + + newaction . sa_handler = SIG_IGN ; + /* ignore SIGPIPE so that send can return a error code if the other side closes the socket */ - signal(SIGPIPE, SIG_IGN); + //signal(SIGPIPE, SIG_IGN); + sigaction(SIGPIPE, &newaction , & oldaction ); pack32 ( size , ( void ** ) & size_buffer , & size_buffer_len ) ; @@ -122,7 +128,8 @@ ssize_t _slurm_msg_sendto ( slurm_fd open_fd, char *buffer , size_t size , uint3 return SLURM_PROTOCOL_ERROR ; } - signal(SIGPIPE, SIG_DFL); + //signal(SIGPIPE, SIG_DFL); + sigaction(SIGPIPE, &oldaction , & newaction ); return send_len ; }