mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-06 03:08:31 +00:00
Cherry-pick bug fixes and Landlock Make 1.0.2
This commit is contained in:
parent
c1d99676c4
commit
7e1c78b4f3
13 changed files with 468 additions and 64 deletions
|
@ -98,7 +98,7 @@ TEST(pledge, testLogMessage_inSoftyMode) {
|
|||
read(fds[0], msg, sizeof(msg));
|
||||
close(fds[0]);
|
||||
if (IsLinux()) {
|
||||
ASSERT_STARTSWITH("error: maybe pledge inet", msg);
|
||||
ASSERT_STARTSWITH("error: pledge inet for socket", msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -116,7 +116,7 @@ TEST(pledge, testLogMessage_onKillProcess) {
|
|||
read(fds[0], msg, sizeof(msg));
|
||||
close(fds[0]);
|
||||
if (IsLinux()) {
|
||||
ASSERT_STARTSWITH("error: maybe pledge inet", msg);
|
||||
ASSERT_STARTSWITH("error: pledge inet for socket", msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -16,25 +16,15 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/stdio/temp.h"
|
||||
#include "libc/testlib/testlib.h"
|
||||
|
||||
char testlib_enable_tmp_setup_teardown;
|
||||
|
||||
TEST(tmpfile, test) {
|
||||
FILE *f;
|
||||
mkdir("doge", 0755);
|
||||
setenv("TMPDIR", "doge", true);
|
||||
ASSERT_NE(NULL, (f = tmpfile()));
|
||||
FILE *f = tmpfile();
|
||||
EXPECT_NE(-1, fputc('t', f));
|
||||
EXPECT_NE(-1, fflush(f));
|
||||
rewind(f);
|
||||
EXPECT_EQ('t', fgetc(f));
|
||||
EXPECT_NE(-1, fclose(f));
|
||||
EXPECT_EQ(-1, rmdir("doge"));
|
||||
EXPECT_EQ(ENOTEMPTY, errno);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue