mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 07:12:09 +00:00
perf tools: Replace error() with pr_err()
To consolidate the error reporting facility. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/n/tip-b41iot1094katoffdf19w9zk@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
b211d79ac1
commit
62d94b00f8
11 changed files with 28 additions and 42 deletions
|
@ -28,15 +28,9 @@ static __noreturn void die_builtin(const char *err, va_list params)
|
|||
exit(128);
|
||||
}
|
||||
|
||||
static void error_builtin(const char *err, va_list params)
|
||||
{
|
||||
report(" Error: ", err, params);
|
||||
}
|
||||
|
||||
/* If we are in a dlopen()ed .so write to a global variable would segfault
|
||||
* (ugh), so keep things static. */
|
||||
static void (*usage_routine)(const char *err) __noreturn = usage_builtin;
|
||||
static void (*error_routine)(const char *err, va_list params) = error_builtin;
|
||||
|
||||
void usage(const char *err)
|
||||
{
|
||||
|
@ -51,13 +45,3 @@ void die(const char *err, ...)
|
|||
die_builtin(err, params);
|
||||
va_end(params);
|
||||
}
|
||||
|
||||
int error(const char *err, ...)
|
||||
{
|
||||
va_list params;
|
||||
|
||||
va_start(params, err);
|
||||
error_routine(err, params);
|
||||
va_end(params);
|
||||
return -1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue