forked from glidernet/ogn-rf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
debian: Import patch from PR glidernet#19
- Loading branch information
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
debian/patches/0001-ogn-rf-Detect-if-stdin-is-a-terminal.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
From 09cc5b1fa1186b2f185cea54c47312f2595633e3 Mon Sep 17 00:00:00 2001 | ||
From: "Fabian P. Schmidt" <[email protected]> | ||
Date: Fri, 10 Feb 2017 02:08:22 +0100 | ||
Subject: [PATCH] ogn-rf: Detect if stdin is a terminal | ||
|
||
Fixes #11: Version 0.2.5 crashs with SEGV if invoked by systemd. | ||
--- | ||
src/ogn-rf.cc | 15 +++++++++++---- | ||
1 file changed, 11 insertions(+), 4 deletions(-) | ||
|
||
diff --git a/src/ogn-rf.cc b/src/ogn-rf.cc | ||
index c9baead..5147a09 100644 | ||
--- a/src/ogn-rf.cc | ||
+++ b/src/ogn-rf.cc | ||
@@ -1055,10 +1055,17 @@ int main(int argc, char *argv[]) | ||
GSM.Start(); | ||
RF.Start(); | ||
|
||
- char Cmd[128]; | ||
- while(!RF.StopReq) | ||
- { if(fgets(Cmd, 128, stdin)==0) break; | ||
- UserCommand(Cmd); } | ||
+ if (isatty(fileno(stdin))) { | ||
+ char Cmd[128]; | ||
+ while(!RF.StopReq) { | ||
+ if(fgets(Cmd, 128, stdin)==0) break; | ||
+ UserCommand(Cmd); | ||
+ } | ||
+ } else { | ||
+ while(!RF.StopReq) { | ||
+ sleep(1); | ||
+ } | ||
+ } | ||
|
||
sleep(4); | ||
RF.Stop(); | ||
-- | ||
2.1.4 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters