From nobody Mon Sep 30 19:48:22 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XHWpS3fChz5XZgx; Mon, 30 Sep 2024 19:48:32 +0000 (UTC) (envelope-from steffen@sdaoden.eu) Received: from sdaoden.eu (sdaoden.eu [217.144.132.164]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4XHWpS0hHRz49QR; Mon, 30 Sep 2024 19:48:32 +0000 (UTC) (envelope-from steffen@sdaoden.eu) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sdaoden.eu; s=citron; t=1727725703; x=1728392369; h=date:author:from:to:cc:subject: message-id:in-reply-to:references:mail-followup-to:openpgp:blahblahblah: author:from:subject:date:to:cc:resent-author:resent-date:resent-from: resent-sender:resent-to:resent-cc:resent-reply-to:resent-message-id: in-reply-to:references:mime-version:content-type: content-transfer-encoding:content-disposition:content-id: content-description:message-id:mail-followup-to:openpgp:blahblahblah; bh=q/Lo0boy7KD4RMRwngtyZedl+5Nrj6GcRZeISm7zofA=; b=HESQGc3Dm2ZxgZuilUfOguQtYG8trVjliTDYxJo6tkq67Hd9smJihMpuC0jtnaE7BASl62PJ ZAy8+KvhDAsHnkYkRHcQpBcP8liYDfR3h0rKO5G6F9IPhLkTKWhejBWrJSVCYOO46FceBD0O8g WYvKVa6syTxACVJzfspeZdGe+p/3RBeD6HhXiGHmovzYoApJsnM5+VHLL9ya8vykzqEu3K+Ddi 76J5vBotBTadYDdiwo+CMh2wJcxnnrsUbq9eG8JrrkKkQCTmSP2doUtG0C1cO7rh6MyjxWbBJJ Xp0eKCIJo0BG/ho7FEO9icsSI+ZiykiTA2QRR9hd6CaJbb1w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=sdaoden.eu; s=orange; t=1727725703; x=1728392369; h=date:author:from:to:cc:subject: message-id:in-reply-to:references:mail-followup-to:openpgp:blahblahblah: author:from:subject:date:to:cc:resent-author:resent-date:resent-from: resent-sender:resent-to:resent-cc:resent-reply-to:resent-message-id: in-reply-to:references:mime-version:content-type: content-transfer-encoding:content-disposition:content-id: content-description:message-id:mail-followup-to:openpgp:blahblahblah; bh=q/Lo0boy7KD4RMRwngtyZedl+5Nrj6GcRZeISm7zofA=; b=kVHln+lk0aSOqSvOE7Z9wGkrdKHgOYK0/Od5lon9oPvlVWLCA+Wo7MtLpInK0/tGHv6GOD5D yIMrEvG2gtVVCQ== Date: Mon, 30 Sep 2024 21:48:22 +0200 Author: Steffen Nurpmeso From: Steffen Nurpmeso To: Kyle Evans Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: c2caf3b3313f - main - flua: lposix: add more useful functions for general purpose scripts Message-ID: <20240930194822.k7nwRuRt@steffen%sdaoden.eu> In-Reply-To: <202409300353.48U3rZM7000710@gitrepo.freebsd.org> References: <202409300353.48U3rZM7000710@gitrepo.freebsd.org> Mail-Followup-To: Kyle Evans , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org User-Agent: s-nail v14.9.25-608-ge479530e8d OpenPGP: id=EE19E1C1F2F7054F8D3954D8308964B51883A0DD; url=https://ftp.sdaoden.eu/steffen.asc; preference=signencrypt BlahBlahBlah: Any stupid boy can crush a beetle. But all the professors in the world can make no bugs. X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15987, ipnet:217.144.128.0/20, country:DE] X-Rspamd-Queue-Id: 4XHWpS0hHRz49QR X-Spamd-Bar: ---- List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org .. i have zero idea (and only look at time), but .. Kyle Evans wrote in <202409300353.48U3rZM7000710@gitrepo.freebsd.org>: |commit c2caf3b3313fe73bfc9b4b984c21da8d571f8798 |Author: Kyle Evans |AuthorDate: 2023-03-11 06:03:02 +0000 |Commit: Kyle Evans |CommitDate: 2024-09-30 03:52:20 +0000 | | flua: lposix: add more useful functions for general purpose scripts ... |+static int |+lua_read(lua_State *L) |+{ |+ char *buf; |+ ssize_t ret; |+ size_t sz; |+ int error, fd, narg; |+ |+ narg = lua_gettop(L); |+ luaL_argcheck(L, narg == 2, 1, |+ "read takes exactly two arguments (fd, size)"); |+ |+ fd = luaL_checkinteger(L, 1); |+ sz = luaL_checkinteger(L, 2); |+ |+ if (fd < 0) { |+ error = EBADF; |+ goto err; |+ } |+ |+ buf = malloc(sz); |+ if (buf == NULL) |+ goto err; |+ |+ /* |+ * For 0-byte reads, we'll still push the empty string and let the |+ * caller deal with EOF to match lposix semantics. |+ */ |+ ret = read(fd, buf, sz); |+ if (ret >= 0) |+ lua_pushlstring(L, buf, ret); |+ else if (ret < 0) |+ error = errno; /* Save to avoid clobber by free() */ |+ |+ free(buf); |+ if (error != 0) ^ uninit in ret>=0 case. ("Even clang should get it" (stupid me).) |+ goto err; |+ /* Just the string pushed. */ |+ return (1); |+err: ... --steffen | |Der Kragenbaer, The moon bear, |der holt sich munter he cheerfully and one by one |einen nach dem anderen runter wa.ks himself off |(By Robert Gernhardt)