Re: [ANNOUNCE] Git v2.32.0-rc3 - t5300 Still Broken on NonStop ia64/x86

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

 



Am 04.06.21 um 03:36 schrieb Junio C Hamano:
> ---
>
>  write-or-die.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git i/write-or-die.c w/write-or-die.c
> index eab8c8d0b9..534b2f5cba 100644
> --- i/write-or-die.c
> +++ w/write-or-die.c
> @@ -57,7 +57,11 @@ void fprintf_or_die(FILE *f, const char *fmt, ...)
>
>  void fsync_or_die(int fd, const char *msg)
>  {
> -	if (fsync(fd) < 0) {
> +	int status;
> +
> +	while ((status = fsync(fd)) < 0 && errno == EINTR)
> +		; /* try again */
> +	if (status < 0) {
>  		die_errno("fsync error on '%s'", msg);
>  	}
>  }

The function body can be written like this:

	while (fsync(fd) < 0) {
		if (errno != EINTR)
			die_errno("fsync error on '%s'", msg);
	}

I find it easier to read because it has less syntax elements
and is shorter.  Bikeshedding, of course. :-/

René




[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