mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-29 00:32:29 +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
|
@ -37,8 +37,8 @@
|
|||
#include "tool/decode/lib/flagger.h"
|
||||
#include "tool/decode/lib/pollnames.h"
|
||||
|
||||
__attribute__((__constructor__)) static void init(void) {
|
||||
pledge("stdio rpath proc inet", 0);
|
||||
void SetUpOnce(void) {
|
||||
pledge("stdio proc inet", 0);
|
||||
errno = 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
#include "libc/testlib/testlib.h"
|
||||
#include "libc/time/time.h"
|
||||
|
||||
__attribute__((__constructor__)) static void init(void) {
|
||||
pledge("stdio rpath", 0);
|
||||
void SetUpOnce(void) {
|
||||
pledge("stdio", 0);
|
||||
errno = 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -31,6 +31,11 @@
|
|||
|
||||
char testlib_enable_tmp_setup_teardown;
|
||||
|
||||
void SetUpOnce(void) {
|
||||
pledge("stdio rpath cpath proc inet", 0);
|
||||
errno = 0;
|
||||
}
|
||||
|
||||
TEST(sendfile, test) {
|
||||
int ws;
|
||||
char *buf;
|
||||
|
|
|
@ -27,8 +27,8 @@
|
|||
#include "libc/sysv/consts/sol.h"
|
||||
#include "libc/testlib/testlib.h"
|
||||
|
||||
__attribute__((__constructor__)) static void init(void) {
|
||||
pledge("stdio rpath inet", 0);
|
||||
void SetUpOnce(void) {
|
||||
pledge("stdio inet", 0);
|
||||
errno = 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -25,8 +25,8 @@
|
|||
#include "libc/sysv/consts/sock.h"
|
||||
#include "libc/testlib/testlib.h"
|
||||
|
||||
__attribute__((__constructor__)) static void init(void) {
|
||||
pledge("stdio rpath tty", 0);
|
||||
void SetUpOnce(void) {
|
||||
pledge("stdio tty", 0);
|
||||
errno = 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -31,13 +31,13 @@
|
|||
#include "libc/testlib/testlib.h"
|
||||
#include "libc/time/time.h"
|
||||
|
||||
__attribute__((__constructor__)) static void init(void) {
|
||||
char testlib_enable_tmp_setup_teardown;
|
||||
|
||||
void SetUpOnce(void) {
|
||||
pledge("stdio rpath cpath proc unix", 0);
|
||||
errno = 0;
|
||||
}
|
||||
|
||||
char testlib_enable_tmp_setup_teardown;
|
||||
|
||||
void DatagramServer(void) {
|
||||
char buf[256] = {0};
|
||||
uint32_t len = sizeof(struct sockaddr_un);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue