svn commit: r218474 - head/sbin/hastd
Pawel Jakub Dawidek
pjd at FreeBSD.org
Wed Feb 9 08:01:10 UTC 2011
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;
More information about the svn-src-all
mailing list