From 9a84980792b52750e99e51ebeaf3d91e55884cf6 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 17 Jul 2012 03:59:12 +0000 Subject: [PATCH] - lib: treat MINGW32 like CYGWIN32 (in 1 place - should do everywhere?) from Oliver svn path=/trunk/boinc/; revision=25874 --- checkin_notes | 15 +++++++++++++++ db/schema_vda.sql | 5 +---- html/ops/manage_apps.php | 6 +++--- lib/filesys.cpp | 2 +- sched/Makefile.am | 4 ++-- vda/sched_vda.cpp | 11 ++++++++++- 6 files changed, 32 insertions(+), 11 deletions(-) diff --git a/checkin_notes b/checkin_notes index 27b0f90769..a2ceba41fd 100644 --- a/checkin_notes +++ b/checkin_notes @@ -4942,3 +4942,18 @@ David 13 July 2012 html/inc/ result.inc + +David 16 July 2012 + - lib: treat MINGW32 like CYGWIN32 (in 1 place - should do everywhere?) + from Oliver + + lib/ + filesys.cpp + db/ + schema_vda.sql + sched/ + Makefile.am + html/ops/ + manage_apps.php + vda/ + sched_vda.cpp diff --git a/db/schema_vda.sql b/db/schema_vda.sql index 9d07269f96..d59a557609 100644 --- a/db/schema_vda.sql +++ b/db/schema_vda.sql @@ -11,7 +11,7 @@ create table vda_file ( primary key(id) ) engine = InnoDB; -alter table vda_file add unique(name); +alter table vda_file add unique(file_name); create table vda_chunk_host ( create_time double not null default 0, @@ -25,9 +25,6 @@ create table vda_chunk_host ( transfer_send_time double not null default 0 ) engine = InnoDB; -alter table vda_file - add index vf_name (file_name); - alter table vda_chunk_host add index vch_file (vda_file_id), add index vch_host (host_id); diff --git a/html/ops/manage_apps.php b/html/ops/manage_apps.php index 445a70a1f3..2843e1e322 100644 --- a/html/ops/manage_apps.php +++ b/html/ops/manage_apps.php @@ -116,9 +116,9 @@ function show_form($updated) { "ID", "Name and description
Click for details", "Created", - "weight
details", - "homogeneous redundancy type
details", - "homogeneous app version?
details", + "weight
details", + "homogeneous redundancy type
details", + "homogeneous app version?
details", "deprecated?" ); diff --git a/lib/filesys.cpp b/lib/filesys.cpp index a27c20793c..0b82ccd1b2 100644 --- a/lib/filesys.cpp +++ b/lib/filesys.cpp @@ -326,7 +326,7 @@ int boinc_delete_file(const char* path) { int file_size(const char* path, double& size) { int retval; -#if defined(_WIN32) && !defined(__CYGWIN32__) +#if defined(_WIN32) && !defined(__CYGWIN32__) && !defined(__MINGW32__) struct __stat64 sbuf; retval = _stat64(path, &sbuf); #else diff --git a/sched/Makefile.am b/sched/Makefile.am index bb73930db5..26a5543571 100644 --- a/sched/Makefile.am +++ b/sched/Makefile.am @@ -19,8 +19,7 @@ libsched_sources = \ ../db/db_base.cpp \ ../tools/process_result_template.cpp \ ../tools/process_input_template.cpp \ - ../tools/backend_lib.cpp \ - ../vda/sched_vda.cpp + ../tools/backend_lib.cpp lib_LTLIBRARIES = libsched.la libsched_la_SOURCES = $(libsched_sources) @@ -161,6 +160,7 @@ cgi_sources = \ sched_score.cpp \ sched_send.cpp \ sched_timezone.cpp \ + ../vda/sched_vda.cpp \ sched_version.cpp \ sched_types.cpp \ time_stats_log.cpp diff --git a/vda/sched_vda.cpp b/vda/sched_vda.cpp index be436dfea2..92a076aaaa 100644 --- a/vda/sched_vda.cpp +++ b/vda/sched_vda.cpp @@ -261,7 +261,16 @@ static int process_missing_chunks(CHUNK_LIST& chunks) { "[vda] in DB but not on client: %s\n", ch.chunk_name ); } - ch.delete_from_db(); + char buf[256]; + sprintf(buf, "host_id=%d and vda_file_id=%d and chunk_name='%s'", + ch.host_id, ch.vda_file_id, ch.chunk_name + ); + int retval = ch.delete_from_db_multi(buf); + if (retval) { + log_messages.printf(MSG_CRITICAL, + "VDA: failed to delete %s\n", buf + ); + } ch.transfer_in_progress = false; mark_for_update(ch.vda_file_id); }