Now that we have xopen3(), it's just plain unclean to have xopen() with
[oweals/busybox.git] / miscutils / rx.c
index cff5a627bacf45b05324a9a3b5144b1a3d705d90..4cc4913e6ba7de13f165dd2eee6599b17d49bd3e 100644 (file)
  */
 
 #include "busybox.h"
-#include <stdlib.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <errno.h>
-#include <termios.h>
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <string.h>
-
 
 #define SOH 0x01
 #define STX 0x02
@@ -212,7 +200,7 @@ static int receive(char *error_buf, size_t error_buf_size,
                wantBlockNo++;
                length += blockLength;
 
-               if (bb_full_write(filefd, blockBuf, blockLength) < 0) {
+               if (full_write(filefd, blockBuf, blockLength) < 0) {
                        note_error("write to file failed: %m");
                        goto fatal;
                }
@@ -274,8 +262,8 @@ int rx_main(int argc, char **argv)
                        bb_show_usage();
 
        fn = argv[1];
-       ttyfd = bb_xopen3(CURRENT_TTY, O_RDWR, 0);
-       filefd = bb_xopen3(fn, O_RDWR|O_CREAT|O_TRUNC, 0666);
+       ttyfd = xopen3(CURRENT_TTY, O_RDWR, 0);
+       filefd = 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]);