Date: Wed, 9 Feb 2011 08:01:10 +0000 (UTC) From: Pawel Jakub Dawidek <pjd@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r218474 - head/sbin/hastd Message-ID: <201102090801.p1981AHI075429@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pjd Date: Wed Feb 9 08:01:10 2011 New Revision: 218474 URL: http://svn.freebsd.org/changeset/base/218474 Log: 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 Modified: head/sbin/hastd/proto_uds.c Modified: head/sbin/hastd/proto_uds.c ============================================================================== --- head/sbin/hastd/proto_uds.c Wed Feb 9 06:38:32 2011 (r218473) +++ head/sbin/hastd/proto_uds.c Wed Feb 9 08:01:10 2011 (r218474) @@ -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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201102090801.p1981AHI075429>