aboutsummaryrefslogtreecommitdiffstats
path: root/lcd4linux.c
diff options
context:
space:
mode:
authorreinelt <>2003-10-22 04:19:16 +0000
committerreinelt <>2003-10-22 04:19:16 +0000
commit78db54efea1a7af36a2f02d8c960f17297386d98 (patch)
treec6e95b153eca7b102da2f6c987f42594b329f47e /lcd4linux.c
parent4f5395938002f624502fd7afba7dfa3b3ee8433d (diff)
downloadlcd4linux-78db54efea1a7af36a2f02d8c960f17297386d98.tar.gz
[lcd4linux @ 2003-10-22 04:19:16 by reinelt]
Makefile.in for imon.c/.h, some MatrixOrbital clients
Diffstat (limited to 'lcd4linux.c')
-rw-r--r--lcd4linux.c29
1 files changed, 17 insertions, 12 deletions
diff --git a/lcd4linux.c b/lcd4linux.c
index 9af5a6a..271373e 100644
--- a/lcd4linux.c
+++ b/lcd4linux.c
@@ -1,4 +1,4 @@
-/* $Id: lcd4linux.c,v 1.49 2003/10/11 06:01:53 reinelt Exp $
+/* $Id: lcd4linux.c,v 1.50 2003/10/22 04:19:16 reinelt Exp $
*
* LCD4Linux
*
@@ -22,6 +22,9 @@
*
*
* $Log: lcd4linux.c,v $
+ * Revision 1.50 2003/10/22 04:19:16 reinelt
+ * Makefile.in for imon.c/.h, some MatrixOrbital clients
+ *
* Revision 1.49 2003/10/11 06:01:53 reinelt
*
* renamed expression.{c,h} to client.{c,h}
@@ -495,12 +498,6 @@ int main (int argc, char *argv[])
exit (1);
}
- // now install our own signal handler
- signal(SIGHUP, handler);
- signal(SIGINT, handler);
- signal(SIGQUIT, handler);
- signal(SIGTERM, handler);
-
// process_init sets global vars tick, tack
process_init();
@@ -512,11 +509,13 @@ int main (int argc, char *argv[])
printf("\neval> ");
for(fgets(line, 1024, stdin); !feof(stdin); fgets(line, 1024, stdin)) {
if (line[strlen(line)-1]=='\n') line[strlen(line)-1]='\0';
- Eval(line, &result);
- if (result.type==R_NUMBER) {
- printf ("%g\n", R2N(&result));
- } else if (result.type==R_STRING) {
- printf ("'%s'\n", R2S(&result));
+ if (strlen(line)>0) {
+ Eval(line, &result);
+ if (result.type==R_NUMBER) {
+ printf ("%g\n", R2N(&result));
+ } else if (result.type==R_STRING) {
+ printf ("'%s'\n", R2S(&result));
+ }
}
printf("eval> ");
}
@@ -534,6 +533,12 @@ int main (int argc, char *argv[])
debug ("starting main loop");
+ // now install our own signal handler
+ signal(SIGHUP, handler);
+ signal(SIGINT, handler);
+ signal(SIGQUIT, handler);
+ signal(SIGTERM, handler);
+
while (got_signal==0) {
process ();
usleep(tack*1000);