aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraldot <aldot@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-09-11 16:01:40 +0000
committeraldot <aldot@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-09-11 16:01:40 +0000
commit89847aa3141bf38cd22040e87df25aefe8f8450e (patch)
tree5fee0b4e525aaab7163e2a06f4bc8584d70a7b34
parent5896c14b351ed211d53ed25aff875df6dbb93b0b (diff)
downloadbusybox-w32-89847aa3141bf38cd22040e87df25aefe8f8450e.tar.gz
busybox-w32-89847aa3141bf38cd22040e87df25aefe8f8450e.tar.bz2
busybox-w32-89847aa3141bf38cd22040e87df25aefe8f8450e.zip
- 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
-rw-r--r--archival/gzip.c2
-rw-r--r--archival/unzip.c2
-rw-r--r--miscutils/crontab.c2
-rw-r--r--miscutils/mt.c2
-rw-r--r--miscutils/rx.c2
-rw-r--r--networking/vconfig.c2
-rw-r--r--util-linux/mkfs_minix.c4
7 files changed, 8 insertions, 8 deletions
diff --git a/archival/gzip.c b/archival/gzip.c
index ad2c24df1..7c18154ff 100644
--- a/archival/gzip.c
+++ b/archival/gzip.c
@@ -1206,7 +1206,7 @@ int gzip_main(int argc, char **argv)
1206 inFileNum = STDIN_FILENO; 1206 inFileNum = STDIN_FILENO;
1207 outFileNum = STDOUT_FILENO; 1207 outFileNum = STDOUT_FILENO;
1208 } else { 1208 } else {
1209 inFileNum = xopen3(argv[i], O_RDONLY, 0); 1209 inFileNum = xopen(argv[i], O_RDONLY);
1210 if (fstat(inFileNum, &statBuf) < 0) 1210 if (fstat(inFileNum, &statBuf) < 0)
1211 bb_perror_msg_and_die("%s", argv[i]); 1211 bb_perror_msg_and_die("%s", argv[i]);
1212 time_stamp = statBuf.st_ctime; 1212 time_stamp = statBuf.st_ctime;
diff --git a/archival/unzip.c b/archival/unzip.c
index 709ebf81a..1b80aea9f 100644
--- a/archival/unzip.c
+++ b/archival/unzip.c
@@ -333,7 +333,7 @@ int unzip_main(int argc, char **argv)
333 overwrite = o_always; 333 overwrite = o_always;
334 case 'y': /* Open file and fall into unzip */ 334 case 'y': /* Open file and fall into unzip */
335 unzip_create_leading_dirs(dst_fn); 335 unzip_create_leading_dirs(dst_fn);
336 dst_fd = xopen3(dst_fn, O_WRONLY | O_CREAT | O_TRUNC, 0777); 336 dst_fd = xopen(dst_fn, O_WRONLY | O_CREAT | O_TRUNC);
337 case -1: /* Unzip */ 337 case -1: /* Unzip */
338 if (verbosity == v_normal) { 338 if (verbosity == v_normal) {
339 printf(" inflating: %s\n", dst_fn); 339 printf(" inflating: %s\n", dst_fn);
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)
266 exit(0); 266 exit(0);
267 267
268 bb_default_error_retval = 0; 268 bb_default_error_retval = 0;
269 fd = xopen3(file, O_RDONLY, 0); 269 fd = xopen(file, O_RDONLY);
270 buf[0] = 0; 270 buf[0] = 0;
271 write(filedes[1], buf, 1); 271 write(filedes[1], buf, 1);
272 while ((n = read(fd, buf, sizeof(buf))) > 0) { 272 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)
101 break; 101 break;
102 } 102 }
103 103
104 fd = xopen3(file, mode, 0); 104 fd = xopen(file, mode);
105 105
106 switch (code->value) { 106 switch (code->value) {
107 case MTTELL: 107 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)
262 bb_show_usage(); 262 bb_show_usage();
263 263
264 fn = argv[1]; 264 fn = argv[1];
265 ttyfd = xopen3(CURRENT_TTY, O_RDWR, 0); 265 ttyfd = xopen(CURRENT_TTY, O_RDWR);
266 filefd = xopen3(fn, O_RDWR|O_CREAT|O_TRUNC, 0666); 266 filefd = xopen3(fn, O_RDWR|O_CREAT|O_TRUNC, 0666);
267 267
268 if (tcgetattr(ttyfd, &tty) < 0) 268 if (tcgetattr(ttyfd, &tty) < 0)
diff --git a/networking/vconfig.c b/networking/vconfig.c
index efbb5a1dc..15a611098 100644
--- a/networking/vconfig.c
+++ b/networking/vconfig.c
@@ -118,7 +118,7 @@ int vconfig_main(int argc, char **argv)
118 118
119 /* Don't bother closing the filedes. It will be closed on cleanup. */ 119 /* Don't bother closing the filedes. It will be closed on cleanup. */
120 /* Will die if 802.1q is not present */ 120 /* Will die if 802.1q is not present */
121 xopen3(conf_file_name, O_RDONLY, 0); 121 xopen(conf_file_name, O_RDONLY);
122 122
123 memset(&ifr, 0, sizeof(struct vlan_ioctl_args)); 123 memset(&ifr, 0, sizeof(struct vlan_ioctl_args));
124 124
diff --git a/util-linux/mkfs_minix.c b/util-linux/mkfs_minix.c
index ed9cb4512..b154f4ab9 100644
--- a/util-linux/mkfs_minix.c
+++ b/util-linux/mkfs_minix.c
@@ -292,7 +292,7 @@ static int get_size(const char *file)
292 int fd; 292 int fd;
293 long size; 293 long size;
294 294
295 fd = xopen3(file, O_RDWR, 0); 295 fd = xopen(file, O_RDWR);
296 if (ioctl(fd, BLKGETSIZE, &size) >= 0) { 296 if (ioctl(fd, BLKGETSIZE, &size) >= 0) {
297 close(fd); 297 close(fd);
298 return (size * 512); 298 return (size * 512);
@@ -805,7 +805,7 @@ goodbye:
805 tmp += dirsize; 805 tmp += dirsize;
806 *(short *) tmp = 2; 806 *(short *) tmp = 2;
807 strcpy(tmp + 2, ".badblocks"); 807 strcpy(tmp + 2, ".badblocks");
808 DEV = xopen3(device_name, O_RDWR, 0); 808 DEV = xopen(device_name, O_RDWR);
809 if (fstat(DEV, &statbuf) < 0) 809 if (fstat(DEV, &statbuf) < 0)
810 bb_error_msg_and_die("unable to stat %s", device_name); 810 bb_error_msg_and_die("unable to stat %s", device_name);
811 if (!S_ISBLK(statbuf.st_mode)) 811 if (!S_ISBLK(statbuf.st_mode))