diff options
author | Yusuke Sato <yusuke-sato@apn.alpine.co.jp> | 2018-05-28 22:51:09 +0900 |
---|---|---|
committer | Christoph Lipka <clipka@users.noreply.github.com> | 2018-05-28 15:51:09 +0200 |
commit | 9a0aae8c7db7cabdb99a83c11adbf55e1cc02e8d (patch) | |
tree | 8ee17c8f6af837568000658ec9d5c62361e9a9eb /src/daemon | |
parent | 2410feca37f44b4cc8255cce61e728679ac2c41a (diff) | |
download | DLT-daemon-9a0aae8c7db7cabdb99a83c11adbf55e1cc02e8d.tar.gz |
dlt-daemon: Improve error logging on accept() failure (#69)
Error log in case of accept() failure is improved with errno info.
This helps us to analyze dlt-daemon's issue in future.
(e.g.)
Connection request come to wrong socket unexpectedly and this
causes exiting dlt-daemon.
Signed-off-by: Yusuke Sato <yusuke-sato@apn.alpine.co.jp>
Diffstat (limited to 'src/daemon')
-rw-r--r-- | src/daemon/dlt-daemon.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/daemon/dlt-daemon.c b/src/daemon/dlt-daemon.c index c5f415e..83c891d 100644 --- a/src/daemon/dlt-daemon.c +++ b/src/daemon/dlt-daemon.c @@ -1589,7 +1589,7 @@ int dlt_daemon_process_client_connect(DltDaemon *daemon, cli_size = sizeof(cli); if ((in_sock = accept(receiver->fd,&cli, &cli_size)) < 0) { - dlt_log(LOG_ERR, "accept() failed!\n"); + dlt_vlog(LOG_ERR, "accept() for socket %d failed: %s\n", receiver->fd, strerror(errno)); return -1 ; } @@ -1873,7 +1873,7 @@ int dlt_daemon_process_control_connect( ctrl_size = sizeof(ctrl); if ((in_sock = accept(receiver->fd, &ctrl, &ctrl_size)) < 0) { - dlt_log(LOG_ERR, "accept() on UNIX socket failed!\n"); + dlt_vlog(LOG_ERR, "accept() on UNIX control socket %d failed: %s\n", receiver->fd, strerror(errno)); return -1 ; } @@ -1929,7 +1929,7 @@ int dlt_daemon_process_app_connect( app_size = sizeof(app); if ((in_sock = accept(receiver->fd, &app, &app_size)) < 0) { - dlt_log(LOG_ERR, "accept() on UNIX socket failed!\n"); + dlt_vlog(LOG_ERR, "accept() on UNIX socket %d failed: %s\n", receiver->fd, strerror(errno)); return -1 ; } |