diff options
author | Chris Hall <chris.hall@highwayman.com> | 2011-03-31 00:37:47 +0100 |
---|---|---|
committer | Chris Hall <chris.hall@highwayman.com> | 2011-03-31 00:37:47 +0100 |
commit | 9a9466f1fdad6fb6c94c5ef8ddb1a687a7bcd874 (patch) | |
tree | c4ae426872560a5e070f2054072607f2578e1f7d /lib/vty.c | |
parent | f3255d1e9f062e7783b05ab5b32ca70085170d79 (diff) | |
download | quagga-9a9466f1fdad6fb6c94c5ef8ddb1a687a7bcd874.tar.bz2 quagga-9a9466f1fdad6fb6c94c5ef8ddb1a687a7bcd874.tar.xz |
Small improvements to speed of reading of configuration file.
Tidy up signalling of "ready" to command loop, and checking of
appropriate state to close written configuration file.
Diffstat (limited to 'lib/vty.c')
-rw-r--r-- | lib/vty.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -982,17 +982,21 @@ vty_read_config_file (int fd, const char* name, cmd_command first_cmd, { cmd_return_code_t ret ; vty vty ; + qtime_t taking ; vty = vty_config_read_open(fd, name, full_lex) ; vty_cmd_loop_prepare(vty) ; - zlog_info("Started reading configuration: %s", name) ; + taking = qt_get_monotonic() ; ret = cmd_read_config(vty, first_cmd, ignore_warnings) ; - zlog_info("Finished reading configuration%s", - (ret == CMD_SUCCESS) ? "." : " -- FAILED") ; + taking = (qt_get_monotonic() - taking) / (QTIME_SECOND / 1000) ; + + zlog_info("Finished reading configuration '%s' in %d.%d secs%s", + name, (int)(taking / 1000), (int)(taking % 1000), + (ret == CMD_SUCCESS) ? "." : " -- FAILED") ; vty_cmd_loop_exit(vty) ; |