Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Jan 2002 22:13:10 +0100
From:      Anders Andersson <anders@hack.org>
To:        gnome@FreeBSD.org
Subject:   x11/gnomeapplets
Message-ID:  <20020103211310.GA320@sushi.sanyusan.se>

next in thread | raw e-mail | index | archive | help
I got inspired bye Alfreds patch to sysutils/xbattbar which changed
xbattbar to use a readonly /dev/apm. 

So I patched gnomeapplets battery_applet to do this at it seems to work
fine on -CURRENT at least.

[root@sushi gnome-applets-1.4.0.4]# diff -u battery/read-battery.c.orig
battery/read-battery.c      
--- battery/read-battery.c.orig	Thu Jan  3 22:05:06 2002
+++ battery/read-battery.c	Thu Jan  3 21:42:30 2002
@@ -170,7 +170,7 @@
   *hours_remaining = -1;
   *minutes_remaining = 1;
       
-  fd = open(APMDEV, O_RDWR);
+  fd = open(APMDEV, O_RDONLY);
   if (fd == -1)
     {
	g_error (_("Cannot open /dev/apm; can't get data."));


Do any of you know why it was O_RDWR in the first place? I didnt find
any explanation on the gnome cvs commit logs.
-- 
Anders Andersson <anders@hack.org>
UNIX, Networking and Security consultant
(+46) 705 87 53 35

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-gnome" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020103211310.GA320>