From 4520134def65678f9fc0a6aed8a4110b4c2ab2bc Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 22 Apr 2024 16:06:35 +0200 Subject: [PATCH] Avoid SIGPIPE in mechglue when gssproxy closed the connection SIGPIPE should not be passed up to the calling program Signed-off-by: Volker Lendecke --- src/client/gpm_common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/gpm_common.c b/src/client/gpm_common.c index 81c139b7..22a74ab4 100644 --- a/src/client/gpm_common.c +++ b/src/client/gpm_common.c @@ -396,7 +396,7 @@ static int gpm_send_buffer(struct gpm_ctx *gpmctx, } ret = 0; - wn = write(gpmctx->fd, &size, sizeof(uint32_t)); + wn = send(gpmctx->fd, &size, sizeof(uint32_t), MSG_NOSIGNAL); if (wn == -1) { ret = errno; } @@ -424,7 +424,7 @@ static int gpm_send_buffer(struct gpm_ctx *gpmctx, goto done; } - wn = write(gpmctx->fd, buffer + pos, length - pos); + wn = send(gpmctx->fd, buffer + pos, length - pos, MSG_NOSIGNAL); if (wn == -1) { if (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK) { continue;