From ae7f70b27d3f366a7b744981643e28fba8cc6b0d Mon Sep 17 00:00:00 2001 From: Frank Lahm Date: Mon, 28 Oct 2013 12:31:47 +0100 Subject: [PATCH] Add exit code Use dedicated exit code for AFP connections that were dropped by the client right after the TCP handshake. --- NEWS | 2 ++ include/atalk/util.h | 1 + libatalk/dsi/dsi_tcp.c | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index cd9e90d3..aa61935e 100644 --- a/NEWS +++ b/NEWS @@ -15,6 +15,8 @@ Changes in 3.1.0 Changes in 3.0.7 ================ * FIX: Build fixes for the Kerberos UAM +* UPD: Use dedicated exit code for AFP connections that were dropped + by the client right after the TCP handshake Changes in 3.0.6 ================ diff --git a/include/atalk/util.h b/include/atalk/util.h index 386b6c28..38e1e7b2 100644 --- a/include/atalk/util.h +++ b/include/atalk/util.h @@ -25,6 +25,7 @@ #define EXITERR_CLNT 1 /* client related error */ #define EXITERR_CONF 2 /* error in config files/cmd line parameters */ #define EXITERR_SYS 3 /* local system error */ +#define EXITERR_CLOSED 4 /* connection was immediately closed after TCP handshake */ /* Print a SBT and exit */ #define AFP_PANIC(why) \ diff --git a/libatalk/dsi/dsi_tcp.c b/libatalk/dsi/dsi_tcp.c index ad8a3a23..24fde971 100644 --- a/libatalk/dsi/dsi_tcp.c +++ b/libatalk/dsi/dsi_tcp.c @@ -186,7 +186,7 @@ static pid_t dsi_tcp_open(DSI *dsi) len = dsi_stream_read(dsi, block, 2); if (!len ) { /* connection already closed, don't log it (normal OSX 10.3 behaviour) */ - exit(EXITERR_CLNT); + exit(EXITERR_CLOSED); } if (len < 2 || (block[0] > DSIFL_MAX) || (block[1] > DSIFUNC_MAX)) { LOG(log_error, logtype_dsi, "dsi_tcp_open: invalid header"); -- 2.39.2