Use stat(2) to retrieve the file permissions mode
authorLeonardo Taccari <iamleot@gmail.com>
Thu, 11 Oct 2018 20:37:39 +0000 (22:37 +0200)
committerDaniel Carl <danielcarl@gmx.de>
Thu, 11 Oct 2018 22:09:53 +0000 (00:09 +0200)
commit66858a8ec85641bd42f47298304e2bb8b5ee5051
treeaff277edfea25db5daf0eb69e7cd971cf91b2448
parent5ed3034826ee8e29a9a366508857a72a3beb3dcf
Use stat(2) to retrieve the file permissions mode

Remove the mode arguments from util_file_prepend_line(),
util_file_pop_line() and util_file_set_content().

Both util_file_prepend_line() and util_file_pop_line() just calls
util_file_set_content() so stat(2) can be used there and if it
fails the 0600 is used as a fallback.

Thanks to @fanglingsu for reviews and suggestions!
src/bookmark.c
src/main.c
src/normal.c
src/util.c
src/util.h