summaryrefslogtreecommitdiff
path: root/lib/log.c
AgeCommit message (Collapse)Author
2004-11-282004-11-28 Andrew J. Schorr <ajschorr@alumni.princeton.edu>ajs
* log.h: Remove several unused fields from struct zlog. Add comments for other fields, and add one new field syslog_options that is used in the new syslog_sigsafe implementation. * log.c: (syslog_sigsafe) New function to send syslog messages in an async-signal safe way that can be used inside a signal handler. (syslog_connect) New function to connect to syslog daemon inside a signal handler. This function supports only systems where /dev/log is a unix datagram socket (e.g. not Solaris). (zlog_signal) Call syslog_sigsafe if syslog logging is enabled. (zlog_backtrace_sigsafe) Call syslog_sigsafe if syslog logging is enabled. (openzlog) Save syslog_options for use in syslog_sigsafe. (num_append) Fix bug: handle 0 properly. (hex_append) New function to print a u_long in hex format.
2004-11-262004-11-26 Andrew J. Schorr <ajschorr@alumni.princeton.edu>ajs
* log.c, log.h, memory.c: Change function name from zlog_backtrace_safe to the more self-explanatory zlog_backtrace_sigsafe.
2004-11-262004-11-26 Andrew J. Schorr <ajschorr@alumni.princeton.edu>ajs
* log.c: (zlog_backtrace) New function to log a backtrace. (zlog_backtrace_safe) Log a backtrace in an async-signal-safe way. Unfortunately, this function does not support syslog logging yet. (zlog_signal) Move backtrace code into separate function zlog_backtrace_safe. (_zlog_assert_failed) Call zlog_backtrace before aborting. * log.h: Declare new functions zlog_backtrace and zlog_backtrace_safe. * memory.c: (zerror) Call zlog_backtrace before aborting.
2004-11-24In zlog_signal, should probably check the return code from backtrace, justajs
to be safe.
2004-11-24In zlog_signal, change type of size since backtrace actually returns an int.ajs
2004-11-242004-11-24 Andrew J. Schorr <ajschorr@alumni.princeton.edu>ajs
* zassert.h: New header file to declare a quagga-specific assert macro. * log.c: (_zlog_assert_failed) New function called when assert fails to log the error and abort. * zebra.h: Include "zassert.h" instead of <assert.h>. * regex.c: Include "zassert.h" instead of <assert.h>. * dict.c: Include "zassert.h" instead of <assert.h>.
2004-11-232004-11-23 Andrew J. Schorr <ajschorr@alumni.princeton.edu>ajs
* sigevent.c: (signal_init) Set up some default signal handlers so that processes will issue an error message before terminating or dumping core. (trap_default_signals) New function to set up signal handlers for various signals that may kill the process. (exit_handler) Call zlog_signal, then _exit. (core_handler) Call zlog_signal, then abort. * log.h: Declare new function zlog_signal. * log.c: (zlog_signal) New function to log information about a received signal before the process dies. Try to log a backtrace also. (quagga_signal_handler,signal_set) Should be static.
2004-11-232004-11-23 Andrew J. Schorr <ajschorr@alumni.princeton.edu>ajs
* log.c: (vzlog) Take a single va_list argument and use va_copy as necessary for multiple traversals. (zlog) Pass only one va_list to vzlog. (zlog_*,plog_*) Use a macro for boilerplate code; pass only one va_list to vzlog. (zlog_set_file) Remove unused 2nd argument (flags). (zlog_save_cwd,zlog_get_cwd,zlog_free_cwd) Remove unused functions. * log.h: Remove ZLOG_*_INDEX defines (no longer used). Remove unused 2nd argument from zlog_set_file prototype. Fix prototype for zlog_rotate. * command.c: (config_log_file) Remove unused 2nd arg to zlog_set_file. * vty.c: (vty_out) Fix stdarg usage to perform multiple traversals properly. (vty_log) Must use va_copy for multiple traversals of va_list arg.
2004-11-192004-11-19 David Young <dyoung@pobox.com>ajs
* log.c: (safe_strerror) New function: safe wrapper for strerror.
2004-10-102004-10-10 Paul Jakma <paul@dishone.st>paul
* version.h.in: (pid_output*) add const qualifier. * command.h: Change DEFUN func to take const char *[] rather than char **, to begin process of fixing compile warnings in lib/. Nearly all other changes in this commit follow from this change. * buffer.{c,h}: (buffer_write) pointer-arithmetic is gccism, take const void * and cast an automatic const char *p to it. (buffer_putstr) add const * command.c: (zencrypt) const qualifier (cmd_execute_command_real) ditto (cmd_execute_command_strict) ditto (config_log_file) ditto. Fix leak of getcwd() returned string. * memory.{c,h}: Add MTYPE_DISTRIBUTE_IFNAME for struct dist ifname. * distribute.{c,h}: Update with const qualifier. (distribute_free) use MTYPE_DISTRIBUTE_IFNAME (distribute_lookup) Cast to char *, note that it's ok. (distribute_hash_alloc) use MTYPE_DISTRIBUTE_IFNAME. (distribute_get) Cast to char *, note that it's ok. * filter.c: Update with const qualifier. * if.{c,h}: ditto. * if_rmap.{c,h}: ditto. (if_rmap_lookup) Cast to char *, note that it's ok. (if_rmap_get) ditto. * log.{c,h}: Update with const qualifier. * plist.{c,h}: ditto. * routemap.{c,h}: ditto. * smux.{c,h}: ditto. Fix some signed/unsigned comparisons. * sockopt.c: (getsockopt_cmsg_data) add return for error case. * vty.c: Update with const qualifier.
2004-10-05Number of warnings is down to 3 again in lib directory. A lot of const'shasso
added to strings and a lot of int -> unsigned int changes.
2004-10-04First small part of lib cleanup. Mainly "constification" of arguments andhasso
adding FIXME's.
2003-12-23Merge isisd into the Quagga's framework:jardin
- add privs support - use misc quagga's definitions - make it compile"able" - fix segfault cases related to hostname() - add debug isis xxx command This patch has been approved by Paul Jakma.
2003-12-222003-12-22 Christian Hammers <ch@lathspell.de>gdt
* configure.ac (and everywhere a regular file is opened for writing): use file permissions from configure rather than compiled-in umask.
2003-07-262003-07-26 Paul Jakma <paul@dishone.st>paul
* lib/command.c: Add config_log_syslog_facility_cmd, to set syslog facility. This was a commit to zebra.org on May 20, merge in to zebra-pj.
2002-12-13Initial revisionpaul