[pve-devel] [PATCH v2 librados2-perl 1/3] white space cleanup
Thomas Lamprecht
t.lamprecht at proxmox.com
Thu Apr 5 08:14:05 CEST 2018
Still doesn't applies....
I recreated your patch with s/\s+$//g and compared, all the empty "stay
lines"
(i.e., lines from context which are not touched by the patch) miss their
initial
space (in patches the first character in a line is special: '-' means
remove,
'+' means add line, ' ' (space) means this line stays the same).
So you patch, as is, cannot work!
Am 04/04/2018 um 05:37 PM schrieb Alwin Antreich:
> Signed-off-by: Alwin Antreich <a.antreich at proxmox.com>
> ---
> note: seems that, this one is need for the following patches to apply
FYI: It's only needed if you had it in your git tree, else it wouldn't
be needed,
git can operate just fine on trailing whitespaces in otherwise empty lines.
(although it complains when applying the mail, but still does the work)
If you insist that you, in fact, did not had any commit, changing those
trailing
whitespaces, in your history the only other reason I could immagine is that
your mail got scrambled by your MTA (unlikely if you use git send-email) or
by you when doing a last minute correction during sending (never do this,
I know everyone including myself does sometimes - being 100% sure it was
correct, but fact is: this action is heavily cursed and in >80% of the cases
you will end up with a patch which won't apply or has a new bug)
In your case it's highly probably your MTA stripping away trailing spaces
(bad MTA!) as it's just to consistent in your patch...
Other patches apply just fine, and I use a pretty vanilla setup which worked
for a few years good, so I guess/hope that it is not a fault here with
me. :)
> PVE/RADOS.pm | 12 ++++++------
> RADOS.xs | 32 ++++++++++++++++----------------
> 2 files changed, 22 insertions(+), 22 deletions(-)
>
> diff --git a/PVE/RADOS.pm b/PVE/RADOS.pm
> index aa6a102..aff8141 100644
> --- a/PVE/RADOS.pm
> +++ b/PVE/RADOS.pm
> @@ -43,7 +43,7 @@ my $writedata = sub {
> my ($fh, $cmd, $data) = @_;
>
> local $SIG{PIPE} = 'IGNORE';
> -
> +
> my $bin = pack "a L/a*", $cmd, $data || '';
> my $res = syswrite $fh, $bin;
>
> @@ -63,7 +63,7 @@ my $readdata = sub {
> return undef if $allow_eof && length($head) == 0;
>
> die "partial read\n" if length($head) < 5;
> -
> +
> my ($cmd, $len) = unpack "a L", $head;
>
> my $data = '';
> @@ -86,7 +86,7 @@ my $kill_worker = sub {
> close($self->{child}) if defined($self->{child});
>
> # only kill if we created the process
> - return if $self->{pid} != $$;
> + return if $self->{pid} != $$;
>
> kill(9, $self->{cpid});
> waitpid($self->{cpid}, 0);
> @@ -140,7 +140,7 @@ sub new {
>
> if ($cpid) { # parent
> close $parent;
> -
> +
> $self->{cpid} = $cpid;
> $self->{child} = $child;
>
> @@ -182,7 +182,7 @@ sub new {
>
> for (;;) {
> my ($cmd, $data) = &$readdata($parent, 1);
> -
> +
> last if !$cmd || $cmd eq 'Q';
>
> my $res;
> @@ -203,7 +203,7 @@ sub new {
> }
> &$writedata($parent, '>', $res);
> }
> -
> +
> exit(0);
> }
>
> diff --git a/RADOS.xs b/RADOS.xs
> index a9f6bc3..66fa65a 100644
> --- a/RADOS.xs
> +++ b/RADOS.xs
> @@ -13,14 +13,14 @@
>
> MODULE = PVE::RADOS PACKAGE = PVE::RADOS
>
> -rados_t
> -pve_rados_create()
> +rados_t
> +pve_rados_create()
> PROTOTYPE:
> CODE:
> -{
> - rados_t clu = NULL;
> +{
> + rados_t clu = NULL;
> int ret = rados_create(&clu, NULL);
> -
> +
> if (ret == 0)
> RETVAL = clu;
> else {
> @@ -31,7 +31,7 @@ CODE:
> OUTPUT: RETVAL
>
> void
> -pve_rados_conf_set(cluster, key, value)
> +pve_rados_conf_set(cluster, key, value)
> rados_t cluster
> char *key
> char *value
> @@ -41,13 +41,13 @@ CODE:
> DPRINTF("pve_rados_conf_set %s = %s\n", key, value);
>
> int res = rados_conf_set(cluster, key, value);
> - if (res < 0) {
> + if (res < 0) {
> die("rados_conf_set failed - %s\n", strerror(-res));
> }
> }
>
> void
> -pve_rados_connect(cluster)
> +pve_rados_connect(cluster)
> rados_t cluster
> PROTOTYPE: $
> CODE:
> @@ -58,7 +58,7 @@ CODE:
> if (res < 0) {
> die("rados_conf_read_file failed - %s\n", strerror(-res));
> }
> -
> +
> res = rados_connect(cluster);
> if (res < 0) {
> die("rados_connect failed - %s\n", strerror(-res));
> @@ -66,7 +66,7 @@ CODE:
> }
>
> void
> -pve_rados_shutdown(cluster)
> +pve_rados_shutdown(cluster)
> rados_t cluster
> PROTOTYPE: $
> CODE:
> @@ -76,7 +76,7 @@ CODE:
> }
>
> SV *
> -pve_rados_mon_command(cluster, cmds)
> +pve_rados_mon_command(cluster, cmds)
> rados_t cluster
> AV *cmds
> PROTOTYPE: $$
> @@ -99,7 +99,7 @@ CODE:
> cmd[cmdlen] = SvPV_nolen(arg);
> DPRINTF("pve_rados_mon_command%zd %s\n", cmdlen, cmd[cmdlen]);
> cmdlen++;
> - }
> + }
>
> int ret = rados_mon_command(cluster, cmd, cmdlen,
> NULL, 0,
> @@ -112,15 +112,15 @@ CODE:
> rados_buffer_free(outs);
> die(msg);
> }
> -
> +
> RETVAL = newSVpv(outbuf, outbuflen);
>
> rados_buffer_free(outbuf);
> }
> OUTPUT: RETVAL
>
> -HV *
> -pve_rados_cluster_stat(cluster)
> +HV *
> +pve_rados_cluster_stat(cluster)
> rados_t cluster
> PROTOTYPE: $
> CODE:
> @@ -130,7 +130,7 @@ CODE:
> DPRINTF("pve_rados_cluster_stat");
>
> int ret = rados_cluster_stat(cluster, &result);
> -
> +
> if(ret != 0) {
> warn("rados_cluster_stat failed (ret=%d)\n", ret);
> XSRETURN_UNDEF;
> --
> 2.11.0
>
>
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
More information about the pve-devel
mailing list