X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Frfkill.c;h=77c5b92cf1f54666b3be3a80d69b2f33eee7668d;hb=fb8105e36eee2dd8a0671a3fcc7cfe307acdaf7a;hp=17592da98cb9e87f2294bd03980a468a1202809b;hpb=02a2af243c0c1db909e8aee7ac8bddb0fcdcdcb7;p=framework%2Fconnectivity%2Fconnman.git diff --git a/src/rfkill.c b/src/rfkill.c index 17592da..77c5b92 100644 --- a/src/rfkill.c +++ b/src/rfkill.c @@ -2,7 +2,7 @@ * * Connection Manager * - * Copyright (C) 2007-2010 Intel Corporation. All rights reserved. + * Copyright (C) 2007-2012 Intel Corporation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -23,6 +23,7 @@ #include #endif +#define _GNU_SOURCE #include #include #include @@ -172,7 +173,7 @@ int __connman_rfkill_block(enum connman_service_type type, connman_bool_t block) if (rfkill_type == NUM_RFKILL_TYPES) return -EINVAL; - fd = open("/dev/rfkill", O_RDWR); + fd = open("/dev/rfkill", O_RDWR | O_CLOEXEC); if (fd < 0) return fd; @@ -197,7 +198,7 @@ int __connman_rfkill_init(void) DBG(""); - fd = open("/dev/rfkill", O_RDWR); + fd = open("/dev/rfkill", O_RDWR | O_CLOEXEC); if (fd < 0) { connman_error("Failed to open RFKILL control device"); return -EIO;