tests: evas: check fd being non -1 before using close()

eina_file_mkstemp would return -1 in an error case. Make sure we check
the return when clsoing here.

CID: 1400790
This commit is contained in:
Stefan Schmidt 2020-06-09 14:29:35 +02:00
parent 7ce639ac7c
commit 0eca4c64d3
1 changed files with 2 additions and 1 deletions

View File

@ -904,7 +904,8 @@ EFL_START_TEST(evas_object_image_map_unmap)
// save file, verify its pixels
fd = eina_file_mkstemp("/tmp/evas-test.XXXXXX.png", &tmp);
close(fd);
fail_if(fd <= 0);
fail_if(close(fd));
if (efl_file_save(o, tmp, NULL, NULL))
{
Eina_Rw_Slice sorig, sdest;