From b47920906bd1b0480bbcd8427b2d703889cb78e3 Mon Sep 17 00:00:00 2001 From: Philip Balister Date: Fri, 7 May 2010 19:23:58 +0000 Subject: Print an error and exit if open fails for some programs. --- host/apps/omap_debug/usrp-e-spi.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'host/apps/omap_debug/usrp-e-spi.c') diff --git a/host/apps/omap_debug/usrp-e-spi.c b/host/apps/omap_debug/usrp-e-spi.c index d2c38e524..c353c409b 100644 --- a/host/apps/omap_debug/usrp-e-spi.c +++ b/host/apps/omap_debug/usrp-e-spi.c @@ -28,6 +28,13 @@ int main(int argc, char *argv[]) fp = open("/dev/usrp_e0", O_RDWR); printf("fp = %d\n", fp); + if (fp < 0) { + perror("Open failed"); + return -1; + } + +// sleep(1); + spi_dat.slave = slave; spi_dat.data = data; -- cgit v1.2.3