diff options
author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2006-04-13 12:45:04 +0000 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2006-04-13 12:45:04 +0000 |
commit | c2cb0f32b44a9918364af39c24b5643388c553f6 (patch) | |
tree | 378b5a002da81f8622913cc6a9aeac873e307ec9 /miscutils/rx.c | |
parent | 4f3d2deaa499af34c22a7f9be121131b0a5894b5 (diff) | |
download | busybox-w32-c2cb0f32b44a9918364af39c24b5643388c553f6.tar.gz busybox-w32-c2cb0f32b44a9918364af39c24b5643388c553f6.tar.bz2 busybox-w32-c2cb0f32b44a9918364af39c24b5643388c553f6.zip |
- patch from Denis Vlasenko to add and use bb_xopen3()
Diffstat (limited to 'miscutils/rx.c')
-rw-r--r-- | miscutils/rx.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/miscutils/rx.c b/miscutils/rx.c index c7e82ead5..3df461349 100644 --- a/miscutils/rx.c +++ b/miscutils/rx.c | |||
@@ -1,3 +1,4 @@ | |||
1 | /* vi: set sw=4 ts=4: */ | ||
1 | /*------------------------------------------------------------------------- | 2 | /*------------------------------------------------------------------------- |
2 | * Filename: xmodem.c | 3 | * Filename: xmodem.c |
3 | * Version: $Id: rx.c,v 1.2 2004/03/15 08:28:46 andersen Exp $ | 4 | * 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) | |||
289 | bb_show_usage(); | 290 | bb_show_usage(); |
290 | 291 | ||
291 | fn = argv[1]; | 292 | fn = argv[1]; |
292 | ttyfd = open("/dev/tty", O_RDWR); | 293 | ttyfd = bb_xopen3("/dev/tty", O_RDWR, 0); |
293 | if (ttyfd < 0) | 294 | filefd = bb_xopen3(fn, O_RDWR|O_CREAT|O_TRUNC, 0666); |
294 | bb_error_msg_and_die("%s: open on /dev/tty failed: %m\n", argv[0]); | ||
295 | |||
296 | filefd = open(fn, O_RDWR|O_CREAT|O_TRUNC, 0666); | ||
297 | if (filefd < 0) | ||
298 | bb_error_msg_and_die("%s: open on %s failed: %m\n", argv[0], fn); | ||
299 | 295 | ||
300 | if (tcgetattr(ttyfd, &tty) < 0) | 296 | if (tcgetattr(ttyfd, &tty) < 0) |
301 | bb_error_msg_and_die("%s: tcgetattr failed: %m\n", argv[0]); | 297 | bb_error_msg_and_die("%s: tcgetattr failed: %m\n", argv[0]); |