Compare commits

...

4 Commits

Author SHA1 Message Date
Glenn Strauss 1c41faaebc [mod_dirlisting] sort "../" to top (fixes #3109)
(thx otovalek)

x-ref:
  "mod_dirlisting javascript sort of ".." entries is broken"
  https://redmine.lighttpd.net/issues/3109
2021-10-10 15:25:43 -04:00
Glenn Strauss 78eb0e3945 [tests] force POSIX::WNOHANG() autovivification (fixes #3110)
x-ref:
  "RPM build fails at Lighttest.pm"
  https://redmine.lighttpd.net/issues/3110
2021-10-10 15:19:05 -04:00
Glenn Strauss 2a3cca7c56 [core] earlier macOS need define for errno_t (fixes #3107)
Earlier macOS need _DARWIN_C_SOURCE defined for errno_t from sys/types.h

Alternatively, define __STDC_WANT_LIB_EXT1__ >= 1 before include errno.h

x-ref:
  "error: unknown type name 'errno_t' (macOS 10.13.6)"
  https://redmine.lighttpd.net/issues/3107
2021-10-10 14:09:12 -04:00
Glenn Strauss 124543bbe1 [mod_magnet] prefer lua_newuserdatauv() w/ lua 5.4
lua_newuserdata() -> lua_newuserdatauv() w/ lua 5.4
2021-10-07 19:10:26 -04:00
5 changed files with 24 additions and 5 deletions

View File

@ -12,6 +12,11 @@
#ifndef __STDC_WANT_LIB_EXT1__ /*(enable C11 Annex K ext1 *_s functions)*/
#define __STDC_WANT_LIB_EXT1__ 1
#endif
#if defined(__APPLE__) && defined(__MACH__)
#ifndef _DARWIN_C_SOURCE
#define _DARWIN_C_SOURCE
#endif
#endif
#include "first.h"
#ifdef __FreeBSD__
#ifndef _RSIZE_T_DEFINED /* expecting __EXT1_VISIBLE 1 and _RSIZE_T_DEFINED */

View File

@ -13,6 +13,12 @@
#define _DEFAULT_SOURCE
#endif
#if defined(__APPLE__) && defined(__MACH__)
#ifndef _DARWIN_C_SOURCE
#define _DARWIN_C_SOURCE
#endif
#endif
#ifndef __STDC_WANT_LIB_EXT1__
#define __STDC_WANT_LIB_EXT1__ 1
#endif

View File

@ -703,8 +703,8 @@ static const char js_simple_table_resort[] = \
" var bt = get_inner_text(b.cells[sort_column]);\n" \
" var cmp;\n" \
" if (sort_column == name_column) {\n" \
" if (at == '..') return -1;\n" \
" if (bt == '..') return 1;\n" \
" if (at == '../') return -1;\n" \
" if (bt == '../') return 1;\n" \
" }\n" \
" if (a.cells[sort_column].className == 'int') {\n" \
" cmp = parseInt(at)-parseInt(bt);\n" \

View File

@ -295,7 +295,11 @@ static int magnet_readdir(lua_State *L) {
const char * const s = luaL_checkstring(L, 1);
DIR * const d = opendir(s);
if (d) {
#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 504
DIR ** const dp = (DIR **)lua_newuserdata(L, sizeof(DIR *));
#else
DIR ** const dp = (DIR **)lua_newuserdatauv(L, sizeof(DIR *), 0);
#endif
*dp = d;
magnet_readdir_metatable(L);
lua_setmetatable(L, -2);
@ -605,8 +609,12 @@ static int magnet_stat(lua_State *L) {
* (script must not cache sce in persistent global state for later use)
* (If we did want sce to be persistent, then could increment sce refcnt,
* and set up __gc metatable method to decrement sce refcnt) */
stat_cache_entry ** const udata = /* (sp += 1) */
(struct stat_cache_entry **)lua_newuserdata(L, sizeof(stat_cache_entry *));
stat_cache_entry ** const udata =(struct stat_cache_entry**)/* (sp += 1) */
#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 504
lua_newuserdata(L, sizeof(stat_cache_entry *));
#else
lua_newuserdatauv(L, sizeof(stat_cache_entry *), 0);
#endif
*udata = sce;
magnet_stat_metatable(L); /* (sp += 1) */

View File

@ -137,7 +137,7 @@ sub wait_for_port_with_proc {
# the process is gone, we failed
require POSIX;
if (0 != waitpid($child, POSIX::WNOHANG)) {
if (0 != waitpid($child, POSIX::WNOHANG())) {
return -1;
}
if (0 >= $timeout) {