Skip to content

Commit

Permalink
Print out error message in case PCAP could open file
Browse files Browse the repository at this point in the history
  • Loading branch information
dpino committed Mar 4, 2016
1 parent ed346d5 commit da65030
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/apps/pcap/pcap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ end
PcapWriter = {}

function PcapWriter:new (filename)
local file = io.open(filename, "w")
local file, errno = io.open(filename, "w+")
if errno then error(errno) end
pcap.write_file_header(file)
return setmetatable({file = file}, {__index = PcapWriter})
end
Expand Down

0 comments on commit da65030

Please sign in to comment.