]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - command.c
Introduce send_strerror().
[paraslash.git] / command.c
index 9c175f35ec45087325db2ef3dbb3249689de0708..82194adf8b0c4568427b38f35a1eb1a7cadf70ae 100644 (file)
--- a/command.c
+++ b/command.c
@@ -256,6 +256,11 @@ __printf_3_4 int send_sb_va(struct stream_cipher_context *scc, int band,
        return send_sb(scc, msg, ret, band, false);
 }
 
+int send_strerror(struct command_context *cc, int err)
+{
+       return sc_send_va_buffer(&cc->scc, "%s\n", para_strerror(err));
+}
+
 /**
  * Send a sideband packet through a blocking file descriptor.
  *
@@ -1054,7 +1059,7 @@ __noreturn void handle_connect(int fd, const char *peername)
        if (ret >= 0)
                goto out;
 err_out:
-       sc_send_va_buffer(&cc->scc, "%s\n", para_strerror(-ret));
+       send_strerror(cc, -ret);
 net_err:
        PARA_NOTICE_LOG("%s\n", para_strerror(-ret));
 out: