mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
debug: do not play with fds with valgring
When valgrind usage is desired by user (--enable-valgrind-pool) skip playing/closing/reopenning with descriptors - it makes valgridng useless. Make sleep delay for clvmd start longer.
This commit is contained in:
parent
ee7143cd02
commit
31d8c3ee85
@ -1349,6 +1349,7 @@ struct cmd_context *create_toolcontext(unsigned is_long_lived,
|
||||
/* FIXME Make this configurable? */
|
||||
reset_lvm_errno(1);
|
||||
|
||||
#ifndef VALGRIND_POOL
|
||||
/* Set in/out stream buffering before glibc */
|
||||
if (set_buffering) {
|
||||
/* Allocate 2 buffers */
|
||||
@ -1381,6 +1382,7 @@ struct cmd_context *create_toolcontext(unsigned is_long_lived,
|
||||
} else
|
||||
/* Without buffering, must not use stdin/stdout */
|
||||
init_silent(1);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Environment variable LVM_SYSTEM_DIR overrides this below.
|
||||
@ -1649,6 +1651,7 @@ void destroy_toolcontext(struct cmd_context *cmd)
|
||||
if (cmd->libmem)
|
||||
dm_pool_destroy(cmd->libmem);
|
||||
|
||||
#ifndef VALGRIND_POOL
|
||||
if (cmd->linebuffer) {
|
||||
/* Reset stream buffering to defaults */
|
||||
if (is_valid_fd(STDIN_FILENO)) {
|
||||
@ -1669,6 +1672,7 @@ void destroy_toolcontext(struct cmd_context *cmd)
|
||||
|
||||
dm_free(cmd->linebuffer);
|
||||
}
|
||||
#endif
|
||||
|
||||
dm_free(cmd);
|
||||
|
||||
|
@ -42,7 +42,7 @@ prepare_clvmd() {
|
||||
local local_clvmd=$!
|
||||
sleep .3
|
||||
# extra sleep for slow valgrind
|
||||
test -z "$LVM_VALGRIND_CLVMD" || sleep 5
|
||||
test -z "$LVM_VALGRIND_CLVMD" || sleep 7
|
||||
# check that it is really running now
|
||||
ps $local_clvmd || die
|
||||
echo $local_clvmd > LOCAL_CLVMD
|
||||
|
@ -1292,6 +1292,7 @@ static void _close_descriptor(int fd, unsigned suppress_warnings,
|
||||
|
||||
static int _close_stray_fds(const char *command)
|
||||
{
|
||||
#ifndef VALGRIND_POOL
|
||||
struct rlimit rlim;
|
||||
int fd;
|
||||
unsigned suppress_warnings = 0;
|
||||
@ -1331,6 +1332,7 @@ static int _close_stray_fds(const char *command)
|
||||
|
||||
if (closedir(d))
|
||||
log_sys_error("closedir", _fd_dir);
|
||||
#endif
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user