diff options
author | pjd <pjd@FreeBSD.org> | 2011-02-09 08:01:10 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2011-02-09 08:01:10 +0000 |
commit | 32ac3f845f99de2c07c218ed42f85df7118021ae (patch) | |
tree | c41c542483f6ba52062ff426140fac2a9f425342 /sbin/hastd | |
parent | 00aede9329670186b00ae7ffaf3e58f808bfd226 (diff) | |
download | FreeBSD-src-32ac3f845f99de2c07c218ed42f85df7118021ae.zip FreeBSD-src-32ac3f845f99de2c07c218ed42f85df7118021ae.tar.gz |
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
Diffstat (limited to 'sbin/hastd')
-rw-r--r-- | sbin/hastd/proto_uds.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sbin/hastd/proto_uds.c b/sbin/hastd/proto_uds.c index 13292c0..8429d85 100644 --- a/sbin/hastd/proto_uds.c +++ b/sbin/hastd/proto_uds.c @@ -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; |