mirror of https://github.com/BOINC/boinc.git
replace tab characters with spaces
This commit is contained in:
parent
4539c96e8c
commit
6a8eab73cd
|
@ -278,7 +278,7 @@ int AM_ACCOUNT::parse(XML_PARSER& xp) {
|
|||
|
||||
if (xp.parse_str("no_rsc", buf, sizeof(buf))) {
|
||||
handle_no_rsc(buf, true);
|
||||
continue;
|
||||
continue;
|
||||
}
|
||||
if (xp.parse_bool("dont_request_more_work", btemp)) {
|
||||
dont_request_more_work.set(btemp);
|
||||
|
|
|
@ -190,7 +190,7 @@ int ACTIVE_TASK::preempt(int preempt_type, int reason) {
|
|||
result->name
|
||||
);
|
||||
}
|
||||
if (task_state() != PROCESS_EXECUTING) return 0;
|
||||
if (task_state() != PROCESS_EXECUTING) return 0;
|
||||
return suspend();
|
||||
}
|
||||
return 0;
|
||||
|
@ -634,7 +634,7 @@ int ACTIVE_TASK::write_gui(MIOFILE& fout) {
|
|||
if (fd == 0 && elapsed_time > 0) {
|
||||
double est_time = wup->rsc_fpops_est/app_version->flops;
|
||||
double x = elapsed_time/est_time;
|
||||
fd = 1 - exp(-x);
|
||||
fd = 1 - exp(-x);
|
||||
}
|
||||
fout.printf(
|
||||
"<active_task>\n"
|
||||
|
@ -1082,7 +1082,7 @@ DWORD WINAPI throttler(LPVOID) {
|
|||
#else
|
||||
void* throttler(void*) {
|
||||
#endif
|
||||
|
||||
|
||||
// Initialize diagnostics framework for this thread
|
||||
//
|
||||
diagnostics_thread_init();
|
||||
|
@ -1094,7 +1094,7 @@ void* throttler(void*) {
|
|||
boinc_sleep(10);
|
||||
continue;
|
||||
}
|
||||
double on, off, on_frac = gstate.global_prefs.cpu_usage_limit / 100;
|
||||
double on, off, on_frac = gstate.global_prefs.cpu_usage_limit / 100;
|
||||
#if 0
|
||||
// sub-second CPU throttling
|
||||
#define THROTTLE_PERIOD 1.
|
||||
|
@ -1102,13 +1102,13 @@ void* throttler(void*) {
|
|||
off = THROTTLE_PERIOD - on;
|
||||
#else
|
||||
// throttling w/ at least 1 sec between suspend/resume
|
||||
if (on_frac > .5) {
|
||||
off = 1;
|
||||
on = on_frac/(1.-on_frac);
|
||||
} else {
|
||||
on = 1;
|
||||
off = (1.-on_frac)/on_frac;
|
||||
}
|
||||
if (on_frac > .5) {
|
||||
off = 1;
|
||||
on = on_frac/(1.-on_frac);
|
||||
} else {
|
||||
on = 1;
|
||||
off = (1.-on_frac)/on_frac;
|
||||
}
|
||||
#endif
|
||||
|
||||
gstate.tasks_throttled = true;
|
||||
|
|
|
@ -794,10 +794,10 @@ bool ACTIVE_TASK_SET::check_rsc_limits_exceeded() {
|
|||
static double last_disk_check_time = 0;
|
||||
bool do_disk_check = false;
|
||||
bool did_anything = false;
|
||||
char buf[256];
|
||||
char buf[256];
|
||||
|
||||
double ram_left = gstate.available_ram();
|
||||
double max_ram = gstate.max_available_ram();
|
||||
double max_ram = gstate.max_available_ram();
|
||||
|
||||
// Some slot dirs have lots of files,
|
||||
// so only check every min(disk_interval, 300) secs
|
||||
|
@ -811,11 +811,11 @@ bool ACTIVE_TASK_SET::check_rsc_limits_exceeded() {
|
|||
atp = active_tasks[i];
|
||||
if (atp->task_state() != PROCESS_EXECUTING) continue;
|
||||
if (!atp->result->non_cpu_intensive() && (atp->elapsed_time > atp->max_elapsed_time)) {
|
||||
sprintf(buf, "exceeded elapsed time limit %.2f (%.2fG/%.2fG)",
|
||||
sprintf(buf, "exceeded elapsed time limit %.2f (%.2fG/%.2fG)",
|
||||
atp->max_elapsed_time,
|
||||
atp->result->wup->rsc_fpops_bound/1e9,
|
||||
atp->result->avp->flops/1e9
|
||||
);
|
||||
);
|
||||
msg_printf(atp->result->project, MSG_INFO,
|
||||
"Aborting task %s: %s", atp->result->name, buf
|
||||
);
|
||||
|
@ -830,10 +830,10 @@ bool ACTIVE_TASK_SET::check_rsc_limits_exceeded() {
|
|||
// and I don't think we can expect projects to provide
|
||||
// accurate bounds.
|
||||
//
|
||||
if (atp->procinfo.working_set_size_smoothed > atp->max_mem_usage) {
|
||||
sprintf(buf, "working set size > workunit.rsc_memory_bound: %.2fMB > %.2fMB",
|
||||
atp->procinfo.working_set_size_smoothed/MEGA, atp->max_mem_usage/MEGA
|
||||
);
|
||||
if (atp->procinfo.working_set_size_smoothed > atp->max_mem_usage) {
|
||||
sprintf(buf, "working set size > workunit.rsc_memory_bound: %.2fMB > %.2fMB",
|
||||
atp->procinfo.working_set_size_smoothed/MEGA, atp->max_mem_usage/MEGA
|
||||
);
|
||||
msg_printf(atp->result->project, MSG_INFO,
|
||||
"Aborting task %s: %s",
|
||||
atp->result->name, buf
|
||||
|
@ -843,10 +843,10 @@ bool ACTIVE_TASK_SET::check_rsc_limits_exceeded() {
|
|||
continue;
|
||||
}
|
||||
#endif
|
||||
if (atp->procinfo.working_set_size_smoothed > max_ram) {
|
||||
sprintf(buf, "working set size > client RAM limit: %.2fMB > %.2fMB",
|
||||
atp->procinfo.working_set_size_smoothed/MEGA, max_ram/MEGA
|
||||
);
|
||||
if (atp->procinfo.working_set_size_smoothed > max_ram) {
|
||||
sprintf(buf, "working set size > client RAM limit: %.2fMB > %.2fMB",
|
||||
atp->procinfo.working_set_size_smoothed/MEGA, max_ram/MEGA
|
||||
);
|
||||
msg_printf(atp->result->project, MSG_INFO,
|
||||
"Aborting task %s: %s",
|
||||
atp->result->name, buf
|
||||
|
@ -856,10 +856,10 @@ bool ACTIVE_TASK_SET::check_rsc_limits_exceeded() {
|
|||
continue;
|
||||
}
|
||||
if (do_disk_check || atp->peak_disk_usage == 0) {
|
||||
if (atp->check_max_disk_exceeded()) {
|
||||
did_anything = true;
|
||||
continue;
|
||||
}
|
||||
if (atp->check_max_disk_exceeded()) {
|
||||
did_anything = true;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// don't count RAM usage of non-CPU-intensive jobs
|
||||
|
@ -1441,17 +1441,17 @@ void ACTIVE_TASK_SET::get_msgs() {
|
|||
}
|
||||
last_time = gstate.now;
|
||||
|
||||
double et_diff, et_diff_throttle;
|
||||
switch (gstate.suspend_reason) {
|
||||
case 0:
|
||||
case SUSPEND_REASON_CPU_THROTTLE:
|
||||
et_diff = delta_t;
|
||||
et_diff_throttle = delta_t * gstate.global_prefs.cpu_usage_limit/100;
|
||||
break;
|
||||
default:
|
||||
et_diff = et_diff_throttle = 0;
|
||||
break;
|
||||
}
|
||||
double et_diff, et_diff_throttle;
|
||||
switch (gstate.suspend_reason) {
|
||||
case 0:
|
||||
case SUSPEND_REASON_CPU_THROTTLE:
|
||||
et_diff = delta_t;
|
||||
et_diff_throttle = delta_t * gstate.global_prefs.cpu_usage_limit/100;
|
||||
break;
|
||||
default:
|
||||
et_diff = et_diff_throttle = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
for (i=0; i<active_tasks.size(); i++) {
|
||||
atp = active_tasks[i];
|
||||
|
|
|
@ -292,9 +292,9 @@ int ACTIVE_TASK::write_app_init_file(APP_INIT_DATA& aid) {
|
|||
char init_data_path[MAXPATHLEN];
|
||||
|
||||
#if 0
|
||||
msg_printf(wup->project, MSG_INFO,
|
||||
"writing app_init.xml for %s; slot %d rt %s gpu_device_num %d", result->name, slot, aid.gpu_type, aid.gpu_device_num
|
||||
);
|
||||
msg_printf(wup->project, MSG_INFO,
|
||||
"writing app_init.xml for %s; slot %d rt %s gpu_device_num %d", result->name, slot, aid.gpu_type, aid.gpu_device_num
|
||||
);
|
||||
#endif
|
||||
|
||||
sprintf(init_data_path, "%s/%s", slot_dir, INIT_DATA_FILE);
|
||||
|
@ -1152,11 +1152,11 @@ int ACTIVE_TASK::resume_or_start(bool first_time) {
|
|||
return 0;
|
||||
}
|
||||
if (log_flags.task && first_time) {
|
||||
msg_printf(result->project, MSG_INFO,
|
||||
"Starting task %s", result->name
|
||||
);
|
||||
}
|
||||
if (log_flags.cpu_sched) {
|
||||
msg_printf(result->project, MSG_INFO,
|
||||
"Starting task %s", result->name
|
||||
);
|
||||
}
|
||||
if (log_flags.cpu_sched) {
|
||||
char buf[256];
|
||||
strcpy(buf, "");
|
||||
if (strlen(app_version->plan_class)) {
|
||||
|
|
|
@ -113,7 +113,7 @@ CLIENT_STATE::CLIENT_STATE()
|
|||
#else
|
||||
core_client_version.prerelease = false;
|
||||
#endif
|
||||
strcpy(language, "");
|
||||
strcpy(language, "");
|
||||
exit_after_app_start_secs = 0;
|
||||
app_started = 0;
|
||||
exit_before_upload = false;
|
||||
|
|
|
@ -109,7 +109,7 @@ struct CLIENT_STATE {
|
|||
DEVICE_STATUS device_status;
|
||||
double device_status_time;
|
||||
|
||||
char language[16]; // ISO language code reported by GUI
|
||||
char language[16]; // ISO language code reported by GUI
|
||||
VERSION_INFO core_client_version;
|
||||
string statefile_platform_name;
|
||||
int file_xfer_giveup_period;
|
||||
|
|
|
@ -759,7 +759,7 @@ int APP_VERSION::parse(XML_PARSER& xp) {
|
|||
if (xp.match_tag("/app_version")) {
|
||||
rt = gpu_usage.rsc_type;
|
||||
if (rt) {
|
||||
dont_throttle = true; // don't throttle GPU apps
|
||||
dont_throttle = true; // don't throttle GPU apps
|
||||
if (strstr(plan_class, "opencl")) {
|
||||
if (!coprocs.coprocs[rt].have_opencl) {
|
||||
msg_printf(0, MSG_INFO,
|
||||
|
|
|
@ -135,13 +135,13 @@ struct PROC_RESOURCES {
|
|||
bool can_schedule(RESULT* rp, ACTIVE_TASK* atp) {
|
||||
if (max_concurrent_exceeded(rp)) return false;
|
||||
if (atp) {
|
||||
// don't schedule if something's pending
|
||||
//
|
||||
switch (atp->task_state()) {
|
||||
case PROCESS_ABORT_PENDING:
|
||||
case PROCESS_QUIT_PENDING:
|
||||
return false;
|
||||
}
|
||||
// don't schedule if something's pending
|
||||
//
|
||||
switch (atp->task_state()) {
|
||||
case PROCESS_ABORT_PENDING:
|
||||
case PROCESS_QUIT_PENDING:
|
||||
return false;
|
||||
}
|
||||
if (gstate.retry_shmem_time > gstate.now) {
|
||||
if (atp->app_client_shm.shm == NULL) {
|
||||
if (log_flags.cpu_sched_debug) {
|
||||
|
@ -435,9 +435,9 @@ RESULT* first_coproc_result(int rsc_type) {
|
|||
RESULT* rp = gstate.results[i];
|
||||
if (rp->resource_type() != rsc_type) continue;
|
||||
if (!rp->runnable()) {
|
||||
//msg_printf(rp->project, MSG_INFO, "not runnable: %s", rp->name);
|
||||
continue;
|
||||
}
|
||||
//msg_printf(rp->project, MSG_INFO, "not runnable: %s", rp->name);
|
||||
continue;
|
||||
}
|
||||
if (rp->non_cpu_intensive()) continue;
|
||||
if (rp->already_selected) continue;
|
||||
prio = rp->project->sched_priority;
|
||||
|
@ -1119,10 +1119,10 @@ static inline void increment_pending_usage(
|
|||
int j = rp->coproc_indices[i];
|
||||
cp->pending_usage[j] += x;
|
||||
if (log_flags.coproc_debug) {
|
||||
msg_printf(rp->project, MSG_INFO,
|
||||
"[coproc] %s instance %d; %f pending for %s", cp->type, i, x, rp->name
|
||||
);
|
||||
if (cp->pending_usage[j] > 1) {
|
||||
msg_printf(rp->project, MSG_INFO,
|
||||
"[coproc] %s instance %d; %f pending for %s", cp->type, i, x, rp->name
|
||||
);
|
||||
if (cp->pending_usage[j] > 1) {
|
||||
msg_printf(rp->project, MSG_INFO,
|
||||
"[coproc] huh? %s %d %s pending usage > 1",
|
||||
cp->type, i, rp->name
|
||||
|
@ -1406,8 +1406,8 @@ static inline void assign_coprocs(vector<RESULT*>& jobs) {
|
|||
ACTIVE_TASK* atp = gstate.lookup_active_task_by_result(rp);
|
||||
if (!atp) continue;
|
||||
if (is_gpu_task_running(atp)) {
|
||||
increment_pending_usage(rp, usage, cp);
|
||||
}
|
||||
increment_pending_usage(rp, usage, cp);
|
||||
}
|
||||
}
|
||||
|
||||
vector<RESULT*>::iterator job_iter;
|
||||
|
@ -1783,14 +1783,14 @@ bool CLIENT_STATE::enforce_run_list(vector<RESULT*>& run_list) {
|
|||
atp->preempt(preempt_type);
|
||||
break;
|
||||
case PROCESS_SUSPENDED:
|
||||
// remove from memory GPU jobs that were suspended by CPU throttling
|
||||
// and are now unscheduled.
|
||||
//
|
||||
if (atp->result->uses_coprocs()) {
|
||||
atp->preempt(REMOVE_ALWAYS);
|
||||
request_schedule_cpus("removed suspended GPU task");
|
||||
break;
|
||||
}
|
||||
// remove from memory GPU jobs that were suspended by CPU throttling
|
||||
// and are now unscheduled.
|
||||
//
|
||||
if (atp->result->uses_coprocs()) {
|
||||
atp->preempt(REMOVE_ALWAYS);
|
||||
request_schedule_cpus("removed suspended GPU task");
|
||||
break;
|
||||
}
|
||||
|
||||
// Handle the case where user changes prefs from
|
||||
// "leave in memory" to "remove from memory";
|
||||
|
|
|
@ -100,7 +100,7 @@ int PROJECT::parse_account(FILE* in) {
|
|||
char buf2[256];
|
||||
int retval;
|
||||
bool in_project_prefs = false, btemp;
|
||||
double dtemp;
|
||||
double dtemp;
|
||||
|
||||
for (int i=0; i<coprocs.n_rsc; i++) {
|
||||
no_rsc_pref[i] = false;
|
||||
|
@ -133,11 +133,11 @@ int PROJECT::parse_account(FILE* in) {
|
|||
continue;
|
||||
} else if (xp.parse_str("authenticator", authenticator, sizeof(authenticator))) continue;
|
||||
else if (xp.parse_double("resource_share", dtemp)) {
|
||||
if (ams_resource_share < 0) {
|
||||
resource_share = dtemp;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (ams_resource_share < 0) {
|
||||
resource_share = dtemp;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
else if (xp.parse_bool("no_cpu", btemp)) {
|
||||
if (btemp) handle_no_rsc_pref(this, "CPU");
|
||||
continue;
|
||||
|
@ -206,7 +206,7 @@ int PROJECT::parse_account_file_venue() {
|
|||
FILE* in = boinc_fopen(path, "r");
|
||||
if (!in) return ERR_FOPEN;
|
||||
|
||||
//msg_printf(this, MSG_INFO, "parsing project prefs, looking for venue %s", host_venue);
|
||||
//msg_printf(this, MSG_INFO, "parsing project prefs, looking for venue %s", host_venue);
|
||||
MIOFILE mf;
|
||||
XML_PARSER xp(&mf);
|
||||
mf.init_file(in);
|
||||
|
@ -217,7 +217,7 @@ int PROJECT::parse_account_file_venue() {
|
|||
} else if (xp.match_tag("venue")) {
|
||||
parse_attr(attr_buf, "name", venue, sizeof(venue));
|
||||
if (!strcmp(venue, host_venue)) {
|
||||
//msg_printf(this, MSG_INFO, "found venue %s", host_venue);
|
||||
//msg_printf(this, MSG_INFO, "found venue %s", host_venue);
|
||||
using_venue_specific_prefs = true;
|
||||
in_right_venue = true;
|
||||
|
||||
|
@ -297,10 +297,10 @@ int PROJECT::parse_account_file() {
|
|||
retval = parse_account(f);
|
||||
fclose(f);
|
||||
if (retval) return retval;
|
||||
if (strlen(host_venue)) {
|
||||
if (strlen(host_venue)) {
|
||||
return parse_account_file_venue();
|
||||
}
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CLIENT_STATE::parse_account_files_venue() {
|
||||
|
|
|
@ -228,7 +228,7 @@ int CLIENT_STATE::check_suspend_processing() {
|
|||
return SUSPEND_REASON_BATTERIES;
|
||||
}
|
||||
#ifndef ANDROID
|
||||
// perform this check after SUSPEND_REASON_BATTERY_CHARGING on Android
|
||||
// perform this check after SUSPEND_REASON_BATTERY_CHARGING on Android
|
||||
if (!global_prefs.run_if_user_active && user_active) {
|
||||
return SUSPEND_REASON_USER_ACTIVE;
|
||||
}
|
||||
|
@ -285,7 +285,7 @@ int CLIENT_STATE::check_suspend_processing() {
|
|||
// 2. "charge battery until 90%"
|
||||
// 3. "turn screen off to continue computing"
|
||||
if (!global_prefs.run_if_user_active && user_active) {
|
||||
return SUSPEND_REASON_USER_ACTIVE;
|
||||
return SUSPEND_REASON_USER_ACTIVE;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -760,7 +760,7 @@ int CLIENT_STATE::handle_scheduler_reply(
|
|||
}
|
||||
|
||||
// show notice if we can't possibly get work from this project.
|
||||
// This must come after parsing project prefs
|
||||
// This must come after parsing project prefs
|
||||
//
|
||||
project->show_no_work_notice();
|
||||
|
||||
|
|
|
@ -474,9 +474,9 @@ int CLIENT_STATE::parse_state_file_aux(const char* fname) {
|
|||
if (xp.parse_int("core_client_release", old_release)) {
|
||||
continue;
|
||||
}
|
||||
if (xp.parse_str("language", language, sizeof(language))) {
|
||||
continue;
|
||||
}
|
||||
if (xp.parse_str("language", language, sizeof(language))) {
|
||||
continue;
|
||||
}
|
||||
if (xp.match_tag("proxy_info")) {
|
||||
retval = gui_proxy_info.parse(xp);
|
||||
if (retval) {
|
||||
|
@ -764,9 +764,9 @@ int CLIENT_STATE::write_state(MIOFILE& f) {
|
|||
new_version_check_time,
|
||||
all_projects_list_check_time
|
||||
);
|
||||
if (strlen(language)) {
|
||||
f.printf("<language>%s</language>\n", language);
|
||||
}
|
||||
if (strlen(language)) {
|
||||
f.printf("<language>%s</language>\n", language);
|
||||
}
|
||||
if (newer_version.size()) {
|
||||
f.printf("<newer_version>%s</newer_version>\n", newer_version.c_str());
|
||||
}
|
||||
|
|
|
@ -213,14 +213,14 @@ void COPROC_NVIDIA::get(
|
|||
NvAPI_SYS_GetDriverAndBranchVersion(&Version, ss);
|
||||
|
||||
#if 0
|
||||
// NvAPI now provides an API for getting #cores :-)
|
||||
// But not FLOPs per clock cycle :-(
|
||||
// Anyway, don't use this for now because server code estimates FLOPS
|
||||
// based on compute capability, so we may as well do the same
|
||||
//
|
||||
// NvAPI now provides an API for getting #cores :-)
|
||||
// But not FLOPs per clock cycle :-(
|
||||
// Anyway, don't use this for now because server code estimates FLOPS
|
||||
// based on compute capability, so we may as well do the same
|
||||
//
|
||||
NvPhysicalGpuHandle GPUHandle[NVAPI_MAX_PHYSICAL_GPUS];
|
||||
NvU32 GpuCount, nc;
|
||||
NvAPI_EnumPhysicalGPUs(GPUHandle, &GpuCount);
|
||||
NvAPI_EnumPhysicalGPUs(GPUHandle, &GpuCount);
|
||||
for (unsigned int i=0; i<GpuCount; i++) {
|
||||
NvAPI_GPU_GetGpuCoreCount(GPUHandle[i], &nc);
|
||||
}
|
||||
|
|
|
@ -1159,14 +1159,14 @@ static bool complete_post_request(char* buf) {
|
|||
}
|
||||
|
||||
static void handle_set_language(GUI_RPC_CONN& grc) {
|
||||
while (!grc.xp.get_tag()) {
|
||||
while (!grc.xp.get_tag()) {
|
||||
if (grc.xp.parse_str("language", gstate.language, sizeof(gstate.language))) {
|
||||
gstate.set_client_state_dirty("set_language");
|
||||
grc.mfout.printf("<success/>\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
grc.mfout.printf("<error>no language found</error>\n");
|
||||
gstate.set_client_state_dirty("set_language");
|
||||
grc.mfout.printf("<success/>\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
grc.mfout.printf("<error>no language found</error>\n");
|
||||
}
|
||||
|
||||
static void handle_report_device_status(GUI_RPC_CONN& grc) {
|
||||
|
|
|
@ -590,10 +590,10 @@ int HTTP_OP::libcurl_exec(
|
|||
//
|
||||
pcurlList = curl_slist_append(pcurlList, g_content_type);
|
||||
|
||||
if (strlen(gstate.language)) {
|
||||
sprintf(buf, "Accept-Language: %s", gstate.language);
|
||||
pcurlList = curl_slist_append(pcurlList, buf);
|
||||
}
|
||||
if (strlen(gstate.language)) {
|
||||
sprintf(buf, "Accept-Language: %s", gstate.language);
|
||||
pcurlList = curl_slist_append(pcurlList, buf);
|
||||
}
|
||||
|
||||
// set the file offset for resumable downloads
|
||||
//
|
||||
|
|
|
@ -149,27 +149,27 @@ GetMACAddress(io_iterator_t intfIterator, char* buffer)
|
|||
int get_mac_address(char* address) {
|
||||
#if defined(_WIN32)
|
||||
IP_ADAPTER_INFO AdapterInfo[16]; // Allocate information for up to 16 NICs
|
||||
DWORD dwBufLen = sizeof(AdapterInfo); // Save memory size of buffer
|
||||
// Call GetAdapterInfo
|
||||
DWORD dwStatus = GetAdaptersInfo(AdapterInfo, &dwBufLen);
|
||||
DWORD dwBufLen = sizeof(AdapterInfo); // Save memory size of buffer
|
||||
// Call GetAdapterInfo
|
||||
DWORD dwStatus = GetAdaptersInfo(AdapterInfo, &dwBufLen);
|
||||
|
||||
if(dwStatus != ERROR_SUCCESS) {
|
||||
return -1;
|
||||
}
|
||||
strcpy(address, "");
|
||||
PIP_ADAPTER_INFO pAdapterInfo = AdapterInfo; // Contains pointer to current adapter info
|
||||
while (pAdapterInfo) {
|
||||
sprintf(address, "%02x:%02x:%02x:%02x:%02x:%02x",
|
||||
pAdapterInfo->Address[0], pAdapterInfo->Address[1], pAdapterInfo->Address[2],
|
||||
pAdapterInfo->Address[3], pAdapterInfo->Address[4], pAdapterInfo->Address[5]
|
||||
);
|
||||
if (pAdapterInfo->Type == MIB_IF_TYPE_ETHERNET) break;
|
||||
pAdapterInfo = pAdapterInfo->Next;
|
||||
}
|
||||
return 0;
|
||||
if(dwStatus != ERROR_SUCCESS) {
|
||||
return -1;
|
||||
}
|
||||
strcpy(address, "");
|
||||
PIP_ADAPTER_INFO pAdapterInfo = AdapterInfo; // Contains pointer to current adapter info
|
||||
while (pAdapterInfo) {
|
||||
sprintf(address, "%02x:%02x:%02x:%02x:%02x:%02x",
|
||||
pAdapterInfo->Address[0], pAdapterInfo->Address[1], pAdapterInfo->Address[2],
|
||||
pAdapterInfo->Address[3], pAdapterInfo->Address[4], pAdapterInfo->Address[5]
|
||||
);
|
||||
if (pAdapterInfo->Type == MIB_IF_TYPE_ETHERNET) break;
|
||||
pAdapterInfo = pAdapterInfo->Next;
|
||||
}
|
||||
return 0;
|
||||
|
||||
#elif defined(__APPLE__)
|
||||
kern_return_t kernResult = KERN_SUCCESS; // on PowerPC this is an int (4 bytes)
|
||||
kern_return_t kernResult = KERN_SUCCESS; // on PowerPC this is an int (4 bytes)
|
||||
/*
|
||||
* error number layout as follows (see mach/error.h and IOKitLib/IOReturn.h):
|
||||
*
|
||||
|
@ -177,21 +177,21 @@ int get_mac_address(char* address) {
|
|||
* | system(6) | subsystem(12) | code(14) |
|
||||
*/
|
||||
io_iterator_t intfIterator;
|
||||
int retval = 0;
|
||||
int retval = 0;
|
||||
|
||||
kernResult = FindEthernetInterfaces(&intfIterator);
|
||||
if (KERN_SUCCESS != kernResult) {
|
||||
fprintf(stderr, "FindEthernetInterfaces returned 0x%08x\n", kernResult);
|
||||
retval = -1;
|
||||
} else {
|
||||
fprintf(stderr, "FindEthernetInterfaces returned 0x%08x\n", kernResult);
|
||||
retval = -1;
|
||||
} else {
|
||||
kernResult = GetMACAddress(intfIterator, address);
|
||||
if (KERN_SUCCESS != kernResult) {
|
||||
fprintf(stderr, "GetMACAddress returned 0x%08x\n", kernResult);
|
||||
retval = -1;
|
||||
}
|
||||
fprintf(stderr, "GetMACAddress returned 0x%08x\n", kernResult);
|
||||
retval = -1;
|
||||
}
|
||||
}
|
||||
IOObjectRelease(intfIterator);
|
||||
return retval;
|
||||
return retval;
|
||||
|
||||
#elif defined(SIOCGIFCONF) || defined(SIOCGLIFCONF)
|
||||
char buf[1024];
|
||||
|
@ -235,7 +235,7 @@ int get_mac_address(char* address) {
|
|||
ifr = ifc.lifc_req;
|
||||
nInterfaces = ifc.lifc_len / sizeof(struct lifreq);
|
||||
#else
|
||||
ifr = ifc.ifc_req;
|
||||
ifr = ifc.ifc_req;
|
||||
nInterfaces = ifc.ifc_len / sizeof(struct ifreq);
|
||||
#endif
|
||||
strcpy(address, "");
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
// Get the MAC address of a network interface.
|
||||
// If there's more than one, prefer eth0
|
||||
// Note: the code on Mac OS X requires the following linkage flags
|
||||
// -framework CoreFoundation -lIOKit
|
||||
// -framework CoreFoundation -lIOKit
|
||||
//
|
||||
int get_mac_address(char* address);
|
||||
|
||||
|
|
|
@ -917,7 +917,7 @@ void PROJECT::show_no_work_notice() {
|
|||
bool banned_by_user = no_rsc_pref[i] || no_rsc_config[i] || no_rsc_ams[i];
|
||||
if (!banned_by_user) {
|
||||
// work for this resource is possible; return
|
||||
notices.remove_notices(this, REMOVE_NO_WORK_MSG);
|
||||
notices.remove_notices(this, REMOVE_NO_WORK_MSG);
|
||||
return;
|
||||
}
|
||||
if (no_rsc_pref[i]) show_prefs = true;
|
||||
|
@ -928,14 +928,14 @@ void PROJECT::show_no_work_notice() {
|
|||
if (!user_action_possible) {
|
||||
// no work is possible because project has no apps for any resource
|
||||
//
|
||||
notices.remove_notices(this, REMOVE_NO_WORK_MSG);
|
||||
notices.remove_notices(this, REMOVE_NO_WORK_MSG);
|
||||
return;
|
||||
}
|
||||
|
||||
bool first = true;
|
||||
string x;
|
||||
x = NO_WORK_MSG;
|
||||
x += " ";
|
||||
x += " ";
|
||||
x += _("To fix this, you can ");
|
||||
if (show_prefs) {
|
||||
first = false;
|
||||
|
|
|
@ -327,12 +327,12 @@ struct PROJECT : PROJ_AM {
|
|||
no_rsc_ams[i] = false;
|
||||
}
|
||||
|
||||
ams_resource_share = -1;
|
||||
ams_resource_share = -1;
|
||||
|
||||
// parse the account file to get right resource share
|
||||
// in case AMS had set it
|
||||
//
|
||||
parse_account_file();
|
||||
// parse the account file to get right resource share
|
||||
// in case AMS had set it
|
||||
//
|
||||
parse_account_file();
|
||||
}
|
||||
|
||||
#ifdef SIM
|
||||
|
|
|
@ -528,7 +528,7 @@ void WORK_FETCH::piggyback_work_request(PROJECT* p) {
|
|||
for (unsigned int j=0; j<gstate.projects.size(); j++) {
|
||||
p2 = gstate.projects[j];
|
||||
if (p2 == p) break;
|
||||
if (p2->sched_priority == p->sched_priority) continue;
|
||||
if (p2->sched_priority == p->sched_priority) continue;
|
||||
if (p2->pwf.cant_fetch_work_reason) {
|
||||
DEBUG(msg_printf(p, MSG_INFO, "piggyback: %s can't fetch work", p2->project_name);)
|
||||
continue;
|
||||
|
|
Loading…
Reference in New Issue