forked from github/server
fix leaking errno from save.test call to remove
This commit is contained in:
parent
5dc9ccb03e
commit
d45798b798
1 changed files with 4 additions and 3 deletions
|
@ -25,9 +25,8 @@
|
||||||
#include <CuTest.h>
|
#include <CuTest.h>
|
||||||
#include <tests.h>
|
#include <tests.h>
|
||||||
|
|
||||||
#include <storage.h>
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
static void test_readwrite_data(CuTest * tc)
|
static void test_readwrite_data(CuTest * tc)
|
||||||
{
|
{
|
||||||
|
@ -283,7 +282,9 @@ static void test_read_password_external(CuTest *tc) {
|
||||||
FILE * F;
|
FILE * F;
|
||||||
|
|
||||||
test_setup();
|
test_setup();
|
||||||
remove(pwfile);
|
if (remove(pwfile) != 0) {
|
||||||
|
errno = 0;
|
||||||
|
}
|
||||||
f = test_create_faction(0);
|
f = test_create_faction(0);
|
||||||
faction_setpassword(f, password_encode("secret", PASSWORD_DEFAULT));
|
faction_setpassword(f, password_encode("secret", PASSWORD_DEFAULT));
|
||||||
CuAssertPtrNotNull(tc, f->_password);
|
CuAssertPtrNotNull(tc, f->_password);
|
||||||
|
|
Loading…
Reference in a new issue