diff options
author | James Maki <jmaki@multitech.com> | 2010-05-17 14:12:06 -0500 |
---|---|---|
committer | James Maki <jmaki@multitech.com> | 2010-05-17 14:12:06 -0500 |
commit | f1b137da46178ff963506db378560023d272e97a (patch) | |
tree | 1d930d338061495e9310750fe7a01c6d5ef2e064 /src | |
parent | af14ef923a8e6ae46d6e654719c444f87e9da9d9 (diff) | |
parent | 5dea7f5f748ebee66673d470c3c183ff76b032c1 (diff) | |
download | venus-gps-f1b137da46178ff963506db378560023d272e97a.tar.gz venus-gps-f1b137da46178ff963506db378560023d272e97a.tar.bz2 venus-gps-f1b137da46178ff963506db378560023d272e97a.zip |
Merge branch 'master' of git@git.multitech.net:venus-gps
Diffstat (limited to 'src')
-rw-r--r-- | src/venus_api.c | 5 | ||||
-rw-r--r-- | src/venus_api.h | 1 | ||||
-rw-r--r-- | src/venus_gps.c | 12 |
3 files changed, 12 insertions, 6 deletions
diff --git a/src/venus_api.c b/src/venus_api.c index ea5a6bc..04ad78d 100644 --- a/src/venus_api.c +++ b/src/venus_api.c @@ -502,6 +502,11 @@ int venus_tty_configure(int fd, speed_t baud_rate) return 0; } +int venus_close(int fd) +{ + return close(fd); +} + int venus_open(const char *dev, speed_t baud_rate) { int tty; diff --git a/src/venus_api.h b/src/venus_api.h index 8212487..75acc7a 100644 --- a/src/venus_api.h +++ b/src/venus_api.h @@ -98,6 +98,7 @@ int venus_conf_nmea(int fd, uint8_t gga, uint8_t gsa, uint8_t gsv, uint8_t gll, uint8_t rmc, uint8_t vtg, uint8_t zda, uint8_t attr); int venus_tty_configure(int fd, speed_t baud_rate); +int venus_close(int fd); int venus_open(const char *dev, speed_t baud_rate); #endif /* ~__VENUS_API_H */ diff --git a/src/venus_gps.c b/src/venus_gps.c index 1136d07..28491f7 100644 --- a/src/venus_gps.c +++ b/src/venus_gps.c @@ -199,8 +199,8 @@ static int gps_to_udp_client(const char *host, int port) udp_send_msgs(sd, tty); + venus_close(tty); close(sd); - close(tty); } } @@ -229,8 +229,8 @@ static int gps_to_tcp_client(const char *host, int port) exchange_data(sd, tty); + venus_close(tty); close(sd); - close(tty); } } @@ -299,8 +299,8 @@ static int gps_to_tcp_server(int port) exchange_data(sd, tty); + venus_close(tty); close(sd); - close(tty); } } @@ -335,7 +335,7 @@ static int gps_to_file(const char *file) exchange_data(fd, tty); - close(tty); + venus_close(tty); } return -1; @@ -383,7 +383,7 @@ int gps_to_serial(const char *port) exchange_data(fd, tty); - close(tty); + venus_close(tty); } return -1; @@ -765,7 +765,7 @@ int main(int argc, char *argv[]) exit(1); } - close(tty); + venus_close(tty); /* * FIXME: Support more than one mode at a time |