mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 13:52: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
|
@ -31,6 +31,11 @@
|
|||
_Atomic(int) itworked;
|
||||
_Thread_local int var;
|
||||
|
||||
void SetUpOnce(void) {
|
||||
pledge("stdio rpath thread", 0);
|
||||
errno = 0;
|
||||
}
|
||||
|
||||
int Worker(void *arg, int tid) {
|
||||
int i = (long)arg;
|
||||
ASSERT_EQ(0, var++);
|
||||
|
@ -50,8 +55,3 @@ TEST(_spawn, test) {
|
|||
for (i = 0; i < n; ++i) EXPECT_SYS(0, 0, _join(t + i));
|
||||
EXPECT_EQ(n, itworked);
|
||||
}
|
||||
|
||||
__attribute__((__constructor__)) static void init(void) {
|
||||
pledge("stdio rpath thread", 0);
|
||||
errno = 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue