diff --git a/lib/multi.c b/lib/multi.c
index 7720c957a96269f05ea0a97768e86840d9b2e155..c52db96258e3993e9f654e3c691a7292bdae78b4 100644
--- a/lib/multi.c
+++ b/lib/multi.c
@@ -1806,10 +1806,13 @@ static void close_all_connections(struct Curl_multi *multi)
 
   conn = Curl_conncache_find_first_connection(multi->conn_cache);
   while(conn) {
+    SIGPIPE_VARIABLE(pipe_st);
     conn->data = multi->closure_handle;
 
+    sigpipe_ignore(conn->data, &pipe_st);
     /* This will remove the connection from the cache */
     (void)Curl_disconnect(conn, FALSE);
+    sigpipe_restore(&pipe_st);
 
     conn = Curl_conncache_find_first_connection(multi->conn_cache);
   }