Tarantool development patches archive
 help / color / mirror / Atom feed
From: Kirill Yukhin <kyukhin@tarantool.org>
To: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH 2/2] Allow to set directory for copying DSO before load
Date: Mon, 1 Jun 2020 13:53:35 +0300	[thread overview]
Message-ID: <20200601105335.hnm4qega7vijrgys@tarantool.org> (raw)
In-Reply-To: <20200529105907.GK215590@grain>

Hello,

Thanks a lot! Both objections fixed.

--
Regards, Kirill Yukhin

On 29 май 13:59, Cyrill Gorcunov wrote:
> On Wed, May 20, 2020 at 12:51:18PM +0300, Kirill Yukhin wrote:
> ...
> > --- a/src/box/call.c
> > +++ b/src/box/call.c
> > @@ -129,10 +129,14 @@ box_module_reload(const char *name)
> >  		return -1;
> >  	}
> >  	struct module *module = NULL;
> > -	if (module_reload(name, name + strlen(name), &module) == 0 &&
> > -	    module != NULL)
> > -		return 0;
> > -	diag_set(ClientError, ER_NO_SUCH_MODULE, name);
> > +	if (module_reload(name, name + strlen(name), &module) == 0) {
> > +		if (module != NULL)
> > +			return 0;
> > +		else {
> > +			diag_set(ClientError, ER_NO_SUCH_MODULE, name);
> > +			return -1;
> 
> Redundant return -1? Since we're gonna return -1 a few lines lower anyway.
> I might be missing something obvious but I don't get why have you moved
> module != NULL into a separate block. If you prefer this form I don't
> mind though.
> 
> > +		}
> > +	}
> >  	return -1;
> >  }
> >  
> > diff --git a/src/box/func.c b/src/box/func.c
> > index a42a269..0405eb9 100644
> > --- a/src/box/func.c
> > +++ b/src/box/func.c
> > @@ -261,14 +261,29 @@ module_load(const char *package, const char *package_end)
> >  	module->package[package_len] = 0;
> >  	rlist_create(&module->funcs);
> >  	module->calls = 0;
> > -	char dir_name[] = "/tmp/tntXXXXXX";
> > +
> > +	const char *tmpdir = getenv("TMPDIR");
> > +	if (tmpdir == NULL)
> > +		tmpdir = "/tmp";
> > +	char dir_name[PATH_MAX + 1];
> 
> No need for PATH_MAX + 1, PATH_MAX should be enough. Other than this -- Ack.

  reply	other threads:[~2020-06-01 10:53 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-20  9:51 [Tarantool-patches] [PATCH 0/2] Fix C module reloading Kirill Yukhin
2020-05-20  9:51 ` [Tarantool-patches] [PATCH 1/2] Copy DSO module before load instead of symlink-ing Kirill Yukhin
2020-05-23 18:30   ` Konstantin Osipov
2020-05-25 13:13     ` Kirill Yukhin
2020-05-25 14:34       ` Konstantin Osipov
2020-05-25 15:18         ` Cyrill Gorcunov
2020-05-25 15:26           ` Cyrill Gorcunov
2020-05-25 16:45           ` Konstantin Osipov
2020-05-25 18:38             ` Cyrill Gorcunov
2020-05-26 11:11         ` Kirill Yukhin
2020-05-26 15:16       ` Cyrill Gorcunov
2020-05-27  9:17         ` Kirill Yukhin
2020-05-27 10:49           ` Cyrill Gorcunov
2020-05-20  9:51 ` [Tarantool-patches] [PATCH 2/2] Allow to set directory for copying DSO before load Kirill Yukhin
2020-05-29 10:59   ` Cyrill Gorcunov
2020-06-01 10:53     ` Kirill Yukhin [this message]
2020-05-20 20:41 ` [Tarantool-patches] [PATCH 0/2] Fix C module reloading Nikita Pettik
2020-05-21  8:41   ` Kirill Yukhin
2020-06-01 10:52 ` Kirill Yukhin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200601105335.hnm4qega7vijrgys@tarantool.org \
    --to=kyukhin@tarantool.org \
    --cc=gorcunov@gmail.com \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 2/2] Allow to set directory for copying DSO before load' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox