openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/libnl/1_3.4.0-r0/libnl-3.4.0/src/lib/utils.c
void nl_cli_fatal(int err, const char* fmt, ...)
{
    va_list ap;

    fprintf(stderr, "Error: ");

    if (fmt)
    {
        va_start(ap, fmt);
        vfprintf(stderr, fmt, ap);
        va_end(ap);
        fprintf(stderr, "\n");
    }
    else
    {
        char* buf;
#ifdef HAVE_STRERROR_L
        locale_t loc = newlocale(LC_MESSAGES_MASK, "", (locale_t)0);
        if (loc == (locale_t)0)
        {
            if (errno == ENOENT)
                loc = newlocale(LC_MESSAGES_MASK, "POSIX", (locale_t)0);
            if (loc == (locale_t)0)
                buf = "newlocale() failed";
        }
        if (loc != (locale_t)0)
            buf = strerror_l(err, loc);
#else
        buf = strerror(err);
#endif
        fprintf(stderr, "%s\n", buf);
#ifdef HAVE_STRERROR_L
        if (loc != (locale_t)0)
            freelocale(loc);
#endif
    }

    exit(abs(err));
}
/**
 * Print error message and quit application
 * @arg err		Error code.
 * @arg fmt		Error message.
 *
 * Prints the formatted error message to stderr and quits the application
 * using the provided error code.
 */
Print error message and quit application
@arg err             Error code.
@arg fmt             Error message.

Prints the formatted error message to stderr and quits the application
using the provided error code.
Print error message and quit application @arg err Error code . @arg fmt Error message . Prints the formatted error message to stderr and quits the application using the provided error code .
void nl_cli_fatal(int err, const char* fmt, ...)
{
    va_list ap;
    fprintf(stderr, "Error: ");
    if (fmt)
    {
        va_start(ap, fmt);
        vfprintf(stderr, fmt, ap);
        va_end(ap);
        fprintf(stderr, "\n");
    }
    else
    {
        char* buf;
#ifdef HAVE_STRERROR_L
        locale_t loc = newlocale(LC_MESSAGES_MASK, "", (locale_t)0);
        if (loc == (locale_t)0)
        {
            if (errno == ENOENT)
                loc = newlocale(LC_MESSAGES_MASK, "POSIX", (locale_t)0);
            if (loc == (locale_t)0)
                buf = "newlocale() failed";
        }
        if (loc != (locale_t)0)
            buf = strerror_l(err, loc);
#else
        buf = strerror(err);
#endif
        fprintf(stderr, "%s\n", buf);
#ifdef HAVE_STRERROR_L
        if (loc != (locale_t)0)
            freelocale(loc);
#endif
    }
    exit(abs(err));
}
void nl_cli_fatal ( int err , const char * fmt , ... ) { va_list ap ; fprintf ( stderr , " " ) ; if ( fmt ) { va_start ( ap , fmt ) ; vfprintf ( stderr , fmt , ap ) ; va_end ( ap ) ; fprintf ( stderr , " \n " ) ; } else { char * buf ; #ifdef HAVE_STRERROR_L locale_t loc = newlocale ( LC_MESSAGES_MASK , " " , ( locale_t ) 0 ) ; if ( loc == ( locale_t ) 0 ) { if ( errno == ENOENT ) loc = newlocale ( LC_MESSAGES_MASK , " " , ( locale_t ) 0 ) ; if ( loc == ( locale_t ) 0 ) buf = " " ; } if ( loc != ( locale_t ) 0 ) buf = strerror_l ( err , loc ) ; #else buf = strerror ( err ) ; #endif fprintf ( stderr , " \n " , buf ) ; #ifdef HAVE_STRERROR_L if ( loc != ( locale_t ) 0 ) freelocale ( loc ) ; #endif } exit ( abs ( err ) ) ; }
Print error message and quit application
 @arg err             Error code.
Print error message and quit application @arg err Error code .