Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Build artifacts
Makefile.in
aclocal.m4
autom4te.cache/
compile
config.guess
config.log
config.status
config.sub
configure
depcomp
install-sh
ltmain.sh
missing
*.in
config.h.in
.deps/
.libs/
*.o
*.lo
*.la
*.a
*.so
*.so.*
1 change: 1 addition & 0 deletions _codeql_detected_source_root
15 changes: 13 additions & 2 deletions rfcMgr/rfc_xconf_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
#include <rbus/rbus_value.h>
#endif
#include <ctime>
#include <cerrno>
#include <cstring>

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -1507,8 +1509,17 @@ bool RuntimeFeatureControlProcessor::IsDirectBlocked()
else
{
RDK_LOG(RDK_LOG_INFO, LOG_RFCMGR,"[%s][%d] RFC: Last direct failed blocking has expired, removing %s, allowing direct \n", __FUNCTION__, __LINE__, DIRECT_BLOCK_FILENAME);
// Attempt to remove the file - if it fails (e.g., already removed), it's not critical
(void)remove(DIRECT_BLOCK_FILENAME);
// Attempt to remove the file - check errno to distinguish expected vs unexpected failures
if (remove(DIRECT_BLOCK_FILENAME) != 0) {
int err = errno;
if (err == ENOENT) {
// File already removed (race condition) - this is expected and not an error
RDK_LOG(RDK_LOG_DEBUG, LOG_RFCMGR,"[%s][%d] RFC: %s already removed (expected race condition)\n", __FUNCTION__, __LINE__, DIRECT_BLOCK_FILENAME);
} else {
// Unexpected error (e.g., permission denied)
RDK_LOG(RDK_LOG_DEBUG, LOG_RFCMGR,"[%s][%d] RFC: Failed to remove %s, errno=%d (%s)\n", __FUNCTION__, __LINE__, DIRECT_BLOCK_FILENAME, err, strerror(err));
}
}
}
}
#endif
Expand Down