src/modules/logwatch_source.c
changeset 133 e2d0c0c23b39
parent 132 f2ece471fb07
child 157 1e5674d0eec4
equal deleted inserted replaced
132:f2ece471fb07 133:e2d0c0c23b39
    13 }
    13 }
    14 
    14 
    15 void logwatch_source_on_error (struct error_info *err, void *arg)
    15 void logwatch_source_on_error (struct error_info *err, void *arg)
    16 {
    16 {
    17     struct logwatch_source *source = arg;
    17     struct logwatch_source *source = arg;
    18 
       
    19     (void) source;
       
    20     
    18     
    21     // XXX: complain more loudly
    19     // notify
    22     log_error("%s", error_msg(err));
    20     logwatch_on_error(source->ctx, source, err);
    23 
    21 
    24     // drop it
    22     // drop it
    25     logwatch_source_destroy(source);
    23     logwatch_source_destroy(source);
    26 }
    24 }
    27 
    25 
    44 }
    42 }
    45 
    43 
    46 /**
    44 /**
    47  * Initialize with the given sock
    45  * Initialize with the given sock
    48  */
    46  */
    49 err_t logwatch_source_init (struct logwatch_source *source, struct logwatch *ctx, const char *name, struct sock_stream *stream, struct error_info *err)
    47 static err_t logwatch_source_init (struct logwatch_source *source, struct logwatch *ctx, const char *name, struct sock_stream *stream, struct error_info *err)
    50 {
    48 {
    51     // duplicate name?
    49     // duplicate name?
    52     if (logwatch_source_lookup(ctx, name))
    50     if (logwatch_source_lookup(ctx, name))
    53         return SET_ERROR(err, ERR_DUP_NAME);
    51         return SET_ERROR(err, ERR_DUP_NAME);
    54 
    52