Skip to content

Commit

Permalink
Merge pull request #2785 from jimklimov/fix-memcheck
Browse files Browse the repository at this point in the history
Fix `make memcheck`
  • Loading branch information
jimklimov authored Jan 26, 2025
2 parents 66ed615 + 6384e99 commit e841840
Show file tree
Hide file tree
Showing 11 changed files with 363 additions and 127 deletions.
4 changes: 3 additions & 1 deletion common/nutstream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ NutStream::status_t NutMemory::putData(const std::string & data) {
* by packager who knows their system. */

static bool checkExistsWritableDir(const char *s) {
DIR *pd;
#ifdef DEBUG
std::cerr << "checkExistsWritableDir(" << (s ? s : "<null>") << "): ";
#endif
Expand All @@ -207,12 +208,13 @@ static bool checkExistsWritableDir(const char *s) {
return false;
}

if (!opendir(s)) {
if (!(pd = opendir(s))) {
#ifdef DEBUG
std::cerr << "not a dir" << std::endl;
#endif
return false;
}
closedir(pd);

/* POSIX: If the requested access is permitted, access() succeeds
* and shall return 0; otherwise, -1 shall be returned and errno
Expand Down
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -5799,6 +5799,7 @@ m4_foreach_w([SCRIPTFILE], [
scripts/Solaris/postremove
scripts/Solaris/preproto.pl
scripts/Solaris/nut
scripts/valgrind/valgrind.sh
tools/gitlog2changelog.py
tools/nut-snmpinfo.py
], [
Expand Down
Loading

0 comments on commit e841840

Please sign in to comment.