summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDeepti Kulkarni <deepti@vyatta.com>2011-06-13 05:32:21 -0700
committerDeepti Kulkarni <deepti@vyatta.com>2011-06-13 05:32:21 -0700
commit39ea5ff58699bcfff1a55d211ea13ca4d7faae74 (patch)
tree6505ce4ef59522ba6e5c98814ea35be7cf8c1e93 /src
parent35d136ab4b8d39a7e65b32c6f796ad5e3a1dd63b (diff)
downloadvyatta-cfg-39ea5ff58699bcfff1a55d211ea13ca4d7faae74.tar.gz
vyatta-cfg-39ea5ff58699bcfff1a55d211ea13ca4d7faae74.zip
bug fix for 7178 - commit hook for demo-entitlement notifications not working.
Diffstat (limited to 'src')
-rw-r--r--src/cli_cstore.h2
-rw-r--r--src/cli_val.h1
-rw-r--r--src/commit/commit-algorithm.cpp2
3 files changed, 4 insertions, 1 deletions
diff --git a/src/cli_cstore.h b/src/cli_cstore.h
index 51ca502..b77d69c 100644
--- a/src/cli_cstore.h
+++ b/src/cli_cstore.h
@@ -136,6 +136,8 @@ boolean execute_list(vtw_node *cur, const vtw_def *def, const char *outbuf);
const char *type_to_name(vtw_type_e type);
int initialize_output(const char *op);
void bye(const char *msg, ...) __attribute__((format(printf, 1, 2), noreturn));
+int redirect_output(void);
+int restore_output(void);
/* functions from cli_objects */
char *get_at_string(void);
diff --git a/src/cli_val.h b/src/cli_val.h
index d3950c7..9d987d3 100644
--- a/src/cli_val.h
+++ b/src/cli_val.h
@@ -105,7 +105,6 @@ extern void release_config_lock(void);
extern int out_fd;
extern FILE *err_stream;
-int restore_output(void);
/* debug hooks? */
#define my_malloc(size, name) malloc(size)
diff --git a/src/commit/commit-algorithm.cpp b/src/commit/commit-algorithm.cpp
index 43f861f..5f77dfb 100644
--- a/src/commit/commit-algorithm.cpp
+++ b/src/commit/commit-algorithm.cpp
@@ -774,7 +774,9 @@ _execute_hooks(CommitHook hook)
cmd += getCommitHookDir(hook);
cmd += "'";
// not checking return status
+ restore_output();
system(cmd.c_str());
+ redirect_output();
}