From: Nils Faerber Date: Sun, 2 Jan 2011 00:54:07 +0000 (+0100) Subject: some cleanups in reading X-Git-Url: https://git.kernelconcepts.de/?p=rdstmc.git;a=commitdiff_plain;h=d4f8c46bc4a5cad443611ac86bfe0a83a9d1b49b some cleanups in reading --- diff --git a/decoder/rds.c b/decoder/rds.c index 27a417c..bdaee7b 100644 --- a/decoder/rds.c +++ b/decoder/rds.c @@ -95,9 +95,11 @@ unsigned char offset; rb = read(rds_fd, rbuf, 3); if (rb <= 0) - exit(0); // just for testing - if (rb != 3) + return 0; + if (rb != 3) { printf("#read err rb=%d\n", rb); + return 0; + } block = rbuf[0] | (rbuf[1] << 8); offset = rbuf[2] & 0x07; @@ -124,6 +126,7 @@ unsigned char offset; } if (OutputFlags & RDS_RECEIVE_INDICATOR) printf("."); + return 0; }