From owner-svn-src-head@freebsd.org Tue Feb 20 20:48:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51B39F01538 for ; Tue, 20 Feb 2018 20:48:04 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wr0-x235.google.com (mail-wr0-x235.google.com [IPv6:2a00:1450:400c:c0c::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B9E6B6EA34 for ; Tue, 20 Feb 2018 20:48:03 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wr0-x235.google.com with SMTP id w77so18160568wrc.6 for ; Tue, 20 Feb 2018 12:48:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=+3yB7Js63sx1UsT2sY7zUqVCOBfcHD6D14RqU61HEZk=; b=KiO0bGTYhe1jDsnmTPXdKnok+Pi4TrEjUe9ovyLu3vwVyTKW2ljtfsH6Z9GmDlk+kZ BwI5IIOlOsR1r99TmvhXYx1cV1g0ecEQIkoysHirYsUUWg/Jcib6KvC6czPLbHeA1cuV x0N2CdL8arFn1RsSFVYDK4dQgAc40Zpgywm1gIBlBHEfG37o1tHx4T7UK1VLaiv6IVC4 Ky+K8u6QqIqPTUYXQKWX26Uhu+Eq+gHZHj062AbKBrwsmdlam2D79B5QF0RA2Sxi94QC BejKm2KzBcyK76T3bvkflOV2XVgDD5GIjs34N7WWbt06qMGTVphq52wui5WXqO0TIliH gcGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=+3yB7Js63sx1UsT2sY7zUqVCOBfcHD6D14RqU61HEZk=; b=A1jaqxTGr2mK/jHVIWknnKIU5gEn7cax3nXUk0nAVFYzDRbQ8fQ4FHtc7K9mKqml1H o1Hrpk9BIGqZU4WTnPGWa4wXQDxJ5NPeFRs/EtWedgSYqbN8Plb55UGNiWIR/L6OZowb M8UqGQVCy5/y0dGbcbFLf3J2F9RWlsX4xIRc/cbbPURtrz7tbZWyPZxrY+faU/VLME/R GBxrDRX/jXGyB6+HWrhWfCeu0hv67YR4UX5zX8u523GrJ9Ch1jqWf2V9MdaLR6kShQHT JvlO6uFglyvI2Lp5SMOGj3itDkS+2wgxil4EQeV+GC0UF9wFpgG5pOYFteaADMYfx1yR y/gA== X-Gm-Message-State: APf1xPBun5xp46q/KHK5bB7mPoHKH1zGqDUhvloHzwjH0xMZ/pp9OcWL JOYX+yjmXTJSvIRAkmugmBknxCyVAiJAIP7kz33mfg== X-Google-Smtp-Source: AH8x22516WONfdaz7zt3KMvVIiVQLwiFSTLUMW5I3Qk2X2kRHFEQRetr+0+3MYx5+HsHGdz1xPgyqInyhn3wjSdAgTE= X-Received: by 10.80.170.131 with SMTP id q3mr1912313edc.43.1519159682742; Tue, 20 Feb 2018 12:48:02 -0800 (PST) MIME-Version: 1.0 Received: by 10.80.148.97 with HTTP; Tue, 20 Feb 2018 12:48:02 -0800 (PST) In-Reply-To: <201802201821.w1KILUUg079715@repo.freebsd.org> References: <201802201821.w1KILUUg079715@repo.freebsd.org> From: Oliver Pinter Date: Tue, 20 Feb 2018 21:48:02 +0100 Message-ID: Subject: Re: svn commit: r329649 - head/stand/liblua To: Conrad Meyer Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Feb 2018 20:48:04 -0000 On Tuesday, February 20, 2018, Conrad Meyer wrote: > Author: cem > Date: Tue Feb 20 18:21:30 2018 > New Revision: 329649 > URL: https://svnweb.freebsd.org/changeset/base/329649 > > Log: > Lua lfs.attributes: Provide a more consistent error return > > In the remaining error case, return a 3-tuple consistent with the other > error return case. > > Document how to invoke lfs.attributes() and detect/decode error return in > example comments. > > Reviewed by: kevans > Sponsored by: Dell EMC Isilon > Differential Revision: https://reviews.freebsd.org/D14451 > > Modified: > head/stand/liblua/lfs.c > > Modified: head/stand/liblua/lfs.c > ============================================================ > ================== > --- head/stand/liblua/lfs.c Tue Feb 20 18:12:07 2018 (r329648) > +++ head/stand/liblua/lfs.c Tue Feb 20 18:21:30 2018 (r329649) > @@ -80,13 +80,20 @@ __FBSDID("$FreeBSD$"); > * (etc.) > * > * The other available API is lfs.attributes(), which functions somewhat > like > - * stat(2) and returns a table of values: > + * stat(2) and returns a table of values. Example code: > * > - * for k, v in pairs(lfs.attributes("/boot")) do > + * attrs, errormsg, errorcode = lfs.attributes("/boot") > + * if attrs == nil then > + * print(errormsg) > + * return errorcode > + * end > + * > + * for k, v in pairs(attrs) do > * print(k .. ":\t" .. v) > * end > + * return 0 Hi! Missing ; at the end of lines here. > * > - * Prints: > + * Prints (on success): > * gid: 0 > * change: 140737488342640 > * mode: directory > @@ -277,7 +284,9 @@ lua_attributes(lua_State *L) > path = luaL_checkstring(L, 1); > if (path == NULL) { > lua_pushnil(L); > - return 1; > + lua_pushfstring(L, "cannot convert first argument to > string"); > + lua_pushinteger(L, EINVAL); > + return 3; > } > > rc = stat(path, &sb); > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" >