summaryrefslogtreecommitdiff
path: root/miscutils/rx.c
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer2006-04-13 12:45:04 +0000
committerBernhard Reutner-Fischer2006-04-13 12:45:04 +0000
commitc2cb0f32b44a9918364af39c24b5643388c553f6 (patch)
tree378b5a002da81f8622913cc6a9aeac873e307ec9 /miscutils/rx.c
parent4f3d2deaa499af34c22a7f9be121131b0a5894b5 (diff)
downloadbusybox-c2cb0f32b44a9918364af39c24b5643388c553f6.zip
busybox-c2cb0f32b44a9918364af39c24b5643388c553f6.tar.gz
- patch from Denis Vlasenko to add and use bb_xopen3()
Diffstat (limited to 'miscutils/rx.c')
-rw-r--r--miscutils/rx.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/miscutils/rx.c b/miscutils/rx.c
index c7e82ea..3df4613 100644
--- a/miscutils/rx.c
+++ b/miscutils/rx.c
@@ -1,3 +1,4 @@
+/* vi: set sw=4 ts=4: */
/*-------------------------------------------------------------------------
* Filename: xmodem.c
* Version: $Id: rx.c,v 1.2 2004/03/15 08:28:46 andersen Exp $
@@ -289,13 +290,8 @@ int rx_main(int argc, char **argv)
bb_show_usage();
fn = argv[1];
- ttyfd = open("/dev/tty", O_RDWR);
- if (ttyfd < 0)
- bb_error_msg_and_die("%s: open on /dev/tty failed: %m\n", argv[0]);
-
- filefd = open(fn, O_RDWR|O_CREAT|O_TRUNC, 0666);
- if (filefd < 0)
- bb_error_msg_and_die("%s: open on %s failed: %m\n", argv[0], fn);
+ ttyfd = bb_xopen3("/dev/tty", O_RDWR, 0);
+ filefd = bb_xopen3(fn, O_RDWR|O_CREAT|O_TRUNC, 0666);
if (tcgetattr(ttyfd, &tty) < 0)
bb_error_msg_and_die("%s: tcgetattr failed: %m\n", argv[0]);