Skip to content

Commit

Permalink
Merge PR #679 (fixes branch from @eugeneia) into next
Browse files Browse the repository at this point in the history
  • Loading branch information
lukego committed Jan 4, 2016
2 parents 01dc739 + 599a568 commit e788e7a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/core/shm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,15 @@ end
-- Make directories needed for a named object.
-- Given the name "foo/bar/baz" create /var/run/foo and /var/run/foo/bar.
function mkdir (name)
-- Create root with mode "rwxrwxrwt" (R/W for all and sticky)
local mask = S.umask(0)
S.mkdir(root, "01777")
S.umask(mask)
-- Create root with mode "rwxrwxrwt" (R/W for all and sticky) if it
-- does not exist yet.
if not S.stat(root) then
local mask = S.umask(0)
local status, err = S.mkdir(root, "01777")
assert(status, ("Unable to create %s: %s"):format(
root, tostring(err or "unspecified error")))
S.umask(mask)
end
-- Create sub directories
local dir = root
name:gsub("([^/]+)",
Expand Down
2 changes: 2 additions & 0 deletions src/lib/hardware/pci.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module(...,package.seeall)

local ffi = require("ffi")
local C = ffi.C
local S = require("syscall")

local lib = require("core.lib")

Expand Down Expand Up @@ -34,6 +35,7 @@ end
function device_info (pciaddress)
local info = {}
local p = path(pciaddress)
assert(S.stat(p), ("No such device: %s"):format(pciaddress))
info.pciaddress = canonical(pciaddress)
info.vendor = lib.firstline(p.."/vendor")
info.device = lib.firstline(p.."/device")
Expand Down
1 change: 1 addition & 0 deletions src/program/packetblaster/packetblaster.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ function run (args)
config.link(c, "tee."..tostring(nics).."->"..name..".input")
end
end
assert(nics > 0, "<PCI> matches no suitable devices.")
engine.busywait = true
intel10g.num_descriptors = 32*1024
engine.configure(c)
Expand Down
3 changes: 3 additions & 0 deletions src/program/snabbnfv/traffic/traffic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ function long_usage () return usage end
function traffic (pciaddr, confpath, sockpath)
engine.log = true
local mtime = 0
if C.stat_mtime(confpath) == 0 then
print(("WARNING: File '%s' does not exist."):format(confpath))
end
while true do
local mtime2 = C.stat_mtime(confpath)
if mtime2 ~= mtime then
Expand Down

0 comments on commit e788e7a

Please sign in to comment.