Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix make memcheck #2785

Merged
merged 22 commits into from
Jan 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
727eab8
tests/Makefile.am: memcheck: report OVERALL FAILED cases (if any)
jimklimov Jan 25, 2025
47daa47
scripts/valgrind/valgrind.sh: allow to customize the VALGRIND to be used
jimklimov Jan 25, 2025
ecf489a
tests/Makefile.am: memcheck: use the NUT-customized wrapper for valgrind
jimklimov Jan 25, 2025
64893a7
configure.ac, scripts/valgrind/valgrind.sh.in, tests/Makefile.am: mak…
jimklimov Jan 25, 2025
7f25581
scripts/valgrind/valgrind.sh.in: comment about --gen-suppressions=all…
jimklimov Jan 25, 2025
404bc4c
scripts/valgrind/.valgrind.supp: add suppressions for C++ tests (CPPU…
jimklimov Jan 25, 2025
edc7f01
scripts/valgrind/.valgrind.supp: add suppressions for dash interpreter
jimklimov Jan 25, 2025
84fce77
common/nutstream.cpp: checkExistsWritableDir(): fix memory leak with …
jimklimov Jan 25, 2025
9760763
tests/nutconf_ut.cpp: NutConfigUnitTest::testUpsmonConfiguration(): f…
jimklimov Jan 25, 2025
9cf811e
tests/generic_gpio_utest.c: refactor work with generic_gpio_close() t…
jimklimov Jan 25, 2025
507c5b3
tests/generic_gpio_utest.c: comment away upsdrv_cleanup() in codepath…
jimklimov Jan 25, 2025
7c38008
tests/generic_gpio_utest.c: dstate_free() after the test run
jimklimov Jan 25, 2025
ac8fd77
drivers/generic_gpio_common.c: fix code markup to adhere closer to NU…
jimklimov Jan 25, 2025
63c02b7
drivers/generic_gpio_common.c: upsdrv_cleanup(): only free resources …
jimklimov Jan 25, 2025
ab00ea9
tests/generic_gpio_utest.c: do upsdrv_cleanup() now that it is safe t…
jimklimov Jan 25, 2025
93be140
drivers/generic_gpio_common.c: generic_gpio_close(): free(gpioupsfdlo…
jimklimov Jan 25, 2025
42d8f3c
drivers/generic_gpio_common.{c,h}, tests/generic_gpio_utest.c: refact…
jimklimov Jan 25, 2025
bf59f10
tests/generic_gpio_utest.c: Be sure the internal gpioupsfd in driver …
jimklimov Jan 25, 2025
2905370
tests/generic_gpio_utest.c: fix inverted strcmp() result treatment
jimklimov Jan 25, 2025
dc052ae
drivers/generic_gpio_common.c: generic_gpio_open(): reshuffle to opti…
jimklimov Jan 25, 2025
6bc1e16
Revert "tests/generic_gpio_utest.c: Be sure the internal gpioupsfd in…
jimklimov Jan 25, 2025
6384e99
scripts/valgrind/valgrind.sh.in: revise detection of VALGRIND and LIB…
jimklimov Jan 25, 2025
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
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
Loading