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

Re: [Xen-devel] [PATCH for-4.11 v4 1/1] Add new add_maintainers.pl script to optimise the workflow when using git format-patch with get_maintainer.pl



Lars Kurth writes ("[PATCH for-4.11 v4 1/1] Add new add_maintainers.pl script 
to optimise the workflow when using git format-patch with get_maintainer.pl"):
> The tool covers step 2 of the following workflow

Thanks.  Sorry to spot this only now, but

> +sub writefile ($$) {
> +    my ($content, $file) = @_;
> +    my $fh;
> +    open($fh, ">", $file)
> +         or die "Could not open file '$file' $!";
> +    print $fh $content or die $!;
> +    close $fh or die $!;
> +}

this will lose data if your disk is full.

You want:

  sub writefile ($$) {
      my ($content, $file) = @_;
      my $fh;
      open($fh, ">", "$file.tmp")
           or die "Could not open file '$file.tmp' $!";
      print $fh $content or die $!;
      close $fh or die $!;
      ranem "$file.tmp", $file or die "Could not rename '$file' into place $!";
  }

(NB: untested.)

Aside from that,

Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>

Do you want me to pick up my suggested change and test it ?

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.