int32_t CLIENT::getNumConcurrentJobs()
{
LOCK_GUARD(globals_mutex);
+ if (globals == NULL) {
+ /* globals can be NULL when called from dump_each_resource() in parse_config() */
+ return 0;
+ }
return globals->NumConcurrentJobs;
}
bool CLIENT::is_enabled()
{
LOCK_GUARD(globals_mutex);
- if (globals->enabled < 0) { /* not yet modified, use default from resource */
+ if (globals == NULL || globals->enabled < 0) {
+ /* not yet modified, use default from resource */
+ /* globals can be NULL when called from dump_each_resource() in parse_config() */
return Enabled;
}
return globals->enabled;
int32_t JOB::getNumConcurrentJobs()
{
LOCK_GUARD(globals_mutex);
+ if (globals == NULL) {
+ /* globals can be NULL when called from dump_each_resource() in parse_config() */
+ return 0;
+ }
return globals->NumConcurrentJobs;
}
bool JOB::is_enabled()
{
LOCK_GUARD(globals_mutex);
- if (globals->enabled < 0) { /* not yet modified, use default from resource */
+ if (globals == NULL || globals->enabled < 0) {
+ /* not yet modified, use default from resource */
+ /* globals can be NULL when called from dump_each_resource() in parse_config() */
return Enabled;
}
return globals->enabled;
int32_t STORE::getNumConcurrentReadJobs()
{
LOCK_GUARD(globals_mutex);
+ if (globals == NULL) {
+ /* globals can be NULL when called from dump_each_resource() in parse_config() */
+ return 0;
+ }
return globals->NumConcurrentReadJobs;
}
int32_t STORE::getNumConcurrentJobs()
{
LOCK_GUARD(globals_mutex);
+ if (globals == NULL) {
+ /* globals can be NULL when called from dump_each_resource() in parse_config() */
+ return 0;
+ }
return globals->NumConcurrentJobs;
}
bool STORE::is_enabled()
{
LOCK_GUARD(globals_mutex);
- if (globals->enabled < 0) { /* not yet modified, use default from resource */
+ if (globals == NULL || globals->enabled < 0) {
+ /* not yet modified, use default from resource */
+ /* globals can be NULL when called from dump_each_resource() in parse_config() */
return Enabled;
}
return globals->enabled;
bool SCHED::is_enabled()
{
LOCK_GUARD(globals_mutex);
- if (globals->enabled < 0) { /* not yet modified, use default from resource */
+ if (globals == NULL || globals->enabled < 0) {
+ /* not yet modified, use default from resource */
+ /* globals can be NULL when called from dump_each_resource() in parse_config() */
return Enabled;
}
return globals->enabled;