From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 5822F43040C for ; Thu, 27 Aug 2020 15:28:41 +0300 (MSK) References: From: Aleksandr Lyapunov Message-ID: Date: Thu, 27 Aug 2020 15:28:39 +0300 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Subject: Re: [Tarantool-patches] [PATCH v1] vinyl: fix check vinyl_dir existence at bootstrap List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Alexander V. Tikhonov" , Kirill Yukhin , Nikita Pettik Cc: tarantool-patches@dev.tarantool.org, Alexander Turenko Hi! Thanks for the patch! See 2 minor comments below. On 21.08.2020 07:56, Alexander V. Tikhonov wrote: > As mentioned above xdir_scan() function is not system call and can be > changed in any possible way and it can return any result value without > need to setup errno. So check outside of this function on errno could > be broken. > > To avoid of it we must avoid of errno checks outside of the function. I would say "To avoid that we must not check errno after call of the function." > diff --git a/src/box/xlog.c b/src/box/xlog.c > index 6ccd3d68d..74f761994 100644 > --- a/src/box/xlog.c > +++ b/src/box/xlog.c > @@ -511,13 +511,15 @@ xdir_open_cursor(struct xdir *dir, int64_t signature, > * @return nothing. > */ > int > -xdir_scan(struct xdir *dir) > +xdir_scan(struct xdir *dir, bool is_dir_required) The function comment also needs fixing. The new argument must have a description. The comment was already wrong though, it doesn't describe return value. Another problem is that the comment should be near function declaration (in xlog.h file) rather than definition. I would be glad if you fixed it.