mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-12-02 06:10:45 +08:00
Exit top on read failure
This commit is contained in:
1 parent
8f37e02c59
commit
04b491c365
1 file changed
+5
-1
@@ -89,7 +89,11 @@ top_main(int argc, char *argv[])
|
||||
|
||||
if (ret > 0) {
|
||||
|
||||
read(0, &c, 1);
|
||||
ret = read(0, &c, 1);
|
||||
|
||||
if (ret) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
switch (c) {
|
||||
case 0x03: // ctrl-c
|
||||
|
||||
Reference in new issue
Block a user