Skip to content

Instantly share code, notes, and snippets.

@cbrake
Created November 4, 2015 20:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cbrake/612c9d6269283795b54d to your computer and use it in GitHub Desktop.
Save cbrake/612c9d6269283795b54d to your computer and use it in GitHub Desktop.
libubox Interrupted system call
#!/usr/bin/env lua
-- the following will eventually fail on lua5.1 and luajit
-- with:
-- lua: test-uloop.lua:30: Interrupted system call
uloop = require 'uloop'
uloop.init()
local t
function t__()
t:set(1)
end
t = uloop.timer(t__, 1)
uloop.timer(function()
while true do
print('popen test')
local i = io.popen('ifconfig', 'r')
for line in i:lines() do
print(line)
end
end
end, 1)
uloop.run()
@szakharchenko
Copy link

I'm seeing this too, but this seems to be more of a popen/read problem than a uloop problem: the read() in lines() receives 2 SIGCHLDs as 'ifconfig' and its parent shell complete and fails to restart the read.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment