[CRIU] Re: [PATCH v2] show: logic for optionaly files introduced
Kinsbursky Stanislav
skinsbursky at openvz.org
Wed Feb 8 07:52:59 EST 2012
ок.
08.02.2012 16:51, Pavel Emelyanov пишет:
> Лучше так:
>
> -struct cr_fdset *prep_cr_fdset_for_restore(int pid, unsigned long use_mask)
> -struct cr_fdset *cr_fdset_open(int pid, unsigned long use_mask, struct cr_fdset *cr_fdset)
> +struct cr_fdset *cr_fdset_open(int pid, unsigned long use_mask,
> + unsigned int flags, struct cr_fdset *cr_fdset)
>
> А внутри так:
>
> - ret = open(path, O_RDWR | O_CREAT | O_EXCL, CR_FD_PERM);
> + ret = open(path, flags, CR_FD_PERM);
> if (ret< 0) {
> + if (!(flags& O_CREAT))
> + /* caller should check himself */
> + fdset->fds[i] = -1;
> + continue;
> + }
> +
> pr_perror("Unable to open %s", path);
> goto err;
> }
--
Best regards,
Stanislav Kinsbursky
More information about the CRIU
mailing list