From commits-return-4921-archive-asf-public=cust-asf.ponee.io@nuttx.apache.org Fri Mar 13 23:21:21 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 0C53118062C for ; Sat, 14 Mar 2020 00:21:20 +0100 (CET) Received: (qmail 20790 invoked by uid 500); 13 Mar 2020 23:21:20 -0000 Mailing-List: contact commits-help@nuttx.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@nuttx.apache.org Delivered-To: mailing list commits@nuttx.apache.org Received: (qmail 20780 invoked by uid 99); 13 Mar 2020 23:21:20 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Mar 2020 23:21:20 +0000 From: GitBox To: commits@nuttx.apache.org Subject: [GitHub] [incubator-nuttx] patacongo commented on a change in pull request #558: libs/libc/netdb/lib_dnsaddserver.c: Fix wrong fopen() mode. Message-ID: <158414168032.21195.743998849811923478.gitbox@gitbox.apache.org> References: In-Reply-To: Date: Fri, 13 Mar 2020 23:21:20 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit patacongo commented on a change in pull request #558: libs/libc/netdb/lib_dnsaddserver.c: Fix wrong fopen() mode. URL: https://github.com/apache/incubator-nuttx/pull/558#discussion_r392524223 ########## File path: libs/libc/netdb/lib_dnsaddserver.c ########## @@ -87,7 +87,7 @@ int dns_add_nameserver(FAR const struct sockaddr *addr, socklen_t addrlen) int status; int ret; - stream = fopen(CONFIG_NETDB_RESOLVCONF_PATH, "at"); + stream = fopen(CONFIG_NETDB_RESOLVCONF_PATH, "r"); Review comment: > But if you read the whole function carefully, you can find dns_add_nameserver don't has any other real action if the file can't write. From the little reading I have done, that does not seem exactly the case: - If DHCPC is used the, yes, /etc/resolve/conf may be updated (via resolvconf). In this case, resolv.conf would need to be on writable media. But updates to resovle.conf from DHCPC is not supported by our implementation of DHCPC. - On static IP configurations without DHCPC, resolve.conf is not modified by the system, and hence would be effectly read-only. Or am I reading that wrong. If the above is correct, then at the present time the argument should be "r" but would have to be revisited if the capability of DHCPC were improved. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org With regards, Apache Git Services