Re: [PATCH obexd 4/4] Add copy and move support for filesystem plugin

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

 



Hi Luiz,

On Fri, Jun 17, 2011, Luiz Augusto von Dentz wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>
> 
> Move is implemented using rename and copy uses sendfile, both part of
> posix.
> ---
>  plugins/filesystem.c |   93 ++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 files changed, 93 insertions(+), 0 deletions(-)

The first three patches have been pushed upstream, but could you please
fix a few things with this one:

> +static int filesystem_copy(const char *name, const char *destname)
> +{
> +	void *in, *out;
> +	ssize_t ret;
> +	size_t size;
> +	struct stat fstat;
> +	int err;
> +
> +	in = filesystem_open(name, O_RDONLY, 0, NULL, &size, &err);
> +	if (in == NULL) {
> +		error("open(%s): %s (%d)", name, strerror(-err), -err);
> +		return -err;
> +	}

Could you create local int type variables here (in_fd and out_fd) so
that it's clear what filesystem_open has returned and you don't need to
do the GPOINTER_TO_INT cast in every place.

> +	ret = stat(name, &fstat);

Since you already have the fd, please use fstat instead.

Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux