aboutsummaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2009-04-22 22:13:17 +1000
committerNguyễn Thái Ngọc Duy <pclouds@gmail.com>2009-04-23 04:44:33 +1000
commit251687097b60bad7a88de930576b7177f34fa975 (patch)
tree79e04bf5487a27e1915f29778f6bff577a3a223b /coreutils
parentd791e72dc28009f36da26703fc007e40cfa79414 (diff)
downloadbusybox-w32-251687097b60bad7a88de930576b7177f34fa975.tar.gz
busybox-w32-251687097b60bad7a88de930576b7177f34fa975.tar.bz2
busybox-w32-251687097b60bad7a88de930576b7177f34fa975.zip
adapt it to be buildable
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/date.c2
-rw-r--r--coreutils/dd.c5
-rw-r--r--coreutils/ls.c4
-rw-r--r--coreutils/test.c6
4 files changed, 17 insertions, 0 deletions
diff --git a/coreutils/date.c b/coreutils/date.c
index 57c826a3f..ad533eea0 100644
--- a/coreutils/date.c
+++ b/coreutils/date.c
@@ -178,9 +178,11 @@ int date_main(int argc, char **argv)
178 maybe_set_utc(opt); 178 maybe_set_utc(opt);
179 179
180 /* if setting time, set it */ 180 /* if setting time, set it */
181#ifndef __MINGW32__
181 if ((opt & DATE_OPT_SET) && stime(&tm) < 0) { 182 if ((opt & DATE_OPT_SET) && stime(&tm) < 0) {
182 bb_perror_msg("cannot set date"); 183 bb_perror_msg("cannot set date");
183 } 184 }
185#endif
184 } 186 }
185 187
186 /* Display output */ 188 /* Display output */
diff --git a/coreutils/dd.c b/coreutils/dd.c
index dd311d86a..ba3afeae8 100644
--- a/coreutils/dd.c
+++ b/coreutils/dd.c
@@ -72,6 +72,9 @@ static bool write_and_stats(int fd, const void *buf, size_t len, size_t obs,
72int dd_main(int argc, char **argv); 72int dd_main(int argc, char **argv);
73int dd_main(int argc, char **argv) 73int dd_main(int argc, char **argv)
74{ 74{
75#ifdef __MINGW32__
76#undef NOERROR /* found in winerror.h */
77#endif
75 enum { 78 enum {
76 SYNC_FLAG = 1 << 0, 79 SYNC_FLAG = 1 << 0,
77 NOERROR = 1 << 1, 80 NOERROR = 1 << 1,
@@ -111,6 +114,7 @@ int dd_main(int argc, char **argv)
111 114
112 memset(&G, 0, sizeof(G)); /* because of NOEXEC */ 115 memset(&G, 0, sizeof(G)); /* because of NOEXEC */
113 116
117#ifndef __MINGW32__
114 if (ENABLE_FEATURE_DD_SIGNAL_HANDLING) { 118 if (ENABLE_FEATURE_DD_SIGNAL_HANDLING) {
115 struct sigaction sa; 119 struct sigaction sa;
116 120
@@ -120,6 +124,7 @@ int dd_main(int argc, char **argv)
120 sigemptyset(&sa.sa_mask); 124 sigemptyset(&sa.sa_mask);
121 sigaction(SIGUSR1, &sa, 0); 125 sigaction(SIGUSR1, &sa, 0);
122 } 126 }
127#endif
123 128
124 for (n = 1; n < argc; n++) { 129 for (n = 1; n < argc; n++) {
125 smalluint key_len; 130 smalluint key_len;
diff --git a/coreutils/ls.c b/coreutils/ls.c
index e2ed3ee1f..95c4b4be6 100644
--- a/coreutils/ls.c
+++ b/coreutils/ls.c
@@ -546,6 +546,10 @@ static struct dnode **list_dir(const char *path)
546static time_t current_time_t; 546static time_t current_time_t;
547#endif 547#endif
548 548
549#ifdef __MINGW32__
550#define minor(x) 0
551#define major(x) 0
552#endif
549static int list_single(struct dnode *dn) 553static int list_single(struct dnode *dn)
550{ 554{
551 int i, column = 0; 555 int i, column = 0;
diff --git a/coreutils/test.c b/coreutils/test.c
index c26e7e572..a635b1735 100644
--- a/coreutils/test.c
+++ b/coreutils/test.c
@@ -448,10 +448,12 @@ static int filstat(char *nm, enum token mode)
448 } 448 }
449 if (mode == FILGZ) 449 if (mode == FILGZ)
450 return s.st_size > 0L; 450 return s.st_size > 0L;
451#ifndef __MINGW32__
451 if (mode == FILUID) 452 if (mode == FILUID)
452 return s.st_uid == geteuid(); 453 return s.st_uid == geteuid();
453 if (mode == FILGID) 454 if (mode == FILGID)
454 return s.st_gid == getegid(); 455 return s.st_gid == getegid();
456#endif
455 return 1; /* NOTREACHED */ 457 return 1; /* NOTREACHED */
456} 458}
457 459
@@ -536,7 +538,9 @@ static int equalf(const char *f1, const char *f2)
536static int test_eaccess(char *path, int mode) 538static int test_eaccess(char *path, int mode)
537{ 539{
538 struct stat st; 540 struct stat st;
541#ifndef __MINGW32__
539 unsigned int euid = geteuid(); 542 unsigned int euid = geteuid();
543#endif
540 544
541 if (stat(path, &st) < 0) 545 if (stat(path, &st) < 0)
542 return -1; 546 return -1;
@@ -563,6 +567,7 @@ static int test_eaccess(char *path, int mode)
563 return -1; 567 return -1;
564} 568}
565 569
570#ifndef __MINGW32__
566static void initialize_group_array(void) 571static void initialize_group_array(void)
567{ 572{
568 ngroups = getgroups(0, NULL); 573 ngroups = getgroups(0, NULL);
@@ -599,6 +604,7 @@ static int is_a_group_member(gid_t gid)
599 604
600 return 0; 605 return 0;
601} 606}
607#endif
602 608
603 609
604/* applet entry point */ 610/* applet entry point */