libuv 1.44.0

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3856 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2022-03-07 21:34:07 +00:00
parent b488db9137
commit 41cabad264
81 changed files with 2216 additions and 2026 deletions

View File

@ -22,6 +22,10 @@
#include "uv.h"
#include "task.h"
#include <string.h>
#ifndef _WIN32
#include <unistd.h>
#include <sys/types.h>
#endif
TEST_IMPL(get_passwd) {
/* TODO(gengjiawen): Fix test on QEMU. */
@ -64,11 +68,15 @@ TEST_IMPL(get_passwd) {
#endif
#ifdef _WIN32
ASSERT(pwd.uid == -1);
ASSERT(pwd.gid == -1);
ASSERT_EQ(pwd.uid, (unsigned)-1);
ASSERT_EQ(pwd.gid, (unsigned)-1);
#else
ASSERT(pwd.uid >= 0);
ASSERT(pwd.gid >= 0);
ASSERT_NE(pwd.uid, (unsigned)-1);
ASSERT_NE(pwd.gid, (unsigned)-1);
ASSERT_EQ(pwd.uid, geteuid());
if (pwd.uid != 0 && pwd.gid != getgid())
/* This will be likely true, as only root could have changed it. */
ASSERT_EQ(pwd.gid, getegid());
#endif
/* Test uv_os_free_passwd() */