From: karthik nayak Date: Mon, 18 Nov 2024 14:18:37 GMT Subject: Re: [PATCH v2 5/7] reftable/system: provide thin wrapper for tempfile subsystem Message-ID: In-Reply-To: Patrick Steinhardt writes: [snip] > + > +int tmpfile_close(struct reftable_tmpfile *t) > +{ > + struct tempfile *tempfile = t->priv; > + int ret = close_tempfile_gently(tempfile); > + t->fd = -1; Nit: below we do `*t = REFTABLE_TMPFILE_INIT` should we keep things consistent and do the same here? > + if (ret < 0) > + return REFTABLE_IO_ERROR; > + return 0; > +} > + [snip] > +/* > + * Close the temporary file and delete it. This is a no-op in case the file has > + * already been deleted or renamed beforehand. Returns 0 on success, a reftable > + * error code on error. > + */ > +int tmpfile_delete(struct reftable_tmpfile *t); > + > +/* > + * Rename the temporary file to the provided path. The temporary file must be > + * active. Return 0 on success, a reftable error code on error. > + */ Nit: would be nice to mention that the `t` is reset here. > +int tmpfile_rename(struct reftable_tmpfile *t, const char *path); > > #endif > -- > 2.47.0.229.g8f8d6eee53.dirty