projects
/
oweals
/
busybox.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ifconfig: code shrink
[oweals/busybox.git]
/
miscutils
/
rx.c
diff --git
a/miscutils/rx.c
b/miscutils/rx.c
index 91606ecd0cc4b0fbc738a1ca258479b6436a76d0..898703c592a377a80361e54955934048be271f44 100644
(file)
--- a/
miscutils/rx.c
+++ b/
miscutils/rx.c
@@
-1,7
+1,6
@@
/* vi: set sw=4 ts=4: */
/*-------------------------------------------------------------------------
* Filename: xmodem.c
/* vi: set sw=4 ts=4: */
/*-------------------------------------------------------------------------
* Filename: xmodem.c
- * Version: $Id: rx.c,v 1.2 2004/03/15 08:28:46 andersen Exp $
* Copyright: Copyright (C) 2001, Hewlett-Packard Company
* Author: Christopher Hoover <ch@hpl.hp.com>
* Description: xmodem functionality for uploading of kernels
* Copyright: Copyright (C) 2001, Hewlett-Packard Company
* Author: Christopher Hoover <ch@hpl.hp.com>
* Description: xmodem functionality for uploading of kernels
@@
-20,7
+19,7
@@
*
*/
*
*/
-#include "
busybox
.h"
+#include "
libbb
.h"
#define SOH 0x01
#define STX 0x02
#define SOH 0x01
#define STX 0x02
@@
-44,7
+43,8
@@
Cf:
#define TIMEOUT_LONG 10
#define MAXERRORS 10
#define TIMEOUT_LONG 10
#define MAXERRORS 10
-static int read_byte(int fd, unsigned int timeout) {
+static int read_byte(int fd, unsigned int timeout)
+{
char buf[1];
int n;
char buf[1];
int n;
@@
-249,6
+249,7
@@
static void sigalrm_handler(int ATTRIBUTE_UNUSED signum)
{
}
{
}
+int rx_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int rx_main(int argc, char **argv)
{
char *fn;
int rx_main(int argc, char **argv)
{
char *fn;
@@
-262,11
+263,11
@@
int rx_main(int argc, char **argv)
bb_show_usage();
fn = argv[1];
bb_show_usage();
fn = argv[1];
- ttyfd = xopen
3(CURRENT_TTY, O_RDWR, 0
);
- filefd = xopen
3(fn, O_RDWR|O_CREAT|O_TRUNC, 0666
);
+ ttyfd = xopen
(CURRENT_TTY, O_RDWR
);
+ filefd = xopen
(fn, O_RDWR|O_CREAT|O_TRUNC
);
if (tcgetattr(ttyfd, &tty) < 0)
if (tcgetattr(ttyfd, &tty) < 0)
- bb_perror_msg_and_die("
%s: tcgetattr failed", argv[0]
);
+ bb_perror_msg_and_die("
tcgetattr"
);
orig_tty = tty;
orig_tty = tty;
@@
-284,8
+285,7
@@
int rx_main(int argc, char **argv)
tcsetattr(ttyfd, TCSAFLUSH, &orig_tty);
if (n < 0)
tcsetattr(ttyfd, TCSAFLUSH, &orig_tty);
if (n < 0)
- bb_error_msg_and_die("\n%s: receive failed:\n %s",
- argv[0], error_buf);
+ bb_error_msg_and_die("\nreceive failed:\n %s", error_buf);
-
bb_
fflush_stdout_and_exit(EXIT_SUCCESS);
+ fflush_stdout_and_exit(EXIT_SUCCESS);
}
}