[Pacemaker] booth is the state of "started" on pacemaker before booth write ticket info in cib.

Yuichi SEINO seino.cluster2 at gmail.com
Tue Feb 19 01:27:31 UTC 2013


Hi Xia,

I have a question about the following part. The write man explain that
"errno" is set appropriately if the write return -1. So, if "rv" is
equal to 0, strerror(errno) may not output the correct message. What
do you think about it?

+ rv = write(fd, buf, strlen(buf));
+ if (rv <= 0) {
+ log_error("write to fd(%d) error, return(%d), message(%s)",
+                      fd, rv, strerror(errno));
+ rv = -1;
+ return rv;
+ }

Sincerely,
Yuichi

2013/2/16 Xia Li <xli at suse.com>:
> Hi Yuichi
>
>>>> On 2/5/2013 at 10:46 AM, in message
> <CAMb0o5LthmeH+NQ-jExskdU+rhA2gkgy7YQt1TjWYajKQN1rHw at mail.gmail.com>, Yuichi
> SEINO <seino.cluster2 at gmail.com> wrote:
>> Hi Xia,
>>
>> I watched your patch. Probably, I think that this patch has a problem
>> with the following check. Do you need if "rv" is equal to 0? The lseek
>> man describes that the lseek return -1 if the lseek error happens.
>> Otherwise, lseek return the number of bytes. So, 0 may not be error.
>> And, this patch includes several "rv <= 0". What do you think about
>> it?
>
> Sorry, this is my miss. Thanks for your check.
> I have modified it and recreated the patch.
>
> Regards,
>  Xia Li
>
>
>



-- 
Yuichi SEINO
METROSYSTEMS CORPORATION
E-mail:seino.cluster2 at gmail.com




More information about the Pacemaker mailing list