diff options
| author | Riccardo Spagni <ric@spagni.net> | 2018-10-26 22:38:17 +0200 |
|---|---|---|
| committer | Riccardo Spagni <ric@spagni.net> | 2018-10-26 22:38:18 +0200 |
| commit | b5fafa6c6137feb92613a2a1cc2c0621987a629f (patch) | |
| tree | 5ea5115e70d85634aa29358fd7518220c45bc4f5 /tests | |
| parent | ecc690a61388ba0c7f00ec89db8b5837f3e0330d (diff) | |
| parent | 45a6880d789414b85028c8e7b56f920f162d2d04 (diff) | |
| download | monzero-core-b5fafa6c6137feb92613a2a1cc2c0621987a629f.tar.gz monzero-core-b5fafa6c6137feb92613a2a1cc2c0621987a629f.tar.xz monzero-core-b5fafa6c6137feb92613a2a1cc2c0621987a629f.zip | |
Merge pull request #4613
45a6880d unit_tests: call umask before mkstemp (moneromooo-monero)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/unit_tests/notify.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/unit_tests/notify.cpp b/tests/unit_tests/notify.cpp index d6811c6bd..e2477a76e 100644 --- a/tests/unit_tests/notify.cpp +++ b/tests/unit_tests/notify.cpp @@ -26,6 +26,10 @@ // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifdef __GLIBC__ +#include <sys/stat.h> +#endif + #include "gtest/gtest.h" #include <boost/filesystem.hpp> @@ -37,8 +41,14 @@ TEST(notify, works) { +#ifdef __GLIBC__ + mode_t prevmode = umask(077); +#endif char name_template[] = "/tmp/monero-notify-unit-test-XXXXXX"; int fd = mkstemp(name_template); +#ifdef __GLIBC__ + umask(prevmode); +#endif ASSERT_TRUE(fd >= 0); close(fd); |
