aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXiao Pan <xyz@flylightning.xyz>2025-05-07 20:21:50 -0700
committerXiao Pan <xyz@flylightning.xyz>2025-05-07 20:21:50 -0700
commita936ca5d68aa04a906796399958a55cb1f65bc84 (patch)
tree13a019996aae0bd0b79349dd96891c75b83fff42
parent44fc375416ea3690416f17cb5f1433c08e939cb3 (diff)
fix: need fflush for systemd to log my stdout
-rw-r--r--mycan.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/mycan.c b/mycan.c
index 59e49b2..efaafb4 100644
--- a/mycan.c
+++ b/mycan.c
@@ -112,6 +112,10 @@ int main(int argc, char **argv)
else
break;
}
+ // need fflush for systemd to log my stdout
+ // https://unix.stackexchange.com/questions/725331
+ // https://unix.stackexchange.com/questions/785686
+ fflush(stdout);
//1.Create socket
s = socket(PF_CAN, SOCK_RAW, CAN_RAW);