From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH iproute2/net-next v3]tc: B.W limits can now be specified in %. Date: Fri, 17 Nov 2017 12:54:29 -0800 Message-ID: <20171117125429.39d68251@xeon-e3> References: <20171117204335.GA17658@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, doucette@bu.edu, michel.machado@gmail.com To: Nishanth Devarajan Return-path: Received: from mail-pg0-f46.google.com ([74.125.83.46]:32960 "EHLO mail-pg0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761859AbdKQUyi (ORCPT ); Fri, 17 Nov 2017 15:54:38 -0500 Received: by mail-pg0-f46.google.com with SMTP id s75so2794790pgs.0 for ; Fri, 17 Nov 2017 12:54:37 -0800 (PST) In-Reply-To: <20171117204335.GA17658@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: On Sat, 18 Nov 2017 02:13:38 +0530 Nishanth Devarajan wrote: > + result = strtoul(buf, &endp, 0); > + > + if (*endp || buf == endp) { > + fprintf(stderr, "value \"%s\" in file %s is not a number\n", > + buf, fname); > + goto out; > + } > + > + if (result == ULONG_MAX && errno == ERANGE) { > + fprintf(stderr, "strtoul %s: %s", fname, strerror(errno)); > + goto out; > + } Since speed value of unknown is represented as "-1" I think you need to change this API to take signed value (ie use strtol)