Skip to content

Commit

Permalink
refactor(pdk): move ffi.cdef gethostname from tools into pdk (#11967)
Browse files Browse the repository at this point in the history
gethostname is only used by pdk, it should not be in utils.
  • Loading branch information
chronolaw committed Nov 10, 2023
1 parent ef957a6 commit 13d3d57
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 5 additions & 0 deletions kong/pdk/node.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ local shms = {}
local n_workers = ngx.worker.count()


ffi.cdef[[
int gethostname(char *name, size_t len);
]]


for shm_name, shm in pairs(shared) do
insert(shms, {
zone = shm,
Expand Down
6 changes: 0 additions & 6 deletions kong/tools/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
-- @license [Apache 2.0](https://opensource.org/licenses/Apache-2.0)
-- @module kong.tools.utils

local ffi = require "ffi"
local pl_stringx = require "pl.stringx"
local pl_path = require "pl.path"
local pl_file = require "pl.file"
Expand All @@ -31,11 +30,6 @@ local re_match = ngx.re.match
local setmetatable = setmetatable


ffi.cdef[[
int gethostname(char *name, size_t len);
]]


local _M = {}


Expand Down

1 comment on commit 13d3d57

@khcp-gha-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bazel Build

Docker image available kong/kong:13d3d57e21a5893e45cf0dbb812ea44ec5ce2ef1
Artifacts available https://github.com/Kong/kong/actions/runs/6820405159

Please sign in to comment.