diff options
author | erik <erik@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 1999-12-17 18:44:15 +0000 |
---|---|---|
committer | erik <erik@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 1999-12-17 18:44:15 +0000 |
commit | 3132131d6265f6107c652f634c8b4a3e006fb46f (patch) | |
tree | 1d18bbba8f8a1d78d7ff13e7a87ee2aab165125f /util-linux | |
parent | 0055f41a9885374ff57a4b90af63aaac6dd01f58 (diff) | |
download | busybox-w32-3132131d6265f6107c652f634c8b4a3e006fb46f.tar.gz busybox-w32-3132131d6265f6107c652f634c8b4a3e006fb46f.tar.bz2 busybox-w32-3132131d6265f6107c652f634c8b4a3e006fb46f.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
git-svn-id: svn://busybox.net/trunk/busybox@243 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'util-linux')
-rw-r--r-- | util-linux/fbset.c | 12 |
1 files changed, 11 insertions, 1 deletions
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; |