# # # patch "luaext_platform.cc" # from [85950c0a7933f6df1c9261172a4df13a0b354255] # to [2ce777d5ba2573e64f08e7d68ee8c24b2ddaa770] # # patch "tests/common/netsync.lua" # from [128824e21a9a92c02b9f21eecc0f1c73556c766e] # to [9e04e633e1a8abec93b4a71d704593fa064ed935] # ============================================================ --- luaext_platform.cc 85950c0a7933f6df1c9261172a4df13a0b354255 +++ luaext_platform.cc 2ce777d5ba2573e64f08e7d68ee8c24b2ddaa770 @@ -162,8 +162,13 @@ LUAEXT(sleep, ) return 1; } +LUAEXT(get_pid, ) +{ + pid_t pid = get_process_id(); + lua_pushnumber(L, pid); + return 1; +} - // Local Variables: // mode: C++ // fill-column: 76 ============================================================ --- tests/common/netsync.lua 128824e21a9a92c02b9f21eecc0f1c73556c766e +++ tests/common/netsync.lua 9e04e633e1a8abec93b4a71d704593fa064ed935 @@ -16,7 +16,7 @@ function netsync.setup() check(copy("test.db", "test3.db")) check(copy("keys", "keys3")) check(getstd("common/netsync-hooks.lua", "netsync.lua")) - math.randomseed(os.time()) + math.randomseed(get_pid()) end function netsync.setup_with_notes() @@ -51,7 +51,7 @@ function netsync.start(opts, n, min) end local args = {} local fn = mtn - local addr = "localhost:" .. math.random(20000, 50000) + local addr = "localhost:" .. math.random(1024, 65535) table.insert(args, "--dump=_MTN/server_dump") table.insert(args, "--bind="..addr) if min then