diff options
author | Erik Andersen <andersen@codepoet.org> | 1999-12-17 18:44:15 +0000 |
---|---|---|
committer | Erik Andersen <andersen@codepoet.org> | 1999-12-17 18:44:15 +0000 |
commit | 4d1d0113fd3309aac30b2dd1d443bf7c7d5f0a3d (patch) | |
tree | 1d18bbba8f8a1d78d7ff13e7a87ee2aab165125f | |
parent | 6da0ae8183a31d4faab745d534a363c7e66ef864 (diff) | |
download | busybox-w32-4d1d0113fd3309aac30b2dd1d443bf7c7d5f0a3d.tar.gz busybox-w32-4d1d0113fd3309aac30b2dd1d443bf7c7d5f0a3d.tar.bz2 busybox-w32-4d1d0113fd3309aac30b2dd1d443bf7c7d5f0a3d.zip |
Reworked the source so it will compile and run under glibc 2.0.7
and linux kernel 2.0.36 (though the dubious reasons why someone
would want to do that defy imagination ;)
-Erik
-rw-r--r-- | Changelog | 4 | ||||
-rw-r--r-- | Makefile | 6 | ||||
-rw-r--r-- | archival/gunzip.c | 4 | ||||
-rw-r--r-- | archival/gzip.c | 4 | ||||
-rw-r--r-- | busybox.spec | 2 | ||||
-rw-r--r-- | coreutils/dd.c | 2 | ||||
-rw-r--r-- | coreutils/du.c | 5 | ||||
-rw-r--r-- | coreutils/tail.c | 1 | ||||
-rw-r--r-- | dd.c | 2 | ||||
-rw-r--r-- | du.c | 5 | ||||
-rw-r--r-- | examples/busybox.spec | 2 | ||||
-rw-r--r-- | fbset.c | 12 | ||||
-rw-r--r-- | gunzip.c | 4 | ||||
-rw-r--r-- | gzip.c | 4 | ||||
-rw-r--r-- | init.c | 7 | ||||
-rw-r--r-- | init/init.c | 7 | ||||
-rw-r--r-- | tail.c | 1 | ||||
-rw-r--r-- | util-linux/fbset.c | 12 | ||||
-rw-r--r-- | utility.c | 8 |
19 files changed, 71 insertions, 21 deletions
@@ -1,10 +1,12 @@ | |||
1 | 0.40 | 1 | 0.40 |
2 | * Added the -s option to du -beppu | 2 | * Added the -s option to du -beppu |
3 | * Fixed an embarrasing segfault in head -beppu | 3 | * Fixed an embarrasing segfault in head -beppu |
4 | * Fixed an bug in syslogd causing it to stop logging after 20 minutes. -erik | ||
4 | * New Apps: lsmod, rmmod -erik | 5 | * New Apps: lsmod, rmmod -erik |
5 | * New Apps: fbset contributed by Randolph Chung <tausq@debian.org>. | 6 | * New Apps: fbset contributed by Randolph Chung <tausq@debian.org>. |
6 | * Fixed an bug in syslogd causing it to stop logging after 20 minutes. -erik | ||
7 | * Fixed the embarrasing failure of the -p opition in the logger app. -erik | 7 | * Fixed the embarrasing failure of the -p opition in the logger app. -erik |
8 | * Re-worked the whole source tree a bit so it will compile under glibc 2.0.7 | ||
9 | with the 2.0.x Linux kernel. | ||
8 | 10 | ||
9 | -Erik Andersen | 11 | -Erik Andersen |
10 | 12 | ||
@@ -17,7 +17,7 @@ | |||
17 | 17 | ||
18 | 18 | ||
19 | PROG=busybox | 19 | PROG=busybox |
20 | VERSION=0.39 | 20 | VERSION=0.40 |
21 | BUILDTIME=$(shell date "+%Y%m%d-%H%M") | 21 | BUILDTIME=$(shell date "+%Y%m%d-%H%M") |
22 | 22 | ||
23 | # Comment out the following to make a debuggable build | 23 | # Comment out the following to make a debuggable build |
@@ -31,8 +31,8 @@ DOSTATIC=false | |||
31 | #This will choke on a non-debian system | 31 | #This will choke on a non-debian system |
32 | ARCH=`uname -m | sed -e 's/i.86/i386/' | sed -e 's/sparc.*/sparc/'` | 32 | ARCH=`uname -m | sed -e 's/i.86/i386/' | sed -e 's/sparc.*/sparc/'` |
33 | 33 | ||
34 | GCCMAJVERSION=`$(CC) --version | sed -n "s/^\([0-9]\)\.\([0-9].*\)[\.].*/\1/p"` | 34 | GCCMAJVERSION=$(shell $(CC) --version | sed -n "s/^\([^\.]*\).*/\1/p" ) |
35 | GCCMINVERSION=`$(CC) --version | sed -n "s/^\([0-9]\)\.\([0-9].*\)[\.].*/\2/p"` | 35 | GCCMINVERSION=$(shell $(CC) --version | sed -n "s/^[^\.]*\.\([^\.]*\)[\.].*/\1/p" ) |
36 | 36 | ||
37 | GCCSUPPORTSOPTSIZE=$(shell \ | 37 | GCCSUPPORTSOPTSIZE=$(shell \ |
38 | if ( test $(GCCMAJVERSION) -eq 2 ) ; then \ | 38 | if ( test $(GCCMAJVERSION) -eq 2 ) ; then \ |
diff --git a/archival/gunzip.c b/archival/gunzip.c index a809fed68..61391a33f 100644 --- a/archival/gunzip.c +++ b/archival/gunzip.c | |||
@@ -805,7 +805,11 @@ int gunzip_main (int argc, char** argv) | |||
805 | } | 805 | } |
806 | 806 | ||
807 | /* Open output fille */ | 807 | /* Open output fille */ |
808 | #if (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 1) | ||
808 | outFileNum=open( ofname, O_RDWR|O_CREAT|O_EXCL|O_NOFOLLOW); | 809 | outFileNum=open( ofname, O_RDWR|O_CREAT|O_EXCL|O_NOFOLLOW); |
810 | #else | ||
811 | outFileNum=open( ofname, O_RDWR|O_CREAT|O_EXCL); | ||
812 | #endif | ||
809 | if (outFileNum < 0) { | 813 | if (outFileNum < 0) { |
810 | perror(ofname); | 814 | perror(ofname); |
811 | do_exit(WARNING); | 815 | do_exit(WARNING); |
diff --git a/archival/gzip.c b/archival/gzip.c index 983f673e1..76df3ad9a 100644 --- a/archival/gzip.c +++ b/archival/gzip.c | |||
@@ -1877,7 +1877,11 @@ int gzip_main(int argc, char ** argv) | |||
1877 | 1877 | ||
1878 | 1878 | ||
1879 | /* Open output fille */ | 1879 | /* Open output fille */ |
1880 | #if (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 1) | ||
1880 | outFileNum=open( ofname, O_RDWR|O_CREAT|O_EXCL|O_NOFOLLOW); | 1881 | outFileNum=open( ofname, O_RDWR|O_CREAT|O_EXCL|O_NOFOLLOW); |
1882 | #else | ||
1883 | outFileNum=open( ofname, O_RDWR|O_CREAT|O_EXCL); | ||
1884 | #endif | ||
1881 | if (outFileNum < 0) { | 1885 | if (outFileNum < 0) { |
1882 | perror(ofname); | 1886 | perror(ofname); |
1883 | do_exit(WARNING); | 1887 | do_exit(WARNING); |
diff --git a/busybox.spec b/busybox.spec index 5e9df9d0e..a0351a08e 100644 --- a/busybox.spec +++ b/busybox.spec | |||
@@ -1,5 +1,5 @@ | |||
1 | Name: busybox | 1 | Name: busybox |
2 | Version: 0.39 | 2 | Version: 0.40 |
3 | Release: 1 | 3 | Release: 1 |
4 | Group: System/Utilities | 4 | Group: System/Utilities |
5 | Summary: BusyBox is a tiny suite of Unix utilities in a multi-call binary. | 5 | Summary: BusyBox is a tiny suite of Unix utilities in a multi-call binary. |
diff --git a/coreutils/dd.c b/coreutils/dd.c index 90c1004fa..bc01eedbf 100644 --- a/coreutils/dd.c +++ b/coreutils/dd.c | |||
@@ -33,7 +33,7 @@ | |||
33 | #include <stdio.h> | 33 | #include <stdio.h> |
34 | #include <fcntl.h> | 34 | #include <fcntl.h> |
35 | #include <errno.h> | 35 | #include <errno.h> |
36 | #if (__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 1) | 36 | #if (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 1) |
37 | #include <inttypes.h> | 37 | #include <inttypes.h> |
38 | #else | 38 | #else |
39 | typedef unsigned long long int uintmax_t; | 39 | typedef unsigned long long int uintmax_t; |
diff --git a/coreutils/du.c b/coreutils/du.c index ed90bc445..ec03afd95 100644 --- a/coreutils/du.c +++ b/coreutils/du.c | |||
@@ -44,9 +44,6 @@ static int du_depth = 0; | |||
44 | static Display *print; | 44 | static Display *print; |
45 | 45 | ||
46 | static void | 46 | static void |
47 | print_null(size_t size, char *filename) { } | ||
48 | |||
49 | static void | ||
50 | print_normal(size_t size, char *filename) | 47 | print_normal(size_t size, char *filename) |
51 | { | 48 | { |
52 | fprintf(stdout, "%-7d %s\n", (size >> 1), filename); | 49 | fprintf(stdout, "%-7d %s\n", (size >> 1), filename); |
@@ -143,4 +140,4 @@ du_main(int argc, char **argv) | |||
143 | exit(0); | 140 | exit(0); |
144 | } | 141 | } |
145 | 142 | ||
146 | /* $Id: du.c,v 1.7 1999/12/16 21:16:47 beppu Exp $ */ | 143 | /* $Id: du.c,v 1.8 1999/12/17 18:44:15 erik Exp $ */ |
diff --git a/coreutils/tail.c b/coreutils/tail.c index 7a64c4ca3..697177dc7 100644 --- a/coreutils/tail.c +++ b/coreutils/tail.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include "internal.h" | 27 | #include "internal.h" |
28 | 28 | ||
29 | #include <stdio.h> | 29 | #include <stdio.h> |
30 | #include <stdarg.h> | ||
30 | #include <assert.h> | 31 | #include <assert.h> |
31 | #include <errno.h> | 32 | #include <errno.h> |
32 | #include <sys/types.h> | 33 | #include <sys/types.h> |
@@ -33,7 +33,7 @@ | |||
33 | #include <stdio.h> | 33 | #include <stdio.h> |
34 | #include <fcntl.h> | 34 | #include <fcntl.h> |
35 | #include <errno.h> | 35 | #include <errno.h> |
36 | #if (__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 1) | 36 | #if (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 1) |
37 | #include <inttypes.h> | 37 | #include <inttypes.h> |
38 | #else | 38 | #else |
39 | typedef unsigned long long int uintmax_t; | 39 | typedef unsigned long long int uintmax_t; |
@@ -44,9 +44,6 @@ static int du_depth = 0; | |||
44 | static Display *print; | 44 | static Display *print; |
45 | 45 | ||
46 | static void | 46 | static void |
47 | print_null(size_t size, char *filename) { } | ||
48 | |||
49 | static void | ||
50 | print_normal(size_t size, char *filename) | 47 | print_normal(size_t size, char *filename) |
51 | { | 48 | { |
52 | fprintf(stdout, "%-7d %s\n", (size >> 1), filename); | 49 | fprintf(stdout, "%-7d %s\n", (size >> 1), filename); |
@@ -143,4 +140,4 @@ du_main(int argc, char **argv) | |||
143 | exit(0); | 140 | exit(0); |
144 | } | 141 | } |
145 | 142 | ||
146 | /* $Id: du.c,v 1.7 1999/12/16 21:16:47 beppu Exp $ */ | 143 | /* $Id: du.c,v 1.8 1999/12/17 18:44:15 erik Exp $ */ |
diff --git a/examples/busybox.spec b/examples/busybox.spec index 5e9df9d0e..a0351a08e 100644 --- a/examples/busybox.spec +++ b/examples/busybox.spec | |||
@@ -1,5 +1,5 @@ | |||
1 | Name: busybox | 1 | Name: busybox |
2 | Version: 0.39 | 2 | Version: 0.40 |
3 | Release: 1 | 3 | Release: 1 |
4 | Group: System/Utilities | 4 | Group: System/Utilities |
5 | Summary: BusyBox is a tiny suite of Unix utilities in a multi-call binary. | 5 | Summary: BusyBox is a tiny suite of Unix utilities in a multi-call binary. |
@@ -32,9 +32,14 @@ | |||
32 | #include <ctype.h> | 32 | #include <ctype.h> |
33 | #include <sys/ioctl.h> | 33 | #include <sys/ioctl.h> |
34 | #include <linux/fb.h> | 34 | #include <linux/fb.h> |
35 | #include <linux/version.h> | ||
35 | 36 | ||
36 | #define PERROR(ctx) do { perror(ctx); exit(1); } while(0) | 37 | #define PERROR(ctx) do { perror(ctx); exit(1); } while(0) |
37 | 38 | ||
39 | #ifndef KERNEL_VERSION | ||
40 | #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) | ||
41 | #endif | ||
42 | |||
38 | #define DEFAULTFBDEV "/dev/fb0" | 43 | #define DEFAULTFBDEV "/dev/fb0" |
39 | #define DEFAULTFBMODE "/etc/fb.modes" | 44 | #define DEFAULTFBMODE "/etc/fb.modes" |
40 | 45 | ||
@@ -185,10 +190,16 @@ static void showmode(struct fb_var_screeninfo *v) | |||
185 | #endif | 190 | #endif |
186 | printf("\tgeometry %u %u %u %u %u\n", v->xres, v->yres, | 191 | printf("\tgeometry %u %u %u %u %u\n", v->xres, v->yres, |
187 | v->xres_virtual, v->yres_virtual, v->bits_per_pixel); | 192 | v->xres_virtual, v->yres_virtual, v->bits_per_pixel); |
193 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0) | ||
188 | printf("\ttimings %u %u %u %u %u %u %u\n", v->pixclock, v->left_margin, | 194 | printf("\ttimings %u %u %u %u %u %u %u\n", v->pixclock, v->left_margin, |
189 | v->right_margin, v->upper_margin, v->lower_margin, v->hsync_len, | 195 | v->right_margin, v->upper_margin, v->lower_margin, v->hsync_len, |
190 | v->vsync_len); | 196 | v->vsync_len); |
191 | printf("\taccel %s\n", (v->accel_flags > 0 ? "true" : "false")); | 197 | printf("\taccel %s\n", (v->accel_flags > 0 ? "true" : "false")); |
198 | #else | ||
199 | printf("\ttimings %lu %lu %lu %lu %lu %lu %lu\n", v->pixclock, v->left_margin, | ||
200 | v->right_margin, v->upper_margin, v->lower_margin, v->hsync_len, | ||
201 | v->vsync_len); | ||
202 | #endif | ||
192 | printf("\trgba %u/%u,%u/%u,%u/%u,%u/%u\n", v->red.length, v->red.offset, | 203 | printf("\trgba %u/%u,%u/%u,%u/%u,%u/%u\n", v->red.length, v->red.offset, |
193 | v->green.length, v->green.offset, v->blue.length, v->blue.offset, | 204 | v->green.length, v->green.offset, v->blue.length, v->blue.offset, |
194 | v->transp.length, v->transp.offset); | 205 | v->transp.length, v->transp.offset); |
@@ -215,7 +226,6 @@ extern int fbset_main(int argc, char **argv) | |||
215 | #endif | 226 | #endif |
216 | { | 227 | { |
217 | struct fb_var_screeninfo var, varset; | 228 | struct fb_var_screeninfo var, varset; |
218 | struct fb_fix_screeninfo fix; | ||
219 | int fh, i; | 229 | int fh, i; |
220 | char *fbdev = DEFAULTFBDEV; | 230 | char *fbdev = DEFAULTFBDEV; |
221 | char *modefile = DEFAULTFBMODE; | 231 | char *modefile = DEFAULTFBMODE; |
@@ -805,7 +805,11 @@ int gunzip_main (int argc, char** argv) | |||
805 | } | 805 | } |
806 | 806 | ||
807 | /* Open output fille */ | 807 | /* Open output fille */ |
808 | #if (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 1) | ||
808 | outFileNum=open( ofname, O_RDWR|O_CREAT|O_EXCL|O_NOFOLLOW); | 809 | outFileNum=open( ofname, O_RDWR|O_CREAT|O_EXCL|O_NOFOLLOW); |
810 | #else | ||
811 | outFileNum=open( ofname, O_RDWR|O_CREAT|O_EXCL); | ||
812 | #endif | ||
809 | if (outFileNum < 0) { | 813 | if (outFileNum < 0) { |
810 | perror(ofname); | 814 | perror(ofname); |
811 | do_exit(WARNING); | 815 | do_exit(WARNING); |
@@ -1877,7 +1877,11 @@ int gzip_main(int argc, char ** argv) | |||
1877 | 1877 | ||
1878 | 1878 | ||
1879 | /* Open output fille */ | 1879 | /* Open output fille */ |
1880 | #if (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 1) | ||
1880 | outFileNum=open( ofname, O_RDWR|O_CREAT|O_EXCL|O_NOFOLLOW); | 1881 | outFileNum=open( ofname, O_RDWR|O_CREAT|O_EXCL|O_NOFOLLOW); |
1882 | #else | ||
1883 | outFileNum=open( ofname, O_RDWR|O_CREAT|O_EXCL); | ||
1884 | #endif | ||
1881 | if (outFileNum < 0) { | 1885 | if (outFileNum < 0) { |
1882 | perror(ofname); | 1886 | perror(ofname); |
1883 | do_exit(WARNING); | 1887 | do_exit(WARNING); |
@@ -41,6 +41,7 @@ | |||
41 | #include <linux/serial.h> /* for serial_struct */ | 41 | #include <linux/serial.h> /* for serial_struct */ |
42 | #include <sys/vt.h> /* for vt_stat */ | 42 | #include <sys/vt.h> /* for vt_stat */ |
43 | #include <sys/ioctl.h> | 43 | #include <sys/ioctl.h> |
44 | #include <linux/version.h> | ||
44 | #ifdef BB_SYSLOGD | 45 | #ifdef BB_SYSLOGD |
45 | #include <sys/syslog.h> | 46 | #include <sys/syslog.h> |
46 | #endif | 47 | #endif |
@@ -49,6 +50,10 @@ | |||
49 | #error Sorry, I depend on the /proc filesystem right now. | 50 | #error Sorry, I depend on the /proc filesystem right now. |
50 | #endif | 51 | #endif |
51 | 52 | ||
53 | #ifndef KERNEL_VERSION | ||
54 | #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) | ||
55 | #endif | ||
56 | |||
52 | 57 | ||
53 | #define VT_PRIMARY "/dev/tty1" /* Primary virtual console */ | 58 | #define VT_PRIMARY "/dev/tty1" /* Primary virtual console */ |
54 | #define VT_SECONDARY "/dev/tty2" /* Virtual console */ | 59 | #define VT_SECONDARY "/dev/tty2" /* Virtual console */ |
@@ -418,9 +423,11 @@ static void halt_signal(int sig) | |||
418 | "The system is halted. Press CTRL-ALT-DEL or turn off power\r\n"); | 423 | "The system is halted. Press CTRL-ALT-DEL or turn off power\r\n"); |
419 | sync(); | 424 | sync(); |
420 | #ifndef DEBUG_INIT | 425 | #ifndef DEBUG_INIT |
426 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0) | ||
421 | if (sig == SIGUSR2) | 427 | if (sig == SIGUSR2) |
422 | reboot(RB_POWER_OFF); | 428 | reboot(RB_POWER_OFF); |
423 | else | 429 | else |
430 | #endif | ||
424 | reboot(RB_HALT_SYSTEM); | 431 | reboot(RB_HALT_SYSTEM); |
425 | #endif | 432 | #endif |
426 | exit(0); | 433 | exit(0); |
diff --git a/init/init.c b/init/init.c index 5203713ca..ba65f51fd 100644 --- a/init/init.c +++ b/init/init.c | |||
@@ -41,6 +41,7 @@ | |||
41 | #include <linux/serial.h> /* for serial_struct */ | 41 | #include <linux/serial.h> /* for serial_struct */ |
42 | #include <sys/vt.h> /* for vt_stat */ | 42 | #include <sys/vt.h> /* for vt_stat */ |
43 | #include <sys/ioctl.h> | 43 | #include <sys/ioctl.h> |
44 | #include <linux/version.h> | ||
44 | #ifdef BB_SYSLOGD | 45 | #ifdef BB_SYSLOGD |
45 | #include <sys/syslog.h> | 46 | #include <sys/syslog.h> |
46 | #endif | 47 | #endif |
@@ -49,6 +50,10 @@ | |||
49 | #error Sorry, I depend on the /proc filesystem right now. | 50 | #error Sorry, I depend on the /proc filesystem right now. |
50 | #endif | 51 | #endif |
51 | 52 | ||
53 | #ifndef KERNEL_VERSION | ||
54 | #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) | ||
55 | #endif | ||
56 | |||
52 | 57 | ||
53 | #define VT_PRIMARY "/dev/tty1" /* Primary virtual console */ | 58 | #define VT_PRIMARY "/dev/tty1" /* Primary virtual console */ |
54 | #define VT_SECONDARY "/dev/tty2" /* Virtual console */ | 59 | #define VT_SECONDARY "/dev/tty2" /* Virtual console */ |
@@ -418,9 +423,11 @@ static void halt_signal(int sig) | |||
418 | "The system is halted. Press CTRL-ALT-DEL or turn off power\r\n"); | 423 | "The system is halted. Press CTRL-ALT-DEL or turn off power\r\n"); |
419 | sync(); | 424 | sync(); |
420 | #ifndef DEBUG_INIT | 425 | #ifndef DEBUG_INIT |
426 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0) | ||
421 | if (sig == SIGUSR2) | 427 | if (sig == SIGUSR2) |
422 | reboot(RB_POWER_OFF); | 428 | reboot(RB_POWER_OFF); |
423 | else | 429 | else |
430 | #endif | ||
424 | reboot(RB_HALT_SYSTEM); | 431 | reboot(RB_HALT_SYSTEM); |
425 | #endif | 432 | #endif |
426 | exit(0); | 433 | exit(0); |
@@ -27,6 +27,7 @@ | |||
27 | #include "internal.h" | 27 | #include "internal.h" |
28 | 28 | ||
29 | #include <stdio.h> | 29 | #include <stdio.h> |
30 | #include <stdarg.h> | ||
30 | #include <assert.h> | 31 | #include <assert.h> |
31 | #include <errno.h> | 32 | #include <errno.h> |
32 | #include <sys/types.h> | 33 | #include <sys/types.h> |
diff --git a/util-linux/fbset.c b/util-linux/fbset.c index 3f7e4552a..c29145e51 100644 --- a/util-linux/fbset.c +++ b/util-linux/fbset.c | |||
@@ -32,9 +32,14 @@ | |||
32 | #include <ctype.h> | 32 | #include <ctype.h> |
33 | #include <sys/ioctl.h> | 33 | #include <sys/ioctl.h> |
34 | #include <linux/fb.h> | 34 | #include <linux/fb.h> |
35 | #include <linux/version.h> | ||
35 | 36 | ||
36 | #define PERROR(ctx) do { perror(ctx); exit(1); } while(0) | 37 | #define PERROR(ctx) do { perror(ctx); exit(1); } while(0) |
37 | 38 | ||
39 | #ifndef KERNEL_VERSION | ||
40 | #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) | ||
41 | #endif | ||
42 | |||
38 | #define DEFAULTFBDEV "/dev/fb0" | 43 | #define DEFAULTFBDEV "/dev/fb0" |
39 | #define DEFAULTFBMODE "/etc/fb.modes" | 44 | #define DEFAULTFBMODE "/etc/fb.modes" |
40 | 45 | ||
@@ -185,10 +190,16 @@ static void showmode(struct fb_var_screeninfo *v) | |||
185 | #endif | 190 | #endif |
186 | printf("\tgeometry %u %u %u %u %u\n", v->xres, v->yres, | 191 | printf("\tgeometry %u %u %u %u %u\n", v->xres, v->yres, |
187 | v->xres_virtual, v->yres_virtual, v->bits_per_pixel); | 192 | v->xres_virtual, v->yres_virtual, v->bits_per_pixel); |
193 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0) | ||
188 | printf("\ttimings %u %u %u %u %u %u %u\n", v->pixclock, v->left_margin, | 194 | printf("\ttimings %u %u %u %u %u %u %u\n", v->pixclock, v->left_margin, |
189 | v->right_margin, v->upper_margin, v->lower_margin, v->hsync_len, | 195 | v->right_margin, v->upper_margin, v->lower_margin, v->hsync_len, |
190 | v->vsync_len); | 196 | v->vsync_len); |
191 | printf("\taccel %s\n", (v->accel_flags > 0 ? "true" : "false")); | 197 | printf("\taccel %s\n", (v->accel_flags > 0 ? "true" : "false")); |
198 | #else | ||
199 | printf("\ttimings %lu %lu %lu %lu %lu %lu %lu\n", v->pixclock, v->left_margin, | ||
200 | v->right_margin, v->upper_margin, v->lower_margin, v->hsync_len, | ||
201 | v->vsync_len); | ||
202 | #endif | ||
192 | printf("\trgba %u/%u,%u/%u,%u/%u,%u/%u\n", v->red.length, v->red.offset, | 203 | printf("\trgba %u/%u,%u/%u,%u/%u,%u/%u\n", v->red.length, v->red.offset, |
193 | v->green.length, v->green.offset, v->blue.length, v->blue.offset, | 204 | v->green.length, v->green.offset, v->blue.length, v->blue.offset, |
194 | v->transp.length, v->transp.offset); | 205 | v->transp.length, v->transp.offset); |
@@ -215,7 +226,6 @@ extern int fbset_main(int argc, char **argv) | |||
215 | #endif | 226 | #endif |
216 | { | 227 | { |
217 | struct fb_var_screeninfo var, varset; | 228 | struct fb_var_screeninfo var, varset; |
218 | struct fb_fix_screeninfo fix; | ||
219 | int fh, i; | 229 | int fh, i; |
220 | char *fbdev = DEFAULTFBDEV; | 230 | char *fbdev = DEFAULTFBDEV; |
221 | char *modefile = DEFAULTFBMODE; | 231 | char *modefile = DEFAULTFBMODE; |
@@ -217,10 +217,12 @@ copyFile( const char *srcName, const char *destName, | |||
217 | if (setModes == TRUE) { | 217 | if (setModes == TRUE) { |
218 | //fprintf(stderr, "Setting permissions for %s\n", destName); | 218 | //fprintf(stderr, "Setting permissions for %s\n", destName); |
219 | chmod(destName, srcStatBuf.st_mode); | 219 | chmod(destName, srcStatBuf.st_mode); |
220 | if (followLinks == TRUE) | 220 | #if (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 1) |
221 | chown(destName, srcStatBuf.st_uid, srcStatBuf.st_gid); | 221 | if (followLinks == FALSE) |
222 | else | ||
223 | lchown(destName, srcStatBuf.st_uid, srcStatBuf.st_gid); | 222 | lchown(destName, srcStatBuf.st_uid, srcStatBuf.st_gid); |
223 | else | ||
224 | #endif | ||
225 | chown(destName, srcStatBuf.st_uid, srcStatBuf.st_gid); | ||
224 | 226 | ||
225 | times.actime = srcStatBuf.st_atime; | 227 | times.actime = srcStatBuf.st_atime; |
226 | times.modtime = srcStatBuf.st_mtime; | 228 | times.modtime = srcStatBuf.st_mtime; |