mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
metadata: avoid excessive check of /etc/localtime
With larger metadata, decoding 'localtime()' for hinting time creation of every LV may cause excessive check of /etc/localtime file. Set TZ to ":/etc/localtime" so glibc reads this file just once instead of check everytime if there has anything changed.
This commit is contained in:
parent
61a6f9905e
commit
3a3aabb832
@ -3043,6 +3043,11 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv)
|
||||
int skip_hyphens;
|
||||
int refresh_done = 0;
|
||||
|
||||
/* Avoid excessive access to /etc/localtime and set TZ variable for glibc
|
||||
* so it does not need to check /etc/localtime everytime that needs that info */
|
||||
if (!getenv("TZ"))
|
||||
setenv("TZ", ":/etc/localtime", 0);
|
||||
|
||||
init_error_message_produced(0);
|
||||
|
||||
/* each command should start out with sigint flag cleared */
|
||||
|
Loading…
Reference in New Issue
Block a user