fix(worker): default logdir to /tmp when -l not given
logdir was NULL without -l flag, causing stat(NULL)/mkdir(NULL) → EFAULT. Set default to /tmp after argument parsing, before directory creation.
This commit is contained in:
parent
b3124767bb
commit
e959ee61fc
1 changed files with 4 additions and 0 deletions
|
|
@ -376,6 +376,10 @@ int main(int argc, char* argv[])
|
|||
* without requiring root privileges. */
|
||||
check_user();
|
||||
|
||||
if (logdir == NULL) {
|
||||
logdir = strdup("/tmp");
|
||||
}
|
||||
|
||||
/* P2.5-5: populate and validate xce_cluster_config_t when --peers given */
|
||||
if (peers_str) {
|
||||
if (xce_parse_peers(peers_str, &cluster_cfg) != 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue