~damg/ubuntu/quantal/asterisk/LP1097687

« back to all changes in this revision

Viewing changes to main/logger.c

  • Committer: Bazaar Package Importer
  • Author(s): Lorenzo De Liso
  • Date: 2010-10-15 22:24:34 UTC
  • mfrom: (1.2.8 upstream) (8.3.8 sid)
  • Revision ID: james.westby@ubuntu.com-20101015222434-iy328q8in3lajzlv
Tags: 1:1.6.2.9-2ubuntu1
* Merge from debian unstable, remaining changes:
  - debian/control:
    + Build-depend on hardening-wrapper
    + Change Maintainer
    + Removed Uploaders field.
    + Removed Debian Vcs-Svn entry and replaced with ubuntu-voip Vcs-Bzr,
      to reflect divergence in packages.
  - debian/rules: Make use of hardening-wrapper
  - debian/asterisk.init: chown /dev/dahdi
  - debian/backports/hardy: add file
  - debian/backports/asterisk.init.hardy: add file
 

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
#define _ASTERISK_LOGGER_H
34
34
#include "asterisk.h"
35
35
 
36
 
ASTERISK_FILE_VERSION(__FILE__, "$Revision: 248643 $")
 
36
ASTERISK_FILE_VERSION(__FILE__, "$Revision: 269747 $")
37
37
 
38
38
/*
39
39
 * WARNING: additional #include directives should NOT be placed here, they 
737
737
 
738
738
        switch (cmd) {
739
739
        case CLI_INIT:
740
 
                e->command = "logger set level";
 
740
                e->command = "logger set level {DEBUG|NOTICE|WARNING|ERROR|VERBOSE|DTMF} {on|off}";
741
741
                e->usage = 
742
 
                        "Usage: logger set level\n"
 
742
                        "Usage: logger set level {DEBUG|NOTICE|WARNING|ERROR|VERBOSE|DTMF} {on|off}\n"
743
743
                        "       Set a specific log level to enabled/disabled for this console.\n";
744
744
                return NULL;
745
745
        case CLI_GENERATE:
827
827
        AST_CLI_DEFINE(handle_logger_set_level, "Enables/Disables a specific logging level for this console")
828
828
};
829
829
 
830
 
static int handle_SIGXFSZ(int sig) 
 
830
static void _handle_SIGXFSZ(int sig)
831
831
{
832
832
        /* Indicate need to reload */
833
833
        filesize_reload_needed = 1;
834
 
        return 0;
835
834
}
836
835
 
 
836
static struct sigaction handle_SIGXFSZ = {
 
837
        .sa_handler = _handle_SIGXFSZ,
 
838
        .sa_flags = SA_RESTART,
 
839
};
 
840
 
837
841
static void ast_log_vsyslog(int level, const char *file, int line, const char *function, char *str, long pid)
838
842
{
839
843
        char buf[BUFSIZ];
1007
1011
        int res = 0;
1008
1012
 
1009
1013
        /* auto rotate if sig SIGXFSZ comes a-knockin */
1010
 
        (void) signal(SIGXFSZ, (void *) handle_SIGXFSZ);
 
1014
        sigaction(SIGXFSZ, &handle_SIGXFSZ, NULL);
1011
1015
 
1012
1016
        /* start logger thread */
1013
1017
        ast_cond_init(&logcond, NULL);