From 7927966d8799ccceeee04d1e9e7119f0cac65d7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz=20=28arab=2C=20vx?= =?UTF-8?q?p=29?= Date: Wed, 15 Jun 2016 16:01:06 +0000 Subject: Disable NLS for all packages minus the runtime components. Followup to <2696b7e8fb2972e72fab7ca8b5a3ab87022814af>: - Restore src/process/_execve.c NT_SEC_IMAGE vs. NT_SEC_RESERVE patch for builds on lucio-vm.local. to allow for running Midipix from a network share. Move previous psxscl patches into psxscl.local@lucio-vm.local.patch. Prevent Irssi from using g_child_watch_add_full() when resolving hostnames for testing purposes as clone(2) is not currently implemented. Updated Create `Midipix mintty shell' shortcut.vbs: - Always update the shortcut file. - Launch sh(1) instead of Mintty (via Elieux.) - Obtain the pathname to Cygwin from the command line, defaulting to `C:\cygwin64'. Updated midipix.sh: - Automatically determine ${MIDIPIX_DRIVE} and ${MIDIPIX_PNAME} via cygpath(1) (via Elieux.) - Export MSYS2_ARG_CONV_EXCL="*" when running within Msys (via Elieux.) - Prepend `/bin' to ${PATH} if not present (via Elieux.) - Set and restore the previous cygdrive prefix. - Use /proc/cygdrive instead of /cygdrive (via Elieux.) --- 999.tarballs.build | 0 Create `Midipix mintty shell' shortcut.vbs | 22 ++--- build.vars | 6 +- irssi-0.8.18.local.patch | 47 ++++++++++ midipix.sh | 62 +++++++------ psxscl.local.patch | 124 -------------------------- psxscl.local@lucio-vm.local.patch | 137 +++++++++++++++++++++++++++++ 7 files changed, 232 insertions(+), 166 deletions(-) mode change 100755 => 100644 999.tarballs.build delete mode 100644 psxscl.local.patch create mode 100644 psxscl.local@lucio-vm.local.patch diff --git a/999.tarballs.build b/999.tarballs.build old mode 100755 new mode 100644 diff --git a/Create `Midipix mintty shell' shortcut.vbs b/Create `Midipix mintty shell' shortcut.vbs index ab0d3bbd..ce8e10d4 100644 --- a/Create `Midipix mintty shell' shortcut.vbs +++ b/Create `Midipix mintty shell' shortcut.vbs @@ -1,18 +1,14 @@ Set WshShell = CreateObject("WScript.Shell") -LinkPath = WshShell.CurrentDirectory + "\Midipix mintty shell.lnk" If WScript.Arguments.Count = 0 Then - MinttyPath = "C:\cygwin64\bin\mintty.exe" + CygwinPath = "C:\cygwin64" Else - MinttyPath = WScript.Arguments(0) + CygwinPath = WScript.Arguments(0) End If - Set fso = CreateObject("Scripting.FileSystemObject") -If not (fso.FileExists(LinkPath)) Then - Set oMyShortCut = WshShell.CreateShortcut(LinkPath) - oMyShortCut.WindowStyle = 4 - oMyShortcut.IconLocation = MinttyPath - oMyShortCut.TargetPath = MinttyPath - oMyShortCut.Arguments = "-i /Cygwin-Terminal.ico -e sh midipix.sh" - oMyShortCut.WorkingDirectory = WshShell.CurrentDirectory - oMyShortCut.Save -End If +Set oMyShortCut = WshShell.CreateShortcut(WshShell.CurrentDirectory + "\Midipix shell.lnk") +oMyShortCut.Arguments = "midipix.sh" +oMyShortcut.IconLocation = CygwinPath + "\Cygwin-Terminal.ico" +oMyShortCut.TargetPath = CygwinPath + "\bin\sh.exe" +oMyShortCut.WindowStyle = 4 +oMyShortCut.WorkingDirectory = WshShell.CurrentDirectory +oMyShortCut.Save diff --git a/build.vars b/build.vars index b2fcecd0..5c0a04ae 100644 --- a/build.vars +++ b/build.vars @@ -55,10 +55,10 @@ export PATH="${PREFIX}/bin${PATH:+:${PATH}}"; : ${PKG_BUILD_NAMES:="apk_tools bash binutils binutils_host bzip2 coreutils curl dalist dash diffutils findutils gawk git glib gmp grep gzip hexcurse irssi less libarchive libelf libfetch libffi libnbcompat libressl libz make mksh mpc mpfr nano ncurses ncursestw ncursesw ntapi ntcon ntctty openssh pacman patch pemagine perl popt psxscl psxstub psxtypes python3 rsync sed slibtool tar tcsh util_linux which xz zsh"}; : ${PKG_BUILD_VARS:="AR_BUILD AR_CONFIGURE AUTOGEN BUILD_DIR BUILD_TYPE CC_BUILD CC_CONFIGURE CC_INSTALL CFLAGS_BUILD_EXTRA CFLAGS_CONFIGURE CFLAGS_CONFIGURE_EXTRA CFLAGS_INSTALL_EXTRA CONFIGURE_ARGS CONFIGURE_ARGS_EXTRA ENV_VARS_EXTRA FNAME GIT_ARGS_EXTRA INSTALL_TARGET LDFLAGS_BUILD_EXTRA LDFLAGS_CONFIGURE LDFLAGS_CONFIGURE_EXTRA LDFLAGS_INSTALL_EXTRA LIBFILES_FIX LIBTOOL_MIDIPIX LIBTOOL_MIDIPIX_FIX MAKEFLAGS_BUILD MAKEFLAGS_BUILD_EXTRA MAKEFLAGS_INSTALL MAKEFLAGS_INSTALL_EXTRA NO_CLEAN PATCHES_EXTRA_URL PREFIX_EXTRA RANLIB_INSTALL SHA256SUM SLIBTOOL SUBDIR URL URL_FNAME URL_TYPE VERSION"}; : ${PKG_LVL0_CFLAGS_CONFIGURE:=-O0}; -: ${PKG_LVL0_CONFIGURE_ARGS:="-C --host=${HOST_NATIVE} --prefix= --target=${TARGET}"}; +: ${PKG_LVL0_CONFIGURE_ARGS:="-C --disable-nls --host=${HOST_NATIVE} --prefix= --target=${TARGET}"}; : ${PKG_LVL0_MAKEFLAGS_BUILD:=${MAKEFLAGS_DEFAULT}}; : ${PKG_LVL1_CFLAGS_CONFIGURE:=${CFLAGS_DEFAULT}}; -: ${PKG_LVL1_CONFIGURE_ARGS:="--host=${HOST_NATIVE} --prefix=/ --target=${TARGET}"}; +: ${PKG_LVL1_CONFIGURE_ARGS:="--disable-nls --host=${HOST_NATIVE} --prefix=/ --target=${TARGET}"}; : ${PKG_LVL1_MAKEFLAGS_BUILD:=${MAKEFLAGS_DEFAULT}}; : ${PKG_LVL1_MAKEFLAGS_INSTALL:=DESTDIR=${PREFIX_LVL1}}; : ${PKG_LVL2_BUILD_TYPE:=cross}; @@ -72,7 +72,7 @@ export PATH="${PREFIX}/bin${PATH:+:${PATH}}"; : ${PKG_LVL3_LDFLAGS_CONFIGURE:=--sysroot=${PREFIX_LVL3}}; : ${PKG_LVL3_MAKEFLAGS_BUILD:=${MAKEFLAGS_DEFAULT}}; : ${PKG_LVL3_MAKEFLAGS_INSTALL:=DESTDIR=${PREFIX_LVL3}}; -: ${PKG_LVL3_CONFIGURE_ARGS:="-C --host=${HOST_NATIVE} --prefix= --target=${TARGET}"}; +: ${PKG_LVL3_CONFIGURE_ARGS:="-C --disable-nls --host=${HOST_NATIVE} --prefix= --target=${TARGET}"}; : ${PKG_APK_TOOLS_VERSION:=2.6.6}; : ${PKG_APK_TOOLS_SHA256SUM:=7e5e86c856ce236c7fd54605ee0b1dbf59920398d3b33f9f6ff0e5f98e6828af}; diff --git a/irssi-0.8.18.local.patch b/irssi-0.8.18.local.patch index f21ce2fe..a65fd02b 100644 --- a/irssi-0.8.18.local.patch +++ b/irssi-0.8.18.local.patch @@ -20,3 +20,50 @@ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ +--- irssi-0.8.18/src/core/servers.c.orig 2016-01-20 22:08:07.000000000 +0000 ++++ irssi-0.8.18/src/core/servers.c 2016-06-13 11:28:49.187797037 +0000 +@@ -407,6 +407,36 @@ + /* connect with unix socket */ + server_real_connect(server, NULL, server->connrec->address); + } else { ++ #ifdef __midipix__ ++ IPADDR ip4, ip6, *ip; ++ ++ connect_address = server->connrec->proxy != NULL ? ++ server->connrec->proxy : server->connrec->address; ++ if (net_gethostbyname(connect_address, &ip4, &ip6) == -1) { ++ g_warning("net_gethostbyname(): -1"); ++ g_free(server->tag); ++ g_free(server->nick); ++ return FALSE; ++ } else if (server->connrec->family == 0) { ++ /* prefer IPv4 addresses */ ++ ip = ip4.family != 0 ? &ip4 : &ip6; ++ } else if (server->connrec->family == AF_INET6) { ++ /* IPv6 address, use if possible */ ++ if (ip6.family != 0) { ++ ip = &ip6; ++ } else { ++ ip = &ip4; ++ } ++ } else { ++ /* IPv4 address, use if possible */ ++ if (ip4.family != 0) { ++ ip = &ip4; ++ } else { ++ ip = &ip6; ++ } ++ } ++ server_real_connect(server, ip, NULL); ++ #else + /* resolve host name */ + if (pipe(fd) != 0) { + g_warning("server_connect(): pipe() failed."); +@@ -433,6 +463,7 @@ + lookup_servers = g_slist_append(lookup_servers, server); + + signal_emit("server looking", 1, server); ++ #endif + } + return TRUE; + } diff --git a/midipix.sh b/midipix.sh index b6b84097..9a074174 100755 --- a/midipix.sh +++ b/midipix.sh @@ -1,45 +1,55 @@ #!/bin/sh # -MIDIPIX_PATH_DEFAULTS="/c/Midipix /z"; +prepend_path() { + local _pname _pname_prepend="${1}" IFS=":"; + for _pname in ${PATH}; do + if [ "${_pname}" = "${_pname_prepend}" ]; then + return; + fi; + done; export PATH="${_pname_prepend}${PATH:+:${PATH}}"; +}; + +prepend_path /bin; if [ "${1}" = -h ]; then - echo "usage: $0 [drive_letter [dirname]]"; - exit 1; + echo "usage: $0 [drive_letter [dirname]]"; exit 0; elif [ ${#} -eq 0 ]; then -for MIDIPIX_PATH in ${MIDIPIX_PATH_DEFAULTS}; do - [ -d /cygdrive${MIDIPIX_PATH} ] || continue; - MIDIPIX_DRIVE=${MIDIPIX_PATH#/}; - MIDIPIX_DRIVE=${MIDIPIX_DRIVE%%/*}; - MIDIPIX_PNAME=${MIDIPIX_PATH#/${MIDIPIX_DRIVE}}; - MIDIPIX_PNAME=${MIDIPIX_PNAME#/}; - break; -done; + PWD_ABSOLUTE="$(cygpath -am .)" || exit 1; + MIDIPIX_DRIVE="${PWD_ABSOLUTE%:*}"; + MIDIPIX_PNAME="${PWD_ABSOLUTE#${MIDIPIX_DRIVE}:}"; + unset PWD_ABSOLUTE; else MIDIPIX_DRIVE="${1}"; MIDIPIX_PNAME="${2}"; - if [ "${MIDIPIX_DRIVE#*[ ]*}" != "${MIDIPIX_DRIVE}" ]\ - || [ "${MIDIPIX_PNAME#*[ ]*}" != "${MIDIPIX_PNAME}" ]; then - echo "Error: drive_letter/dirname must not contain SP (\` ') or VT (\`\\\t') characters."; - exit 1; - fi; fi; -MIDIPIX_PATH=/${MIDIPIX_DRIVE}${MIDIPIX_PNAME:+/${MIDIPIX_PNAME}}; -if [ ! -d /cygdrive${MIDIPIX_PATH} ]; then +UNAME_OS="$(uname -o)" || exit 2; +if [ "${MIDIPIX_DRIVE#*[ ]*}" != "${MIDIPIX_DRIVE}" ]\ +|| [ "${MIDIPIX_PNAME#*[ ]*}" != "${MIDIPIX_PNAME}" ]; then + echo "Error: drive_letter/dirname must not contain SP (\` ') or VT (\`\\\t') characters."; + exit 3; +fi; +MIDIPIX_PATH=/${MIDIPIX_DRIVE}${MIDIPIX_PNAME:+/${MIDIPIX_PNAME#/}}; +MIDIPIX_PATH=${MIDIPIX_PATH%/}; +if [ ! -d /proc/cygdrive${MIDIPIX_PATH} ]; then echo "Error: Midipix path non-existent or invalid (\`${MIDIPIX_PATH}'.)"; - exit 1; + exit 4; else - if [ -f /cygdrive${MIDIPIX_PATH}/bin/libpsxscl.log ]; then - echo Found libpsxscl.log, copying to /cygdrive${MIDIPIX_PATH}/bin/libpsxscl.last. - cp /cygdrive${MIDIPIX_PATH}/bin/libpsxscl.log \ - /cygdrive${MIDIPIX_PATH}/bin/libpsxscl.last; + if [ -f /proc/cygdrive${MIDIPIX_PATH}/bin/libpsxscl.log ]; then + echo Found libpsxscl.log, copying to /proc/cygdrive${MIDIPIX_PATH}/bin/libpsxscl.last. + cp /proc/cygdrive${MIDIPIX_PATH}/bin/libpsxscl.log \ + /proc/cygdrive${MIDIPIX_PATH}/bin/libpsxscl.last || exit 5; fi; + OLD_CYGDRIVE_PREFIX="$(readlink /proc/cygdrive)" || exit 6; echo "Midipix drive letter.....: ${MIDIPIX_DRIVE}"; echo "Midipix pathname.........: ${MIDIPIX_PNAME}"; echo "Absolute Midipix pathname: ${MIDIPIX_PATH}"; echo -------------------------------------------------------- echo WARNING: The cygdrive path prefix will be changed to / echo whilst the Midipix shell window is running. It will be - echo reset to its original value of /cygdrive after it exits. + echo reset to its previous value of ${OLD_CYGDRIVE_PREFIX} after it exits. echo -------------------------------------------------------- + if [ "${UNAME_OS}" = "Msys" ]; then + export MSYS2_ARG_CONV_EXCL="*"; + fi; mintty -h always -e /bin/sh -c " set -o errexit; stty raw -echo; mount --change-cygdrive-prefix /; @@ -47,7 +57,7 @@ else export PATH=${MIDIPIX_PATH}/native/bin:${MIDIPIX_PATH}/native/lib; ./ntctty.exe -e chroot //${MIDIPIX_PATH#/}/native /bin/bash"; echo -------------------------------------------------------- - echo Resetting cygdrive path prefix to /. + echo Resetting cygdrive path prefix to ${OLD_CYGDRIVE_PREFIX}. echo -------------------------------------------------------- - mount --change-cygdrive-prefix /cygdrive; + mount --change-cygdrive-prefix "${OLD_CYGDRIVE_PREFIX}"; fi; diff --git a/psxscl.local.patch b/psxscl.local.patch deleted file mode 100644 index f41d39c0..00000000 --- a/psxscl.local.patch +++ /dev/null @@ -1,124 +0,0 @@ -diff --git a/src/iofn/psx_iofn_fsdir.c b/src/iofn/psx_iofn_fsdir.c -index 53b3380..8bdd7d8 100644 ---- a/src/iofn/psx_iofn_fsdir.c -+++ b/src/iofn/psx_iofn_fsdir.c -@@ -52,10 +52,34 @@ static int32_t __fastcall __psx_iofn_fsdir_open_next( - path.buffer++; - } - -+ /* XXX */ -+ uint32_t status; -+ static char name_buffer[1024]; -+ nt_unicode_string * dev_name,full_path; -+ -+ iosb.info = 0; -+ if ((status = __ntapi->zw_query_object( -+ path_info->hat,NT_OBJECT_NAME_INFORMATION, -+ name_buffer,sizeof(name_buffer),(uint32_t *)&iosb.info))) -+ return status; -+ else { -+ dev_name = (nt_unicode_string *)name_buffer; -+ if ((dev_name->strlen > 2) && -+ (dev_name->buffer[(dev_name->strlen - 1) / 2] != '\\')) { -+ dev_name->buffer[dev_name->strlen / 2] = '\\'; -+ dev_name->strlen += 2; -+ } -+ __ntapi->tt_generic_memcpy(&dev_name->buffer[dev_name->strlen / 2], -+ path.buffer,path.strlen); -+ dev_name->strlen += path.strlen; -+ full_path.maxlen = (full_path.strlen = dev_name->strlen) + 2; -+ full_path.buffer = dev_name->buffer; -+ } -+ - /* oa */ - oa.len = sizeof(nt_oa); -- oa.root_dir = path_info->hat; -- oa.obj_name = &path; -+ oa.root_dir = 0; -+ oa.obj_name = &full_path; - oa.obj_attr = path_info->ntobjattr; - oa.sec_desc = 0; - oa.sec_qos = 0; -@@ -73,6 +97,45 @@ static int32_t __fastcall __psx_iofn_fsdir_open_next( - 0,0); - } - -+static int32_t __stdcall __psx_iofn_fsdir_open_parent_directory( -+ void ** hparent, -+ void * hdir, -+ uintptr_t * buffer, -+ uint32_t buffer_size, -+ uint32_t desired_access, -+ uint32_t open_options, -+ int32_t * type) -+{ -+ uint32_t status; -+ nt_io_status_block iosb; -+ nt_file_internal_information fii_hdir,fii_hroot; -+ struct __psx_tlca * tlca; -+ -+ tlca = __tlca_self(); -+ status = __ntapi->zw_query_information_file( -+ hdir,&iosb,&fii_hdir,sizeof(fii_hdir), -+ NT_FILE_INTERNAL_INFORMATION); -+ if (status) -+ return status; -+ status = __ntapi->zw_query_information_file( -+ tlca->ctx->root.hfile,&iosb,&fii_hroot,sizeof(fii_hroot), -+ NT_FILE_INTERNAL_INFORMATION); -+ if (status) -+ return status; -+ if (fii_hdir.index_number.quad == fii_hroot.index_number.quad) { -+ *hparent = hdir; -+ *type = PSX_FD_OS_FS_ROOT; -+ status = NT_STATUS_SUCCESS; -+ } else -+ status = __ntapi->tt_open_physical_parent_directory( -+ hparent,hdir, -+ buffer, -+ buffer_size, -+ desired_access, -+ open_options,type); -+ return status; -+} -+ - int32_t __stdcall __psx_iofn_fsdir_getvents( - void * hfile, - void * hevent, -@@ -133,6 +196,6 @@ void __fastcall __psx_iofn_fsdir_init(struct __iovtbl * iovtbl) - iovtbl->getdents = __ntapi->zw_query_directory_file; - iovtbl->getvents = __psx_iofn_fsdir_getvents; - -- iovtbl->open_logical_parent = __ntapi->tt_open_logical_parent_directory; -- iovtbl->open_physical_parent = __ntapi->tt_open_physical_parent_directory; -+ iovtbl->open_logical_parent = __psx_iofn_fsdir_open_parent_directory; -+ iovtbl->open_physical_parent = __psx_iofn_fsdir_open_parent_directory; - } -diff --git a/src/path/psx_path_parse.c b/src/path/psx_path_parse.c -index ff4d933..08431b6 100644 ---- a/src/path/psx_path_parse.c -+++ b/src/path/psx_path_parse.c -@@ -48,8 +48,8 @@ int32_t __fastcall __psx_parse_normalized_path_utf8( - ch, - ++(path_info->depth)); - -- if (*(++ch)=='/') { -- ch++; -+ if (ch[1]=='/') { -+ ch+=2; - } - } - -diff --git a/src/path/psx_path_resolve.c b/src/path/psx_path_resolve.c -index 2bd615c..705e646 100644 ---- a/src/path/psx_path_resolve.c -+++ b/src/path/psx_path_resolve.c -@@ -260,7 +260,7 @@ static int __fastcall __path_swap_at( - int32_t status; - - /* swap */ -- if (path_info->pathflags & PSX_PATH_CLOSE_AT) -+ if ((path_info->pathflags & PSX_PATH_CLOSE_AT) && (path_info->hat != path_info->hfile)) - if ((status = __iovtbl[path_info->fdtypeat].close(path_info->hat))) - return status; - diff --git a/psxscl.local@lucio-vm.local.patch b/psxscl.local@lucio-vm.local.patch new file mode 100644 index 00000000..1b3b9c02 --- /dev/null +++ b/psxscl.local@lucio-vm.local.patch @@ -0,0 +1,137 @@ +diff --git a/src/iofn/psx_iofn_fsdir.c b/src/iofn/psx_iofn_fsdir.c +index 53b3380..8bdd7d8 100644 +--- a/src/iofn/psx_iofn_fsdir.c ++++ b/src/iofn/psx_iofn_fsdir.c +@@ -52,10 +52,34 @@ static int32_t __fastcall __psx_iofn_fsdir_open_next( + path.buffer++; + } + ++ /* XXX */ ++ uint32_t status; ++ static char name_buffer[1024]; ++ nt_unicode_string * dev_name,full_path; ++ ++ iosb.info = 0; ++ if ((status = __ntapi->zw_query_object( ++ path_info->hat,NT_OBJECT_NAME_INFORMATION, ++ name_buffer,sizeof(name_buffer),(uint32_t *)&iosb.info))) ++ return status; ++ else { ++ dev_name = (nt_unicode_string *)name_buffer; ++ if ((dev_name->strlen > 2) && ++ (dev_name->buffer[(dev_name->strlen - 1) / 2] != '\\')) { ++ dev_name->buffer[dev_name->strlen / 2] = '\\'; ++ dev_name->strlen += 2; ++ } ++ __ntapi->tt_generic_memcpy(&dev_name->buffer[dev_name->strlen / 2], ++ path.buffer,path.strlen); ++ dev_name->strlen += path.strlen; ++ full_path.maxlen = (full_path.strlen = dev_name->strlen) + 2; ++ full_path.buffer = dev_name->buffer; ++ } ++ + /* oa */ + oa.len = sizeof(nt_oa); +- oa.root_dir = path_info->hat; +- oa.obj_name = &path; ++ oa.root_dir = 0; ++ oa.obj_name = &full_path; + oa.obj_attr = path_info->ntobjattr; + oa.sec_desc = 0; + oa.sec_qos = 0; +@@ -73,6 +97,45 @@ static int32_t __fastcall __psx_iofn_fsdir_open_next( + 0,0); + } + ++static int32_t __stdcall __psx_iofn_fsdir_open_parent_directory( ++ void ** hparent, ++ void * hdir, ++ uintptr_t * buffer, ++ uint32_t buffer_size, ++ uint32_t desired_access, ++ uint32_t open_options, ++ int32_t * type) ++{ ++ uint32_t status; ++ nt_io_status_block iosb; ++ nt_file_internal_information fii_hdir,fii_hroot; ++ struct __psx_tlca * tlca; ++ ++ tlca = __tlca_self(); ++ status = __ntapi->zw_query_information_file( ++ hdir,&iosb,&fii_hdir,sizeof(fii_hdir), ++ NT_FILE_INTERNAL_INFORMATION); ++ if (status) ++ return status; ++ status = __ntapi->zw_query_information_file( ++ tlca->ctx->root.hfile,&iosb,&fii_hroot,sizeof(fii_hroot), ++ NT_FILE_INTERNAL_INFORMATION); ++ if (status) ++ return status; ++ if (fii_hdir.index_number.quad == fii_hroot.index_number.quad) { ++ *hparent = hdir; ++ *type = PSX_FD_OS_FS_ROOT; ++ status = NT_STATUS_SUCCESS; ++ } else ++ status = __ntapi->tt_open_physical_parent_directory( ++ hparent,hdir, ++ buffer, ++ buffer_size, ++ desired_access, ++ open_options,type); ++ return status; ++} ++ + int32_t __stdcall __psx_iofn_fsdir_getvents( + void * hfile, + void * hevent, +@@ -133,6 +196,6 @@ void __fastcall __psx_iofn_fsdir_init(struct __iovtbl * iovtbl) + iovtbl->getdents = __ntapi->zw_query_directory_file; + iovtbl->getvents = __psx_iofn_fsdir_getvents; + +- iovtbl->open_logical_parent = __ntapi->tt_open_logical_parent_directory; +- iovtbl->open_physical_parent = __ntapi->tt_open_physical_parent_directory; ++ iovtbl->open_logical_parent = __psx_iofn_fsdir_open_parent_directory; ++ iovtbl->open_physical_parent = __psx_iofn_fsdir_open_parent_directory; + } +diff --git a/src/path/psx_path_parse.c b/src/path/psx_path_parse.c +index ff4d933..08431b6 100644 +--- a/src/path/psx_path_parse.c ++++ b/src/path/psx_path_parse.c +@@ -48,8 +48,8 @@ int32_t __fastcall __psx_parse_normalized_path_utf8( + ch, + ++(path_info->depth)); + +- if (*(++ch)=='/') { +- ch++; ++ if (ch[1]=='/') { ++ ch+=2; + } + } + +diff --git a/src/path/psx_path_resolve.c b/src/path/psx_path_resolve.c +index 2bd615c..705e646 100644 +--- a/src/path/psx_path_resolve.c ++++ b/src/path/psx_path_resolve.c +@@ -260,7 +260,7 @@ static int __fastcall __path_swap_at( + int32_t status; + + /* swap */ +- if (path_info->pathflags & PSX_PATH_CLOSE_AT) ++ if ((path_info->pathflags & PSX_PATH_CLOSE_AT) && (path_info->hat != path_info->hfile)) + if ((status = __iovtbl[path_info->fdtypeat].close(path_info->hat))) + return status; + +diff --git a/src/process/_execve.c b/src/process/_execve.c +index a623d2a..80dd4a9 100644 +--- a/src/process/_execve.c ++++ b/src/process/_execve.c +@@ -232,7 +232,7 @@ intptr_t __sys_execve(const unsigned char * path, const char ** argv, const char + NT_SECTION_QUERY|NT_SECTION_MAP_EXECUTE, + &oa,&ssize, + NT_PAGE_EXECUTE, +- NT_SEC_IMAGE, ++ NT_SEC_RESERVE, + image->info.hfile))) + return __execve_return(tlca,0,target,-ENOEXEC); + -- cgit v1.2.3