diff options
author | edwin <edwin@FreeBSD.org> | 2002-11-15 10:04:19 +0800 |
---|---|---|
committer | edwin <edwin@FreeBSD.org> | 2002-11-15 10:04:19 +0800 |
commit | 19706f23f2b75e32ad5c8ec8b02f16ded7a129ae (patch) | |
tree | a9482b5dc4659406328311d20d9807895ba104f1 /sysutils/sjog | |
parent | d471cb637a445a9eb84744e26a6f8921bad7ac5d (diff) | |
download | freebsd-ports-gnome-19706f23f2b75e32ad5c8ec8b02f16ded7a129ae.tar.gz freebsd-ports-gnome-19706f23f2b75e32ad5c8ec8b02f16ded7a129ae.tar.zst freebsd-ports-gnome-19706f23f2b75e32ad5c8ec8b02f16ded7a129ae.zip |
Unbreak building of sysutils/sjog
Noticed on: bento
Diffstat (limited to 'sysutils/sjog')
-rw-r--r-- | sysutils/sjog/files/patch-setbrightness::Makefile.am | 3 | ||||
-rw-r--r-- | sysutils/sjog/files/patch-setbrightness::setbrightness.c | 73 |
2 files changed, 35 insertions, 41 deletions
diff --git a/sysutils/sjog/files/patch-setbrightness::Makefile.am b/sysutils/sjog/files/patch-setbrightness::Makefile.am index 3f32f29e6b3c..337fa57c7589 100644 --- a/sysutils/sjog/files/patch-setbrightness::Makefile.am +++ b/sysutils/sjog/files/patch-setbrightness::Makefile.am @@ -4,8 +4,7 @@ bin_PROGRAMS = setbrightness --setbrightness_SOURCES = setbrightness.c -+setbrightness_SOURCES = setbrightness.c + setbrightness_SOURCES = setbrightness.c + +LDADD = ../src/sonypi.o ../src/pci_freebsd.o diff --git a/sysutils/sjog/files/patch-setbrightness::setbrightness.c b/sysutils/sjog/files/patch-setbrightness::setbrightness.c index 05ece8e0d580..efe6cbaba3f5 100644 --- a/sysutils/sjog/files/patch-setbrightness::setbrightness.c +++ b/sysutils/sjog/files/patch-setbrightness::setbrightness.c @@ -1,86 +1,81 @@ ---- setbrightness/setbrightness.c Wed Oct 23 20:32:07 2002 -+++ setbrightness/setbrightness.c.orig Sat Jul 28 10:16:22 2001 -@@ -1,57 +1,44 @@ --/* FreeBSD modifications by Jay Kuri jk@oneway.com 08/13/01 */ -- - #define _XOPEN_SOURCE 500 - #include <stdio.h> - #include <stdlib.h> +--- setbrightness/setbrightness.c.orig Fri Nov 15 12:59:59 2002 ++++ setbrightness/setbrightness.c Fri Nov 15 13:02:36 2002 +@@ -4,41 +4,52 @@ #include <unistd.h> #include <fcntl.h> #include <errno.h> --#ifndef __FreeBSD__ ++#ifndef __FreeBSD__ #include <sys/io.h> --#endif ++#endif #include <sys/mman.h> #include <dirent.h> #include <ctype.h> -+#include <malloc.h> +-#include <malloc.h> #include <string.h> #include <signal.h> --#ifndef __FreeBSD__ ++#ifndef __FreeBSD__ #include <getopt.h> #include <linux/pci.h> --#endif ++#endif #include <sys/time.h> --#ifdef __FreeBSD__ --#include <machine/cpufunc.h> --#include "../src/sonypi.h" --#endif ++#ifdef __FreeBSD__ ++#include <machine/cpufunc.h> ++#include "../src/sonypi.h" ++#endif #define BRIGHTNESS 0x96 #define DATA_REG 0x62 #define CST_REG 0x66 --#ifndef __FreeBSD__ ++#ifndef __FreeBSD__ typedef unsigned short u16; --#define OUTW outw --#define OUTB outb --#endif ++#define OUTW outw ++#define OUTB outb ++#endif static void ecr_set(u16 value) { while (inw(CST_REG) & 3) usleep(1); -- OUTW(0x81, CST_REG); -+ outw(0x81, CST_REG); +- outw(0x81, CST_REG); ++ OUTW(0x81, CST_REG); while (inw(CST_REG) & 2) usleep(1); -- OUTW(BRIGHTNESS, DATA_REG); -+ outw(BRIGHTNESS, DATA_REG); +- outw(BRIGHTNESS, DATA_REG); ++ OUTW(BRIGHTNESS, DATA_REG); while (inw(CST_REG) & 2) usleep(1); -- OUTW(value, DATA_REG); -+ outw(value, DATA_REG); +- outw(value, DATA_REG); ++ OUTW(value, DATA_REG); while (inw(CST_REG) & 2) usleep(1); } static u16 ecr_get() { while (inw(CST_REG) & 3) usleep(1); -- OUTB(0x80, CST_REG); -+ outb(0x80, CST_REG); +- outb(0x80, CST_REG); ++ OUTB(0x80, CST_REG); while (inw(CST_REG) & 2) usleep(1); -- OUTB(BRIGHTNESS, DATA_REG); -+ outb(BRIGHTNESS, DATA_REG); +- outb(BRIGHTNESS, DATA_REG); ++ OUTB(BRIGHTNESS, DATA_REG); while (inw(CST_REG) & 2) usleep(1); return (inw(DATA_REG)&255); } -@@ -65,17 +52,14 @@ +@@ -52,14 +63,17 @@ int main(int argc, char *argv[]) { --#ifndef __FreeBSD__ ++#ifndef __FreeBSD__ ioperm(DATA_REG, 0x08, 1); --#endif ++#endif if( geteuid() != 0 ) fprintf(stdout, "You must be root to use %s\n", argv[0]); else if( argc == 2 && strcmp(argv[1], "--read") == 0) -- { -- iopl(3); ++ { ++ iopl(3); printf("%d\n", ecr_get()); -- } else if( argc != 2 || !isdigit(argv[1][0])) -+ -+ else if( argc != 2 || !isdigit(argv[1][0])) +- +- else if( argc != 2 || !isdigit(argv[1][0])) ++ } else if( argc != 2 || !isdigit(argv[1][0])) usage(); else |