mirror of
https://gitee.com/openharmony/third_party_libsnd
synced 2024-11-23 09:59:54 +00:00
misc_test.c : Force errno to zero at start of some tests.
This commit is contained in:
parent
7a667e179a
commit
6ca8632158
@ -21,6 +21,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <math.h>
|
||||
@ -235,6 +236,9 @@ filesystem_full_test (int typemajor)
|
||||
return ;
|
||||
#endif
|
||||
|
||||
/* Make sure errno is zero before doing anything else. */
|
||||
errno = 0 ;
|
||||
|
||||
print_test_name ("filesystem_full_test", filename) ;
|
||||
|
||||
if (stat (filename, &buf) != 0)
|
||||
@ -287,6 +291,9 @@ permission_test (const char *filename, int typemajor)
|
||||
const char *errorstr ;
|
||||
int frames ;
|
||||
|
||||
/* Make sure errno is zero before doing anything else. */
|
||||
errno = 0 ;
|
||||
|
||||
if (getuid () == 0)
|
||||
{ /* If running as root bypass this test.
|
||||
** Root is allowed to open a readonly file for write.
|
||||
|
Loading…
Reference in New Issue
Block a user