mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-09-01 06:25:34 +00:00
[3932] Ignored remove return status
This commit is contained in:
@@ -83,7 +83,7 @@ private:
|
|||||||
// Let's remove the old file. We don't care about any possible
|
// Let's remove the old file. We don't care about any possible
|
||||||
// errors here. The file should not be there if the file was
|
// errors here. The file should not be there if the file was
|
||||||
// shut down properly.
|
// shut down properly.
|
||||||
remove(file_name.c_str());
|
static_cast<void>(remove(file_name.c_str()));
|
||||||
|
|
||||||
// Set this socket to be non-blocking one.
|
// Set this socket to be non-blocking one.
|
||||||
if (fcntl(fd, F_SETFL, O_NONBLOCK) !=0 ) {
|
if (fcntl(fd, F_SETFL, O_NONBLOCK) !=0 ) {
|
||||||
@@ -100,7 +100,7 @@ private:
|
|||||||
if (bind(fd, (struct sockaddr*)&addr, sizeof(addr))) {
|
if (bind(fd, (struct sockaddr*)&addr, sizeof(addr))) {
|
||||||
const char* errmsg = strerror(errno);
|
const char* errmsg = strerror(errno);
|
||||||
::close(fd);
|
::close(fd);
|
||||||
remove(file_name.c_str());
|
static_cast<void>(remove(file_name.c_str()));
|
||||||
isc_throw(isc::config::SocketError, "Failed to bind socket " << fd
|
isc_throw(isc::config::SocketError, "Failed to bind socket " << fd
|
||||||
<< " to " << file_name << ": " << errmsg);
|
<< " to " << file_name << ": " << errmsg);
|
||||||
}
|
}
|
||||||
@@ -114,7 +114,7 @@ private:
|
|||||||
if (status < 0) {
|
if (status < 0) {
|
||||||
const char* errmsg = strerror(errno);
|
const char* errmsg = strerror(errno);
|
||||||
::close(fd);
|
::close(fd);
|
||||||
remove(file_name.c_str());
|
static_cast<void>(remove(file_name.c_str()));
|
||||||
isc_throw(isc::config::SocketError, "Failed to listen on socket fd="
|
isc_throw(isc::config::SocketError, "Failed to listen on socket fd="
|
||||||
<< fd << ", filename=" << file_name << ": " << errmsg);
|
<< fd << ", filename=" << file_name << ": " << errmsg);
|
||||||
}
|
}
|
||||||
@@ -181,7 +181,7 @@ private:
|
|||||||
// Close should always succeed. We don't care if we're able to delete
|
// Close should always succeed. We don't care if we're able to delete
|
||||||
// the socket or not.
|
// the socket or not.
|
||||||
::close(sockfd_);
|
::close(sockfd_);
|
||||||
remove(filename_.c_str());
|
static_cast<void>(remove(filename_.c_str()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @brief UNIX filename representing this socket
|
/// @brief UNIX filename representing this socket
|
||||||
|
@@ -478,7 +478,7 @@ TEST_F(IfaceMgrTest, dhcp6Sniffer) {
|
|||||||
// Testing socket operation in a portable way is tricky
|
// Testing socket operation in a portable way is tricky
|
||||||
// without interface detection implemented
|
// without interface detection implemented
|
||||||
|
|
||||||
remove("interfaces.txt");
|
static_cast<void>(remove("interfaces.txt"));
|
||||||
|
|
||||||
ofstream interfaces("interfaces.txt", ios::ate);
|
ofstream interfaces("interfaces.txt", ios::ate);
|
||||||
interfaces << "eth0 fe80::21e:8cff:fe9b:7349";
|
interfaces << "eth0 fe80::21e:8cff:fe9b:7349";
|
||||||
|
Reference in New Issue
Block a user