diff options
author | Steven Barth <steven@midlink.org> | 2009-03-03 22:44:26 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2009-03-03 22:44:26 +0000 |
commit | e38c438771d10231e7ce1b74c027b4914acd6c78 (patch) | |
tree | 91ca365e48919d9af60e11ec7564f47538208289 /libs/httpclient/luasrc | |
parent | a3079828b4e0c0fabd96dfca87b99a5b5d9529e5 (diff) |
nixio:
Use POSIX file functions
introduce dup()
introduce fork() wait() kill()
more signal interrupt wrappers
more POSIX / UNIX standard compliance
Diffstat (limited to 'libs/httpclient/luasrc')
-rw-r--r-- | libs/httpclient/luasrc/httpclient/receiver.lua | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/libs/httpclient/luasrc/httpclient/receiver.lua b/libs/httpclient/luasrc/httpclient/receiver.lua index e46595db6..c977d064b 100644 --- a/libs/httpclient/luasrc/httpclient/receiver.lua +++ b/libs/httpclient/luasrc/httpclient/receiver.lua @@ -23,19 +23,14 @@ module "luci.httpclient.receiver" local function prepare_fd(target) -- Open fd for appending - local file, code, msg = nixio.open(target, "r+") - if not file and code == nixio.const.ENOENT then - file, code, msg = nixio.open(target, "w") - if file then - file:flush() - end - end + local oflags = nixio.open_flags("wronly", "creat") + local file, code, msg = nixio.open(target, oflags) if not file then return file, code, msg end -- Acquire lock - local stat, code, msg = file:lock("ex", "nb") + local stat, code, msg = file:lock("tlock") if not stat then return stat, code, msg end |