Revision: 628 http://trac.macosforge.org/projects/darwinbuild/changeset/628 Author: wsiegrist@apple.com Date: 2009-11-09 16:02:36 -0800 (Mon, 09 Nov 2009) Log Message: ----------- Fix drag-n-drop fail by replacing exportFiles.c with exportIndex.c in the exportIndex target. Add more error checking to help find this sooner in the future. Modified Paths: -------------- trunk/darwinbuild.xcodeproj/project.pbxproj trunk/darwinxref/DBPlugin.c trunk/darwinxref/main.c Modified: trunk/darwinbuild.xcodeproj/project.pbxproj =================================================================== --- trunk/darwinbuild.xcodeproj/project.pbxproj 2009-11-03 17:33:37 UTC (rev 627) +++ trunk/darwinbuild.xcodeproj/project.pbxproj 2009-11-10 00:02:36 UTC (rev 628) @@ -99,6 +99,7 @@ /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ + 61E0A6BD10A8DCC700DA7EBC /* exportIndex.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86BFF10965EEA00C66E90 /* exportIndex.c */; }; 7227AB41109897D500BE33D7 /* binary_sites.tcl in CopyFiles */ = {isa = PBXBuildFile; fileRef = 72C86BF310965EEA00C66E90 /* binary_sites.tcl */; }; 7227AB42109897D500BE33D7 /* branch.tcl in CopyFiles */ = {isa = PBXBuildFile; fileRef = 72C86BF410965EEA00C66E90 /* branch.tcl */; }; 7227AB43109897D500BE33D7 /* currentBuild.tcl in CopyFiles */ = {isa = PBXBuildFile; fileRef = 72C86BF610965EEA00C66E90 /* currentBuild.tcl */; }; @@ -128,7 +129,6 @@ 72573FFA1097A659008AD4D7 /* edit.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86BFC10965EEA00C66E90 /* edit.c */; }; 72573FFB1097A67C008AD4D7 /* environment.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86BFD10965EEA00C66E90 /* environment.c */; }; 72573FFC1097A689008AD4D7 /* exportFiles.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86BFE10965EEA00C66E90 /* exportFiles.c */; }; - 72573FFF1097A6CC008AD4D7 /* exportFiles.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86BFE10965EEA00C66E90 /* exportFiles.c */; }; 725740871097AF54008AD4D7 /* exportProject.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86C0010965EEA00C66E90 /* exportProject.c */; }; 725740881097AF5C008AD4D7 /* findFile.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86C0110965EEA00C66E90 /* findFile.c */; }; 725740891097AF65008AD4D7 /* inherits.c in Sources */ = {isa = PBXBuildFile; fileRef = 72C86C0310965EEA00C66E90 /* inherits.c */; }; @@ -2003,7 +2003,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 72573FFF1097A6CC008AD4D7 /* exportFiles.c in Sources */, + 61E0A6BD10A8DCC700DA7EBC /* exportIndex.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; Modified: trunk/darwinxref/DBPlugin.c =================================================================== --- trunk/darwinxref/DBPlugin.c 2009-11-03 17:33:37 UTC (rev 627) +++ trunk/darwinxref/DBPlugin.c 2009-11-10 00:02:36 UTC (rev 628) @@ -157,11 +157,19 @@ while ((ent = fts_read(dir)) != NULL) { DBPlugin* plugin = NULL; if (strstr(ent->fts_name, ".so")) { - // fprintf(stderr, "plugin: loading %s\n", ent->fts_accpath); + //fprintf(stderr, "plugin: loading %s\n", ent->fts_accpath); void* handle = dlopen(ent->fts_accpath, RTLD_LAZY | RTLD_LOCAL); if (handle) { DBPluginInitializeFunc func = dlsym(handle, "initialize"); + if (!func) { + fprintf(stderr, "plugin: cannot find initialize for: %s\n%s\n", ent->fts_accpath, dlerror()); + return -1; + } plugin = _DBPluginInitialize(); + if (!plugin) { + fprintf(stderr, "plugin: failed to initialize %s\n", ent->fts_accpath); + return -1; + } _DBPluginSetCurrentPlugin(plugin); (*func)(kDBPluginCurrentVersion); // Call out to C plugin // XXX: check for error? @@ -181,6 +189,13 @@ } else if (plugin->type == kDBPluginNullType) { fprintf(stderr, "warning: plugin has no type (skipping): %s\n", ent->fts_name); } else { + if (CFDictionaryContainsKey(plugins, plugin->name)) { + fprintf(stderr, + "Error: already have a plugin loaded with name '%s' when " + "trying to load %s\n", + strdup_cfstr(plugin->name), ent->fts_accpath); + return -1; + } CFDictionarySetValue(plugins, plugin->name, plugin); } } Modified: trunk/darwinxref/main.c =================================================================== --- trunk/darwinxref/main.c 2009-11-03 17:33:37 UTC (rev 627) +++ trunk/darwinxref/main.c 2009-11-10 00:02:36 UTC (rev 628) @@ -90,7 +90,8 @@ DBDataStoreInitialize(dbfile); DBSetCurrentBuild(build); if (DBPluginLoadPlugins(plugins) == -1) { - fprintf(stderr, "Error: cannot allocate memory for plugins!\n"); + fprintf(stderr, "Error: cannot load plugins!\n"); + exit(2); } if (run_plugin(argc, argv) == -1) { print_usage(progname, argc, argv);
participants (1)
-
source_changes@macosforge.org