On 04/17/2013 02:28 PM, Hitoshi Mitake wrote:
> BTW, def_fmode is currently declared in sheep/store.c. Is it allowed
> to move the variable to util.c?
Sure, go ahead, maybe better prefixed as "sd_def_fmode".
Thanks,
Yuan
--
sheepdog mailing list
sheepdog@lists.wpkg.org
http://lists.wpkg.org/mail
At Wed, 17 Apr 2013 14:10:01 +0800,
Liu Yuan wrote:
>
> On 04/17/2013 01:45 PM, Hitoshi Mitake wrote:
> > + fd = open(tmp_path, O_WRONLY | O_CREAT | O_SYNC,
> > + S_IWUSR | S_IRUSR | S_IWGRP | S_IRGRP);
>
> use def_fmode.
BTW, def_fmode is currently declared in sheep/store.c. Is it a
At Wed, 17 Apr 2013 14:08:24 +0800,
Liu Yuan wrote:
>
> On 04/17/2013 02:00 PM, Hitoshi Mitake wrote:
> > At Wed, 17 Apr 2013 13:55:09 +0800,
> > Liu Yuan wrote:
> >>
> >> On 04/17/2013 01:45 PM, Hitoshi Mitake wrote:
> >>> + if (!access(tmp_path, F_OK))
> >>> + panic("temporal file: %s ex
At Wed, 17 Apr 2013 14:10:01 +0800,
Liu Yuan wrote:
>
> On 04/17/2013 01:45 PM, Hitoshi Mitake wrote:
> > + fd = open(tmp_path, O_WRONLY | O_CREAT | O_SYNC,
> > + S_IWUSR | S_IRUSR | S_IWGRP | S_IRGRP);
>
> use def_fmode.
Thanks for your pointing. I'll fix it in v2.
Hitoshi
--
sheep
On 04/17/2013 01:45 PM, Hitoshi Mitake wrote:
> + fd = open(tmp_path, O_WRONLY | O_CREAT | O_SYNC,
> + S_IWUSR | S_IRUSR | S_IWGRP | S_IRGRP);
use def_fmode.
Thanks,
Yuan
--
sheepdog mailing list
sheepdog@lists.wpkg.org
http://lists.wpkg.org/mailman/listinfo/sheepdog
On 04/17/2013 02:00 PM, Hitoshi Mitake wrote:
> At Wed, 17 Apr 2013 13:55:09 +0800,
> Liu Yuan wrote:
>>
>> On 04/17/2013 01:45 PM, Hitoshi Mitake wrote:
>>> + if (!access(tmp_path, F_OK))
>>> + panic("temporal file: %s exists, this implies invalid usage of"
>>> + " at
At Wed, 17 Apr 2013 13:55:09 +0800,
Liu Yuan wrote:
>
> On 04/17/2013 01:45 PM, Hitoshi Mitake wrote:
> > + if (!access(tmp_path, F_OK))
> > + panic("temporal file: %s exists, this implies invalid usage of"
> > + " atomic_create_and_write() of sheepdog", tmp_path);
>
On 04/17/2013 01:45 PM, Hitoshi Mitake wrote:
> + if (!access(tmp_path, F_OK))
> + panic("temporal file: %s exists, this implies invalid usage of"
> + " atomic_create_and_write() of sheepdog", tmp_path);
panic() is too stringent and not necessary. open(2) will r
This patch adds a new API atomic_create_and_write(). As the name
implies, the API creates and writes data to a file.
atomic_create_and_write() creates a file path.tmp (path is a
parameter) internally. During the initialization process of sheep,
every user of this API should detect and clean tempor