mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-24 14:22:28 +00:00
Perform code cleanup on test pledges
This commit is contained in:
parent
3d2cf95af1
commit
3443039f34
54 changed files with 112 additions and 83 deletions
|
@ -32,11 +32,6 @@ STATIC_YOINK("apetest2.com");
|
|||
|
||||
char testlib_enable_tmp_setup_teardown_once;
|
||||
|
||||
__attribute__((__constructor__)) static void init(void) {
|
||||
pledge("stdio rpath wpath cpath tty proc exec", 0);
|
||||
errno = 0;
|
||||
}
|
||||
|
||||
void Extract(const char *from, const char *to, int mode) {
|
||||
ASSERT_SYS(0, 3, open(from, O_RDONLY));
|
||||
ASSERT_SYS(0, 4, creat(to, mode));
|
||||
|
@ -46,6 +41,8 @@ void Extract(const char *from, const char *to, int mode) {
|
|||
}
|
||||
|
||||
void SetUpOnce(void) {
|
||||
pledge("stdio rpath wpath cpath tty proc exec", 0);
|
||||
errno = 0;
|
||||
|
||||
// nothing to do if we're using elf
|
||||
if (~SUPPORT_VECTOR & (WINDOWS | XNU)) {
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#include "libc/nexgen32e/threaded.h"
|
||||
#include "libc/testlib/testlib.h"
|
||||
|
||||
__attribute__((__constructor__)) static void init(void) {
|
||||
void SetUpOnce(void) {
|
||||
__tls_enabled = false;
|
||||
pledge("stdio rpath", 0);
|
||||
errno = 0;
|
||||
|
|
|
@ -49,8 +49,8 @@
|
|||
int x, me, tid;
|
||||
_Atomic(int) thechilde;
|
||||
|
||||
__attribute__((__constructor__)) static void init(void) {
|
||||
pledge("stdio rpath thread", 0);
|
||||
void SetUpOnce(void) {
|
||||
pledge("stdio thread", 0);
|
||||
errno = 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -29,8 +29,8 @@
|
|||
#include "libc/testlib/ezbench.h"
|
||||
#include "libc/testlib/testlib.h"
|
||||
|
||||
__attribute__((__constructor__)) static void init(void) {
|
||||
pledge("stdio rpath proc", 0);
|
||||
void SetUpOnce(void) {
|
||||
pledge("stdio proc", 0);
|
||||
errno = 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
#define I(x, y) \
|
||||
{ x, y, 0, (y - x) * FRAMESIZE + FRAMESIZE }
|
||||
|
||||
__attribute__((__constructor__)) static void init(void) {
|
||||
void SetUpOnce(void) {
|
||||
pledge("stdio rpath", 0);
|
||||
errno = 0;
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
|
||||
char testlib_enable_tmp_setup_teardown;
|
||||
|
||||
__attribute__((__constructor__)) static void init(void) {
|
||||
void SetUpOnce(void) {
|
||||
pledge("stdio rpath wpath cpath proc", 0);
|
||||
errno = 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue