diff options
| author | aldot <aldot@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-04-13 12:45:04 +0000 |
|---|---|---|
| committer | aldot <aldot@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-04-13 12:45:04 +0000 |
| commit | f0bf1ade78b709229cab0801347032478b02ef96 (patch) | |
| tree | 378b5a002da81f8622913cc6a9aeac873e307ec9 /util-linux | |
| parent | a39965951155a179f9e8afed70dd5f45ea70f280 (diff) | |
| download | busybox-w32-f0bf1ade78b709229cab0801347032478b02ef96.tar.gz busybox-w32-f0bf1ade78b709229cab0801347032478b02ef96.tar.bz2 busybox-w32-f0bf1ade78b709229cab0801347032478b02ef96.zip | |
- patch from Denis Vlasenko to add and use bb_xopen3()
git-svn-id: svn://busybox.net/trunk/busybox@14847 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'util-linux')
| -rw-r--r-- | util-linux/mkfs_minix.c | 4 | ||||
| -rw-r--r-- | util-linux/mkswap.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/util-linux/mkfs_minix.c b/util-linux/mkfs_minix.c index 30bc9f12d..d9388b1d7 100644 --- a/util-linux/mkfs_minix.c +++ b/util-linux/mkfs_minix.c | |||
| @@ -307,7 +307,7 @@ static inline int get_size(const char *file) | |||
| 307 | int fd; | 307 | int fd; |
| 308 | long size; | 308 | long size; |
| 309 | 309 | ||
| 310 | fd = bb_xopen(file, O_RDWR); | 310 | fd = bb_xopen3(file, O_RDWR, 0); |
| 311 | if (ioctl(fd, BLKGETSIZE, &size) >= 0) { | 311 | if (ioctl(fd, BLKGETSIZE, &size) >= 0) { |
| 312 | close(fd); | 312 | close(fd); |
| 313 | return (size * 512); | 313 | return (size * 512); |
| @@ -820,7 +820,7 @@ goodbye: | |||
| 820 | tmp += dirsize; | 820 | tmp += dirsize; |
| 821 | *(short *) tmp = 2; | 821 | *(short *) tmp = 2; |
| 822 | strcpy(tmp + 2, ".badblocks"); | 822 | strcpy(tmp + 2, ".badblocks"); |
| 823 | DEV = bb_xopen(device_name, O_RDWR); | 823 | DEV = bb_xopen3(device_name, O_RDWR, 0); |
| 824 | if (fstat(DEV, &statbuf) < 0) | 824 | if (fstat(DEV, &statbuf) < 0) |
| 825 | bb_error_msg_and_die("unable to stat %s", device_name); | 825 | bb_error_msg_and_die("unable to stat %s", device_name); |
| 826 | if (!S_ISBLK(statbuf.st_mode)) | 826 | if (!S_ISBLK(statbuf.st_mode)) |
diff --git a/util-linux/mkswap.c b/util-linux/mkswap.c index 32021fe08..44d809a36 100644 --- a/util-linux/mkswap.c +++ b/util-linux/mkswap.c | |||
| @@ -258,7 +258,7 @@ static inline long get_size(const char *file) | |||
| 258 | int fd; | 258 | int fd; |
| 259 | long size; | 259 | long size; |
| 260 | 260 | ||
| 261 | fd = bb_xopen(file, O_RDONLY); | 261 | fd = bb_xopen3(file, O_RDONLY, 0); |
| 262 | if (ioctl(fd, BLKGETSIZE, &size) >= 0) { | 262 | if (ioctl(fd, BLKGETSIZE, &size) >= 0) { |
| 263 | size /= pagesize / 512; | 263 | size /= pagesize / 512; |
| 264 | } else { | 264 | } else { |
| @@ -341,7 +341,7 @@ int mkswap_main(int argc, char **argv) | |||
| 341 | PAGES * goodpages); | 341 | PAGES * goodpages); |
| 342 | } | 342 | } |
| 343 | 343 | ||
| 344 | DEV = bb_xopen(device_name, O_RDWR); | 344 | DEV = bb_xopen3(device_name, O_RDWR, 0); |
| 345 | if (fstat(DEV, &statbuf) < 0) | 345 | if (fstat(DEV, &statbuf) < 0) |
| 346 | bb_perror_msg_and_die("%s", device_name); | 346 | bb_perror_msg_and_die("%s", device_name); |
| 347 | if (!S_ISBLK(statbuf.st_mode)) | 347 | if (!S_ISBLK(statbuf.st_mode)) |
