aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/async-write-etc-hosts.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/async-write-etc-hosts.js b/examples/async-write-etc-hosts.js
index 70640ab..41ad38c 100644
--- a/examples/async-write-etc-hosts.js
+++ b/examples/async-write-etc-hosts.js
@@ -5,14 +5,14 @@ var aug = require('../build/Release/libaugeas');
// but for the goodness sake we set AUG_SAVE_NEWFILE flag here,
// so your /etc/hosts will be kept untouched :-)
aug.createAugeas(
- {lens: 'hosts', incl: '/etc/hosts', flags:aug.AUG_SAVE_NEWFILE},
+ {lens: 'hosts', incl: '/etc/hosts', flags: aug.AUG_SAVE_NEWFILE},
function(aug) {
if (!aug.error()) {
console.log('Making changes ...');
aug.set('/files/etc/hosts/1/ipaddr', '127.0.0.2');
aug.set('/files/etc/hosts/1/canonical', 'localhost');
- aug.save(function(success) {
- if (success) {
+ aug.save(function(err) {
+ if (!err) {
console.log('Saved! Take a look at /etc/hosts.augnew');
} else {
console.log('Failed :-( Here is the reason:');