summaryrefslogtreecommitdiff
path: root/apps/couch/src/couch_config_writer.erl
diff options
context:
space:
mode:
authorRobert Newson <robert.newson@cloudant.com>2011-06-13 14:59:55 +0100
committerRobert Newson <robert.newson@cloudant.com>2011-06-13 14:59:55 +0100
commite9a5a6f90a021db1db8a7e55ec797a4c86edcad6 (patch)
tree06d0c28969cfcf54b2f137e7407b097f73aa0f21 /apps/couch/src/couch_config_writer.erl
parent266ba88ac6ded40087e0211ad9e75e4ce64e66cb (diff)
parent3c1a0d7e2c9adef4f8b20c9df205a86e5c0feefb (diff)
Merge CouchDB 1.1
Diffstat (limited to 'apps/couch/src/couch_config_writer.erl')
-rw-r--r--apps/couch/src/couch_config_writer.erl9
1 files changed, 8 insertions, 1 deletions
diff --git a/apps/couch/src/couch_config_writer.erl b/apps/couch/src/couch_config_writer.erl
index c8691d79..decd269a 100644
--- a/apps/couch/src/couch_config_writer.erl
+++ b/apps/couch/src/couch_config_writer.erl
@@ -35,7 +35,14 @@ save_to_file({{Section, Key}, Value}, File) ->
NewLines = process_file_lines(Lines, [], SectionLine, Pattern, Key, Value),
NewFileContents = reverse_and_add_newline(strip_empty_lines(NewLines), []),
- ok = file:write_file(File, NewFileContents).
+ case file:write_file(File, NewFileContents) of
+ ok ->
+ ok;
+ {error, eacces} ->
+ {file_permission_error, File};
+ Error ->
+ Error
+ end.
process_file_lines([Section|Rest], SeenLines, Section, Pattern, Key, Value) ->