plugins/in_tail/tail_scan_win32.c
/*
 * This function is a thin wrapper over flb_tail_file_append(),
 * adding normalization and sanity checks on top of it.
 */
This function is a thin wrapper over flb_tail_file_append(),
adding normalization and sanity checks on top of it.
This function is a thin wrapper over flb_tail_file_append () adding normalization and sanity checks on top of it .
static int tail_register_file(const char *target, struct flb_tail_config *ctx)
{
    struct stat st;
    char path[MAX_PATH];
    if (_fullpath(path, target, MAX_PATH) == NULL) {
        flb_plg_error(ctx->ins, "cannot get absolute path of %s", target);
        return -1;
    }
    if (stat(path, &st) != 0 || !S_ISREG(st.st_mode)) {
        return -1;
    }
    if (tail_is_excluded(path, ctx) == FLB_TRUE) {
        flb_plg_trace(ctx->ins, "skip '%s' (excluded)", path);
        return -1;
    }
    if (flb_tail_file_exists(path, ctx) == FLB_TRUE) {
        return -1;
    }
    return flb_tail_file_append(path, &st, FLB_TAIL_STATIC, ctx);
}
static int tail_register_file ( const char * target , struct flb_tail_config * ctx ) { struct stat st ; char path [ MAX_PATH ] ; if ( _fullpath ( path , target , MAX_PATH ) == NULL ) { flb_plg_error ( ctx -> ins , " " , target ) ; return -1 ; } if ( stat ( path , & st ) != 0 || ! S_ISREG ( st . st_mode ) ) { return -1 ; } if ( tail_is_excluded ( path , ctx ) == FLB_TRUE ) { flb_plg_trace ( ctx -> ins , " " , path ) ; return -1 ; } if ( flb_tail_file_exists ( path , ctx ) == FLB_TRUE ) { return -1 ; } return flb_tail_file_append ( path , & st , FLB_TAIL_STATIC , ctx ) ; }
This function is a thin wrapper over flb_tail_file_append(),
 adding normalization and sanity checks on top of it.
This function is a thin wrapper over flb_tail_file_append () adding normalization and sanity checks on top of it .