<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>You are right. Errno in prealloc may be modified by sd_err before return.<br>Why sd_err sets errno --- mostly some library call in dolog will fail. Looks<br>there is a genuine problem. My concern is the easy way will hide the error <br>or even some bug inside sd_err. But for now, looks your patch is the easiest <br>to have the issue fixed.<br><br>Thanks,<br><br>Roy<br><br><div><hr id="stopSpelling">Date: Thu, 5 Mar 2015 10:31:42 +0800<br>From: skypexu@gmail.com<br>To: bsdnet@outlook.com; mitake.hitoshi@gmail.com<br>CC: namei.unix@gmail.com; sheepdog@lists.wpkg.org<br>Subject: Re: [sheepdog] Unreliable error code handling in sheep/plainstore.c<br><br>
<br>
<div class="ecxmoz-cite-prefix">On 2015年03月04日 23:06, Roy Yang wrote:<br>
</div>
<blockquote cite="mid:COL130-W490A8491C3A224D6DB49DBD61E0@phx.gbl">
<style><!--
.ExternalClass .ecxhmmessage P {
padding:0px;
}
.ExternalClass body.ecxhmmessage {
font-size:12pt;
font-family:Calibri;
}
--></style>
<div dir="ltr">Thanks Hitoshi,<br>
<br>
It is a GNU C extension, and implicitly add strerror (errno) .<br>
<br>
Since errno is used for system errors, should we modify it or<br>
we can solve the issue by just adjusting the order of sd_err and
err_to_stderr?<br>
Just some thoughts, <br>
<br>
Roy <br>
</div>
</blockquote>
<br>
Reorder seems can not fix all the cases, reading
function utils.c:preallocate(), find that<br>
it calls sd_err(), the preallocate() is used by
plain_store.c:default_create_and_write(),<br>
and the possibly mucked errno is picked up and passed to
err_to_sderr().<br>
<br>
<br>
<br>
<br>
<br></div> </div></body>
</html>