From 31214f15a687b5bf4ca6d3cf1d98af271fc223cc Mon Sep 17 00:00:00 2001 From: Koichiro IWAO Date: Sun, 20 Dec 2020 22:04:20 +0900 Subject: [PATCH] sesman: reflect review suggestions on cleanup_sockets * Use LOG_LEVEL_WARNING for the deletion failure * Log the error condition when the deletion failed --- sesman/session.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/sesman/session.c b/sesman/session.c index eb1d52cb..78c56f0d 100644 --- a/sesman/session.c +++ b/sesman/session.c @@ -1162,8 +1162,9 @@ cleanup_sockets(int display) LOG(LOG_LEVEL_DEBUG, "cleanup_sockets: deleting %s", file); if (g_file_delete(file) == 0) { - LOG(LOG_LEVEL_DEBUG, - "cleanup_sockets: failed to delete %s", file); + LOG(LOG_LEVEL_WARNING, + "cleanup_sockets: failed to delete %s (%s)", + file, g_get_strerror()); error++; } } @@ -1174,8 +1175,9 @@ cleanup_sockets(int display) LOG(LOG_LEVEL_DEBUG, "cleanup_sockets: deleting %s", file); if (g_file_delete(file) == 0) { - LOG(LOG_LEVEL_DEBUG, - "cleanup_sockets: failed to delete %s", file); + LOG(LOG_LEVEL_WARNING, + "cleanup_sockets: failed to delete %s (%s)", + file, g_get_strerror()); error++; } } @@ -1186,8 +1188,9 @@ cleanup_sockets(int display) LOG(LOG_LEVEL_DEBUG, "cleanup_sockets: deleting %s", file); if (g_file_delete(file) == 0) { - LOG(LOG_LEVEL_DEBUG, - "cleanup_sockets: failed to delete %s", file); + LOG(LOG_LEVEL_WARNING, + "cleanup_sockets: failed to delete %s (%s)", + file, g_get_strerror()); error++; } } @@ -1198,8 +1201,9 @@ cleanup_sockets(int display) LOG(LOG_LEVEL_DEBUG, "cleanup_sockets: deleting %s", file); if (g_file_delete(file) == 0) { - LOG(LOG_LEVEL_DEBUG, - "cleanup_sockets: failed to delete %s", file); + LOG(LOG_LEVEL_WARNING, + "cleanup_sockets: failed to delete %s (%s)", + file, g_get_strerror()); error++; } } @@ -1213,8 +1217,9 @@ cleanup_sockets(int display) LOG(LOG_LEVEL_DEBUG, "cleanup_sockets: deleting %s", file); if (g_file_delete(file) == 0) { - LOG(LOG_LEVEL_DEBUG, - "cleanup_sockets: failed to delete %s", file); + LOG(LOG_LEVEL_WARNING, + "cleanup_sockets: failed to delete %s (%s)", + file, g_get_strerror()); error++; } } @@ -1225,8 +1230,9 @@ cleanup_sockets(int display) LOG(LOG_LEVEL_DEBUG, "cleanup_sockets: deleting %s", file); if (g_file_delete(file) == 0) { - LOG(LOG_LEVEL_DEBUG, - "cleanup_sockets: failed to delete %s", file); + LOG(LOG_LEVEL_WARNING, + "cleanup_sockets: failed to delete %s (%s)", + file, g_get_strerror()); error++; } }