openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/util-linux/2.33.2-r0/util-linux-2.33.2/sys-utils/dmesg.c
static const char* parse_syslog_timestamp(const char* str0, struct timeval* tv)
{
    const char* str = str0;
    char* end = NULL;

    if (!str0)
        return str0;

    errno = 0;
    tv->tv_sec = strtol(str, &end, 10);

    if (!errno && end && *end == '.' && *(end + 1))
    {
        str = end + 1;
        end = NULL;
        tv->tv_usec = strtol(str, &end, 10);
    }
    if (errno || !end || end == str || *end != ']')
        return str0;

    return end + 1; /* skip ']' */
}
/*
 * Parses timestamp from syslog message prefix, expected format:
 *
 *	seconds.microseconds]
 *
 * the ']' is the timestamp field terminator.
 */
Parses timestamp from syslog message prefix, expected format:
seconds.microseconds]

the ']' is the timestamp field terminator.
Parses timestamp from syslog message prefix expected format : seconds . microseconds ] the ' ] ' is the timestamp field terminator .
static const char* parse_syslog_timestamp(const char* str0, struct timeval* tv)
{
    const char* str = str0;
    char* end = NULL;
    if (!str0)
        return str0;
    errno = 0;
    tv->tv_sec = strtol(str, &end, 10);
    if (!errno && end && *end == '.' && *(end + 1))
    {
        str = end + 1;
        end = NULL;
        tv->tv_usec = strtol(str, &end, 10);
    }
    if (errno || !end || end == str || *end != ']')
        return str0;
    return end + 1; 
}
static const char * parse_syslog_timestamp ( const char * str0 , struct timeval * tv ) { const char * str = str0 ; char * end = NULL ; if ( ! str0 ) return str0 ; errno = 0 ; tv -> tv_sec = strtol ( str , & end , 10 ) ; if ( ! errno && end && * end == ' ' && * ( end + 1 ) ) { str = end + 1 ; end = NULL ; tv -> tv_usec = strtol ( str , & end , 10 ) ; } if ( errno || ! end || end == str || * end != ' ' ) return str0 ; return end + 1 ; }
Parses timestamp from syslog message prefix, expected format:
      seconds.microseconds]
Parses timestamp from syslog message prefix expected format : seconds . microseconds ]
/* skip ']' */