Re: [PATCH v2 5/7] reftable/system: provide thin wrapper for tempfile subsystem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Patrick Steinhardt <ps@xxxxxx> 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

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux