diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2012-07-11 12:03:56 -0700 |
---|---|---|
committer | Stephen Hemminger <shemminger@vyatta.com> | 2012-07-11 12:03:56 -0700 |
commit | 6cb7ad8d0bd51e178ec25222251d2e842b9e5aa0 (patch) | |
tree | b67eed808db970f899c32b69f72fb64cbbc66c53 /src/cli_new.c | |
parent | 8ebd82645a8503ec1b8464586e5c19c18c009f06 (diff) | |
download | vyatta-cfg-6cb7ad8d0bd51e178ec25222251d2e842b9e5aa0.tar.gz vyatta-cfg-6cb7ad8d0bd51e178ec25222251d2e842b9e5aa0.zip |
Minor code cleanup
1. Make local functions static
2. Use C standard for function with no-args versus old K&R style
3. Make some arguments const
Diffstat (limited to 'src/cli_new.c')
-rw-r--r-- | src/cli_new.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/cli_new.c b/src/cli_new.c index a7cd122..f045ba5 100644 --- a/src/cli_new.c +++ b/src/cli_new.c @@ -295,7 +295,7 @@ get_shell_command_output(const char *cmd, char *buf, unsigned int buf_size) #define COMMIT_CMD "/opt/vyatta/sbin/my_commit" void -release_config_lock() +release_config_lock(void) { unlink(LOCK_FILE); /* error ignored */ @@ -303,7 +303,7 @@ release_config_lock() /* try to clean up orphaned lock file. return -1 if failed */ static int -try_lock_cleanup() +try_lock_cleanup(void) { char buf[128]; char proc[128]; @@ -388,7 +388,7 @@ create_lock_file(int try_cleanup) } int -get_config_lock() +get_config_lock(void) { int fd = -1; FILE *lfile = NULL; @@ -970,7 +970,7 @@ static int change_var_value(const char* var_reference,const char* value, int act return ret; } -int system_out(char *command, const char *prepend_msg, boolean eloc); +static int system_out(char *command, const char *prepend_msg, boolean eloc); /**************************************************** check_syn: @@ -978,7 +978,8 @@ int system_out(char *command, const char *prepend_msg, boolean eloc); returns TRUE if all checks are OK, returns FALSE if check fails. ****************************************************/ -static boolean check_syn_func(vtw_node *cur,const char *prepend_msg,boolean format,const char* func,int line) +static boolean check_syn_func(vtw_node *cur, const char *prepend_msg, + boolean format, const char* func, int line) { int status; int ret; @@ -2126,7 +2127,7 @@ redirect_output() } int -restore_output() +restore_output(void) { if ((dup2(out_fd, STDOUT_FILENO) == -1) || (dup2(err_fd, STDERR_FILENO) == -1)) { @@ -2135,7 +2136,7 @@ restore_output() return 0; } -int +static int system_out(char *cmd, const char *prepend_msg, boolean eloc) { int pfd[2]; |