diff options
author | Adam Kocoloski <kocolosk@apache.org> | 2009-11-21 13:43:43 +0000 |
---|---|---|
committer | Adam Kocoloski <kocolosk@apache.org> | 2009-11-21 13:43:43 +0000 |
commit | aef9dbd3a6cbb85085023d3c8565740e09fd6a77 (patch) | |
tree | 7ee342a14f36f7a21b2249b832c9700f082d55b6 /src/couchdb/couch_os_process.erl | |
parent | 9c97bb531ed9b5d6fc18fcef87a6742514e984d5 (diff) |
code improvements from tidier. Patch by Kostis Sagonas. COUCHDB-570
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@882903 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_os_process.erl')
-rw-r--r-- | src/couchdb/couch_os_process.erl | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/couchdb/couch_os_process.erl b/src/couchdb/couch_os_process.erl index f42e99a8..244a59f5 100644 --- a/src/couchdb/couch_os_process.erl +++ b/src/couchdb/couch_os_process.erl @@ -62,10 +62,9 @@ prompt(Pid, Data) -> writeline(OsProc, Data) when is_record(OsProc, os_proc) -> port_command(OsProc#os_proc.port, Data ++ "\n"). -readline(OsProc) when is_record(OsProc, os_proc) -> +readline(#os_proc{} = OsProc) -> readline(OsProc, []). -readline(OsProc, Acc) when is_record(OsProc, os_proc) -> - #os_proc{port=Port} = OsProc, +readline(#os_proc{port = Port} = OsProc, Acc) -> receive {Port, {data, {noeol, Data}}} -> readline(OsProc, [Data|Acc]); |