diff options
Diffstat (limited to 'toolbox')
-rw-r--r-- | toolbox/Android.bp | 7 | ||||
-rw-r--r-- | toolbox/newfs_msdos.c | 21 |
2 files changed, 22 insertions, 6 deletions
diff --git a/toolbox/Android.bp b/toolbox/Android.bp index a0c24979d..077f5423d 100644 --- a/toolbox/Android.bp +++ b/toolbox/Android.bp | |||
@@ -61,3 +61,10 @@ cc_binary { | |||
61 | defaults: ["toolbox_defaults"], | 61 | defaults: ["toolbox_defaults"], |
62 | srcs: ["r.c"], | 62 | srcs: ["r.c"], |
63 | } | 63 | } |
64 | |||
65 | cc_binary_host { | ||
66 | name: "newfs_msdos", | ||
67 | defaults: ["toolbox_defaults"], | ||
68 | srcs: ["newfs_msdos.c"], | ||
69 | cflags: ["-Dnewfs_msdos_main=main"] | ||
70 | } | ||
diff --git a/toolbox/newfs_msdos.c b/toolbox/newfs_msdos.c index d7047e2c4..5fc8b0242 100644 --- a/toolbox/newfs_msdos.c +++ b/toolbox/newfs_msdos.c | |||
@@ -32,15 +32,17 @@ static const char rcsid[] = | |||
32 | 32 | ||
33 | #include <sys/param.h> | 33 | #include <sys/param.h> |
34 | 34 | ||
35 | #ifndef ANDROID | 35 | #ifdef __APPLE__ |
36 | #elif defined(ANDROID) | ||
37 | #include <linux/fs.h> | ||
38 | #include <linux/hdreg.h> | ||
39 | #include <stdarg.h> | ||
40 | #include <sys/ioctl.h> | ||
41 | #else | ||
36 | #include <sys/fdcio.h> | 42 | #include <sys/fdcio.h> |
37 | #include <sys/disk.h> | 43 | #include <sys/disk.h> |
38 | #include <sys/disklabel.h> | 44 | #include <sys/disklabel.h> |
39 | #include <sys/mount.h> | 45 | #include <sys/mount.h> |
40 | #else | ||
41 | #include <stdarg.h> | ||
42 | #include <linux/fs.h> | ||
43 | #include <linux/hdreg.h> | ||
44 | #endif | 46 | #endif |
45 | 47 | ||
46 | #include <sys/stat.h> | 48 | #include <sys/stat.h> |
@@ -58,6 +60,10 @@ static const char rcsid[] = | |||
58 | #include <time.h> | 60 | #include <time.h> |
59 | #include <unistd.h> | 61 | #include <unistd.h> |
60 | 62 | ||
63 | #ifndef __unused | ||
64 | #define __unused __attribute__((__unused__)) | ||
65 | #endif | ||
66 | |||
61 | #define MAXU16 0xffff /* maximum unsigned 16-bit quantity */ | 67 | #define MAXU16 0xffff /* maximum unsigned 16-bit quantity */ |
62 | #define BPN 4 /* bits per nibble */ | 68 | #define BPN 4 /* bits per nibble */ |
63 | #define NPB 2 /* nibbles per byte */ | 69 | #define NPB 2 /* nibbles per byte */ |
@@ -794,7 +800,10 @@ static void getstdfmt(const char *fmt, struct bpb *bpb) | |||
794 | * Get disk slice, partition, and geometry information. | 800 | * Get disk slice, partition, and geometry information. |
795 | */ | 801 | */ |
796 | 802 | ||
797 | #ifdef ANDROID | 803 | #ifdef __APPLE__ |
804 | static void getdiskinfo(__unused int fd, __unused const char* fname, __unused const char* dtype, | ||
805 | __unused int oflag, __unused struct bpb* bpb) {} | ||
806 | #elif ANDROID | ||
798 | static void getdiskinfo(int fd, const char *fname, const char *dtype, | 807 | static void getdiskinfo(int fd, const char *fname, const char *dtype, |
799 | __unused int oflag,struct bpb *bpb) | 808 | __unused int oflag,struct bpb *bpb) |
800 | { | 809 | { |