mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 09:03:34 +08:00
Always use FILE* for standard output.
The threads running commands for clients through the Posix daemon used to write to a char buffer through snprintf (etc.) which was then written directly to the file descriptor, whereas in the other case printf (etc.) was used to write to stdout (FILE*). Both versions used some macro's and repeated code to have the same output. This change unifies these two cases by using a FILE* in both cases. The (line) buffering is done by the standard C library's implementation (just like with stdout), and px4_log.c now uses the same code in all cases (using fprintf, etc.) for printing (colored) output.
This commit is contained in:
@@ -37,6 +37,7 @@
|
||||
#include <sys/stat.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <uORB/topics/vehicle_gps_position.h>
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "../uORB.h"
|
||||
#include <px4_time.h>
|
||||
#include <px4_tasks.h>
|
||||
#include <unistd.h>
|
||||
|
||||
struct orb_test {
|
||||
int val;
|
||||
|
||||
Reference in New Issue
Block a user