]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
open device read-only for list and event operations
authorMarcel Holtmann <marcel@holtmann.org>
Fri, 5 Jun 2009 10:31:10 +0000 (12:31 +0200)
committerJohannes Berg <johannes@sipsolutions.net>
Fri, 5 Jun 2009 10:33:56 +0000 (12:33 +0200)
rfkill.c

index c26d396cd304061c1070dd441ab2ca81ccc9e5be..a7f5f64b0152e492d6e31a51c2c04dae8533c716 100644 (file)
--- a/rfkill.c
+++ b/rfkill.c
@@ -24,7 +24,7 @@ static void rfkill_event(void)
        ssize_t len;
        int fd, n;
 
-       fd = open("/dev/rfkill", O_RDWR);
+       fd = open("/dev/rfkill", O_RDONLY);
        if (fd < 0) {
                perror("Can't open RFKILL control device");
                return;
@@ -119,7 +119,7 @@ static void rfkill_list(void)
        ssize_t len;
        int fd;
 
-       fd = open("/dev/rfkill", O_RDWR);
+       fd = open("/dev/rfkill", O_RDONLY);
        if (fd < 0) {
                perror("Can't open RFKILL control device");
                return;