summaryrefslogtreecommitdiff
path: root/usrbin/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'usrbin/main.c')
-rw-r--r--usrbin/main.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/usrbin/main.c b/usrbin/main.c
index d1e3adc..a545a11 100644
--- a/usrbin/main.c
+++ b/usrbin/main.c
@@ -11,19 +11,20 @@ void sighandler(int sig) {
void pid1(void) {
ssize_t in;
- char buf[2] = { 0, 0 };
+ char buf[2] = { 0, };
printf("We did it ma!\n");
signal(1, &sighandler);
while(1) {
in = read(buf, 1);
- if(in <= 0) {
+ if(in < 1) {
if(in == -EINTR) {
printf("Read call interrupted!\n");
- kill(getpid(), SIGKILL);
+ /* kill(getpid(), SIGKILL); */
} else {
- pause();
+ printf("Error reading from serial port!\n");
+ kill(getpid(), SIGKILL);
}
}
if(in > 0)