From 89847aa3141bf38cd22040e87df25aefe8f8450e Mon Sep 17 00:00:00 2001 From: aldot Date: Mon, 11 Sep 2006 16:01:40 +0000 Subject: - convert a few xopen3(,,0) into xopen(,). Also peruse the fact that xopen defaults to 0777 on it's own, so we don't need to xopen3(,,0777). Saves a few bytes: $ size busybox.old busybox text data bss dec hex filename 839676 8780 243592 1092048 10a9d0 busybox.old 839660 8780 243592 1092032 10a9c0 busybox $ make CC=gcc-4.2-HEAD bloatcheck function old new delta static.vconfig_main 281 279 -2 static.rx_main 1076 1074 -2 static.mt_main 294 292 -2 static.gzip_main 753 751 -2 static.mkfs_minix_main 4034 4030 -4 static.unzip_main 1771 1766 -5 static.crontab_main 1513 1507 -6 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/7 up/down: 0/-23) Total: -23 bytes git-svn-id: svn://busybox.net/trunk/busybox@16101 69ca8d6d-28ef-0310-b511-8ec308f3f277 --- miscutils/crontab.c | 2 +- miscutils/mt.c | 2 +- miscutils/rx.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'miscutils') diff --git a/miscutils/crontab.c b/miscutils/crontab.c index a8e650c60..1acacc676 100644 --- a/miscutils/crontab.c +++ b/miscutils/crontab.c @@ -266,7 +266,7 @@ static int GetReplaceStream(const char *user, const char *file) exit(0); bb_default_error_retval = 0; - fd = xopen3(file, O_RDONLY, 0); + fd = xopen(file, O_RDONLY); buf[0] = 0; write(filedes[1], buf, 1); while ((n = read(fd, buf, sizeof(buf))) > 0) { diff --git a/miscutils/mt.c b/miscutils/mt.c index f562a91a2..f4a3be739 100644 --- a/miscutils/mt.c +++ b/miscutils/mt.c @@ -101,7 +101,7 @@ int mt_main(int argc, char **argv) break; } - fd = xopen3(file, mode, 0); + fd = xopen(file, mode); switch (code->value) { case MTTELL: diff --git a/miscutils/rx.c b/miscutils/rx.c index 91606ecd0..52a76bfd9 100644 --- a/miscutils/rx.c +++ b/miscutils/rx.c @@ -262,7 +262,7 @@ int rx_main(int argc, char **argv) bb_show_usage(); fn = argv[1]; - ttyfd = xopen3(CURRENT_TTY, O_RDWR, 0); + ttyfd = xopen(CURRENT_TTY, O_RDWR); filefd = xopen3(fn, O_RDWR|O_CREAT|O_TRUNC, 0666); if (tcgetattr(ttyfd, &tty) < 0) -- cgit v1.2.3-55-g6feb