Date: Wed, 18 Sep 2024 22:54:08 +0200 From: Steffen Nurpmeso <steffen@sdaoden.eu> To: "Stephen J. Kiernan" <stevek@FreeBSD.org> Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: ce9c3abf69c2 - main - config: Search include paths for files to be read (options, files) Message-ID: <20240918205408.TbriDa0K@steffen%sdaoden.eu> In-Reply-To: <202409181954.48IJsBgL047458@gitrepo.freebsd.org> References: <202409181954.48IJsBgL047458@gitrepo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Hello. Stephen J. Kiernan wrote in <202409181954.48IJsBgL047458@gitrepo.freebsd.org>: ... |URL: https://cgit.FreeBSD.org/src/commit/?id=ce9c3abf69c2044c1aab0aa62e4\ |a73f8eb13d787 | |commit ce9c3abf69c2044c1aab0aa62e4a73f8eb13d787 |Author: Stephen J. Kiernan <stevek@FreeBSD.org> |AuthorDate: 2024-09-18 19:49:46 +0000 |Commit: Stephen J. Kiernan <stevek@FreeBSD.org> |CommitDate: 2024-09-18 19:49:46 +0000 | | config: Search include paths for files to be read (options, files) | | This is useful for downstream consumers to add their own kernel config | files in another directory other than the default ones. | | Obtained from: Juniper Networks, Inc. | Differential Revision: https://reviews.freebsd.org/D44538 ... |- char *rfile, *compilewith, *depends, *clean, *warning; |+ char *rfile, *compilewith, *depends, *clean, *fnamebuf, *warning; ^fnamebuf is new ... |+ asprintf(&fnamebuf, "%s/%s", ipath->path, fname); |+ if (fnamebuf != NULL) { |+ fp = fopen(fnamebuf, "r"); |+ if (fp != NULL) |+ break; ^ and surely leaked in case the fopen(3) succeeds. Given the reviewers of the patch however i would assume it does not really hurt. |+ free(fnamebuf); |+ } |+ } |+ } | if (fp == NULL) | err(1, "%s", fname); Having said that. Why is that file marked .cc aka C++? This is so pure basic C Mr. Somers surely gets goose pimples, and then comes back complaining that a memory safe language would not have had this problem. File pointer, asprintf (horrors!), lots of char pointers, SLIST_FOREACH() not some object encapsulating possible difficulties, and what not. In short -- this changeset is surely meant to buy Rust some buffalo nickels, and whereas some maybe smile, the Rust gets armored steel .. and in the end we have to use this merde (imho). --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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20240918205408.TbriDa0K>