When we decide to unlink socket file, sun_path must be set. If it is set,

but there is problem unlinking the file, log a warning.

MFC after:	1 week
This commit is contained in:
Pawel Jakub Dawidek 2011-02-09 08:01:10 +00:00
parent b24cc00190
commit 493812ee6e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=218474

View File

@ -319,7 +319,12 @@ uds_close(void *ctx)
*/
if (uctx->uc_side == UDS_SIDE_SERVER_LISTEN &&
uctx->uc_owner == getpid()) {
(void)unlink(uctx->uc_sun.sun_path);
PJDLOG_ASSERT(uctx->uc_sun.sun_path[0] != '\0');
if (unlink(uctx->uc_sun.sun_path) == -1) {
pjdlog_errno(LOG_WARNING,
"Unable to unlink socket file %s",
uctx->uc_sun.sun_path);
}
}
uctx->uc_owner = 0;
uctx->uc_magic = 0;