summaryrefslogtreecommitdiffstats
path: root/src/etc/inc/config.lib.inc
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2016-10-14 08:45:49 -0300
committerRenato Botelho <renato@netgate.com>2016-10-14 08:51:54 -0300
commite717f1617331545a72a075fc05eb50781b6ab63e (patch)
treea82f03cc3876762f9947e577991e9642f63a555b /src/etc/inc/config.lib.inc
parent237d29c490d35aab75a159584b33210f89317659 (diff)
downloadpfsense-e717f1617331545a72a075fc05eb50781b6ab63e.zip
pfsense-e717f1617331545a72a075fc05eb50781b6ab63e.tar.gz
Make $force_binary parameter optional, default to false
Diffstat (limited to 'src/etc/inc/config.lib.inc')
-rw-r--r--src/etc/inc/config.lib.inc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/etc/inc/config.lib.inc b/src/etc/inc/config.lib.inc
index d14f17c..49790d1 100644
--- a/src/etc/inc/config.lib.inc
+++ b/src/etc/inc/config.lib.inc
@@ -390,7 +390,7 @@ function convert_config() {
* RESULT
* boolean - true if successful, false if not
******/
-function safe_write_file($file, $content, $force_binary) {
+function safe_write_file($file, $content, $force_binary = false) {
$tmp_file = $file . "." . getmypid();
$write_mode = $force_binary ? "wb" : "w";
@@ -463,7 +463,7 @@ function write_config($desc="Unknown", $backup = true, $write_config_only = fals
$xmlconfig = dump_xml_config($config, $g['xml_rootobj']);
/* write new configuration */
- if (!safe_write_file("{$g['cf_conf_path']}/config.xml", $xmlconfig, false)) {
+ if (!safe_write_file("{$g['cf_conf_path']}/config.xml", $xmlconfig)) {
log_error(gettext("WARNING: Config contents could not be saved. Could not open file!"));
unlock($lockkey);
file_notice("config.xml", sprintf(gettext("Unable to open %s/config.xml for writing in write_config()%s"), $g['cf_conf_path'], "\n"));
OpenPOWER on IntegriCloud