mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-06 12:08:52 +08:00
getprogname: rename to px4_get_taskname
This commit is contained in:
@@ -67,7 +67,7 @@ static void
|
||||
warnerr_core(int errcode, const char *fmt, va_list args)
|
||||
{
|
||||
#if CONFIG_NFILE_STREAMS > 0
|
||||
fprintf(stderr, "%s: ", getprogname());
|
||||
fprintf(stderr, "%s: ", px4_get_taskname());
|
||||
vfprintf(stderr, fmt, args);
|
||||
|
||||
/* convenience as many parts of NuttX use negative errno */
|
||||
@@ -81,7 +81,7 @@ warnerr_core(int errcode, const char *fmt, va_list args)
|
||||
|
||||
fprintf(stderr, "\n");
|
||||
#elif CONFIG_ARCH_LOWPUTC
|
||||
lowsyslog("%s: ", getprogname());
|
||||
lowsyslog("%s: ", px4_get_taskname());
|
||||
lowvsyslog(fmt, args);
|
||||
|
||||
/* convenience as many parts of NuttX use negative errno */
|
||||
|
||||
@@ -108,7 +108,7 @@ int px4_task_delete(int pid)
|
||||
return task_delete(pid);
|
||||
}
|
||||
|
||||
const char *getprogname(void)
|
||||
const char *px4_get_taskname(void)
|
||||
{
|
||||
#if CONFIG_TASK_NAME_SIZE > 0
|
||||
FAR struct tcb_s *thisproc = sched_self();
|
||||
|
||||
@@ -388,7 +388,7 @@ unsigned long px4_getpid()
|
||||
return (unsigned long)pthread_self();
|
||||
}
|
||||
|
||||
const char *getprogname()
|
||||
const char *px4_get_taskname()
|
||||
{
|
||||
pthread_t pid = pthread_self();
|
||||
const char *prog_name = "UnknownApp";
|
||||
|
||||
@@ -134,7 +134,8 @@ __EXPORT bool px4_task_is_running(const char *taskname);
|
||||
__EXPORT int px4_prctl(int option, const char *arg2, unsigned pid);
|
||||
#endif
|
||||
|
||||
__EXPORT const char *getprogname(void);
|
||||
/** return the name of the current task */
|
||||
__EXPORT const char *px4_get_taskname(void);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
|
||||
@@ -348,7 +348,7 @@ unsigned long px4_getpid()
|
||||
}
|
||||
|
||||
|
||||
const char *getprogname()
|
||||
const char *px4_get_taskname()
|
||||
{
|
||||
pthread_t pid = pthread_self();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user