diff options
author | Philip Balister <philip@balister.org> | 2010-05-07 19:23:58 +0000 |
---|---|---|
committer | root <root@usrp1-e.lan> | 2010-05-07 19:25:42 +0000 |
commit | b47920906bd1b0480bbcd8427b2d703889cb78e3 (patch) | |
tree | 42b01435ff59407af1fe0684b30414355637cf21 /host/apps/omap_debug/usrp-e-spi.c | |
parent | 272b08ce9a66b3ba1b9dc91922afff410145231f (diff) | |
download | uhd-b47920906bd1b0480bbcd8427b2d703889cb78e3.tar.gz uhd-b47920906bd1b0480bbcd8427b2d703889cb78e3.tar.bz2 uhd-b47920906bd1b0480bbcd8427b2d703889cb78e3.zip |
Print an error and exit if open fails for some programs.
Diffstat (limited to 'host/apps/omap_debug/usrp-e-spi.c')
-rw-r--r-- | host/apps/omap_debug/usrp-e-spi.c | 7 |
1 files changed, 7 insertions, 0 deletions
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; |