Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F24F210B95 for ; Tue, 11 Feb 2014 08:08:17 +0000 (UTC) Received: (qmail 89406 invoked by uid 500); 11 Feb 2014 08:07:41 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 89206 invoked by uid 500); 11 Feb 2014 08:07:36 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 87242 invoked by uid 99); 11 Feb 2014 08:07:06 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Feb 2014 08:07:06 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id BC7059236AC; Tue, 11 Feb 2014 08:07:03 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: davisp@apache.org To: commits@couchdb.apache.org Date: Tue, 11 Feb 2014 08:07:25 -0000 Message-Id: <7a060bc0b8b6489b96b7c721f701780f@git.apache.org> In-Reply-To: <77cc6c1304714a0aa0ae4034248f6780@git.apache.org> References: <77cc6c1304714a0aa0ae4034248f6780@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [23/41] couch commit: updated refs/heads/import-rcouch to f07bbfc remove Makefile.am from apps/ and fix couchspawnkillable Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch/commit/4c23323e Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/4c23323e Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/4c23323e Branch: refs/heads/import-rcouch Commit: 4c23323ee1fb7456368c02785618cca8b0a61f7c Parents: 70ce400 Author: benoitc Authored: Tue Jan 7 19:15:43 2014 +0100 Committer: Paul J. Davis Committed: Tue Feb 11 02:05:20 2014 -0600 ---------------------------------------------------------------------- c_src/spawnkillable/couchspawnkillable_win.c | 145 ++++++++++++++++ priv/Makefile.am | 151 ----------------- priv/couchspawnkillable.sh | 20 +++ priv/spawnkillable/couchspawnkillable.sh | 20 --- priv/spawnkillable/couchspawnkillable_win.c | 145 ---------------- rebar.config.script | 13 +- src/Makefile.am | 198 ---------------------- 7 files changed, 177 insertions(+), 515 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/4c23323e/c_src/spawnkillable/couchspawnkillable_win.c ---------------------------------------------------------------------- diff --git a/c_src/spawnkillable/couchspawnkillable_win.c b/c_src/spawnkillable/couchspawnkillable_win.c new file mode 100644 index 0000000..0678231 --- /dev/null +++ b/c_src/spawnkillable/couchspawnkillable_win.c @@ -0,0 +1,145 @@ +// Licensed under the Apache License, Version 2.0 (the "License"); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +// Do what 2 lines of shell script in couchspawnkillable does... +// * Create a new suspended process with the same (duplicated) standard +// handles as us. +// * Write a line to stdout, consisting of the path to ourselves, plus +// '--kill {pid}' where {pid} is the PID of the newly created process. +// * Un-suspend the new process. +// * Wait for the process to terminate. +// * Terminate with the child's exit-code. + +// Later, couch will call us with --kill and the PID, so we dutifully +// terminate the specified PID. + +#include +#include "windows.h" + +char *get_child_cmdline(int argc, char **argv) +{ + // make a new command-line, but skipping me. + // XXX - todo - spaces etc in args??? + int i; + char *p, *cmdline; + int nchars = 0; + int nthis = 1; + for (i=1;i -#include "windows.h" - -char *get_child_cmdline(int argc, char **argv) -{ - // make a new command-line, but skipping me. - // XXX - todo - spaces etc in args??? - int i; - char *p, *cmdline; - int nchars = 0; - int nthis = 1; - for (i=1;i {CFLAGS, LDFLAGS ++ " -lcurl"} end, +PortSpecs0 = case os:type() of + {win32, _} -> + [{filename:join(["priv", "couchspawnkillable"]), + ["c_src/spawnkillable/*.c"]}]; + _ -> + {ok, _} = file:copy("priv/couchspawnkillable.sh", + "priv/couchspawnkillable"), + os:cmd("chmod +x priv/couchspawnkillable"), + [] + end, + PortEnv = [{port_env, [ {"CFLAGS", "$CFLAGS -Wall -c -g -O2 " ++ CFLAGS1}, {"LDFLAGS", "$LDFLAGS " ++ LDFLAGS1}]}, {port_specs, [ {filename:join(["priv", CouchJSName]), - ["c_src/couch_js/*.c"]}]} + ["c_src/couch_js/*.c"]}] ++ PortSpecs0} ], lists:keymerge(1,lists:keysort(1, PortEnv), lists:keysort(1, CONFIG)). http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/4c23323e/src/Makefile.am ---------------------------------------------------------------------- diff --git a/src/Makefile.am b/src/Makefile.am deleted file mode 100644 index 9fe19bc..0000000 --- a/src/Makefile.am +++ /dev/null @@ -1,198 +0,0 @@ -## Licensed under the Apache License, Version 2.0 (the "License"); you may not -## use this file except in compliance with the License. You may obtain a copy of -## the License at -## -## http://www.apache.org/licenses/LICENSE-2.0 -## -## Unless required by applicable law or agreed to in writing, software -## distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -## WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -## License for the specific language governing permissions and limitations under -## the License. - -SUBDIRS = priv - -# devdocdir = $(localdocdir)/developer/couchdb -couchlibdir = $(localerlanglibdir)/couch-$(version) -couchincludedir = $(couchlibdir)/include -couchebindir = $(couchlibdir)/ebin - -couchinclude_DATA = couch_db.hrl couch_js_functions.hrl -couchebin_DATA = $(compiled_files) - -# dist_devdoc_DATA = $(doc_base) $(doc_modules) - -CLEANFILES = $(compiled_files) $(doc_base) - -# CLEANFILES = $(doc_modules) edoc-info - -source_files = \ - couch.erl \ - couch_app.erl \ - couch_auth_cache.erl \ - couch_btree.erl \ - couch_changes.erl \ - couch_compaction_daemon.erl \ - couch_compress.erl \ - couch_config.erl \ - couch_config_writer.erl \ - couch_db.erl \ - couch_db_update_notifier.erl \ - couch_db_update_notifier_sup.erl \ - couch_doc.erl \ - couch_drv.erl \ - couch_ejson_compare.erl \ - couch_event_sup.erl \ - couch_external_manager.erl \ - couch_external_server.erl \ - couch_file.erl \ - couch_httpd.erl \ - couch_httpd_db.erl \ - couch_httpd_auth.erl \ - couch_httpd_cors.erl \ - couch_httpd_oauth.erl \ - couch_httpd_external.erl \ - couch_httpd_misc_handlers.erl \ - couch_httpd_proxy.erl \ - couch_httpd_rewrite.erl \ - couch_httpd_stats_handlers.erl \ - couch_httpd_vhost.erl \ - couch_key_tree.erl \ - couch_log.erl \ - couch_native_process.erl \ - couch_os_daemons.erl \ - couch_os_process.erl \ - couch_passwords.erl \ - couch_primary_sup.erl \ - couch_query_servers.erl \ - couch_ref_counter.erl \ - couch_secondary_sup.erl \ - couch_server.erl \ - couch_server_sup.erl \ - couch_stats_aggregator.erl \ - couch_stats_collector.erl \ - couch_stream.erl \ - couch_task_status.erl \ - couch_users_db.erl \ - couch_util.erl \ - couch_uuids.erl \ - couch_db_updater.erl \ - couch_work_queue.erl \ - json_stream_parse.erl - -EXTRA_DIST = $(source_files) couch_db.hrl couch_js_functions.hrl - -compiled_files = \ - couch.app \ - couch.beam \ - couch_app.beam \ - couch_auth_cache.beam \ - couch_btree.beam \ - couch_changes.beam \ - couch_compaction_daemon.beam \ - couch_compress.beam \ - couch_config.beam \ - couch_config_writer.beam \ - couch_db.beam \ - couch_db_update_notifier.beam \ - couch_db_update_notifier_sup.beam \ - couch_doc.beam \ - couch_drv.beam \ - couch_ejson_compare.beam \ - couch_event_sup.beam \ - couch_external_manager.beam \ - couch_external_server.beam \ - couch_file.beam \ - couch_httpd.beam \ - couch_httpd_db.beam \ - couch_httpd_auth.beam \ - couch_httpd_oauth.beam \ - couch_httpd_cors.beam \ - couch_httpd_proxy.beam \ - couch_httpd_external.beam \ - couch_httpd_misc_handlers.beam \ - couch_httpd_rewrite.beam \ - couch_httpd_stats_handlers.beam \ - couch_httpd_vhost.beam \ - couch_key_tree.beam \ - couch_log.beam \ - couch_native_process.beam \ - couch_os_daemons.beam \ - couch_os_process.beam \ - couch_passwords.beam \ - couch_primary_sup.beam \ - couch_query_servers.beam \ - couch_ref_counter.beam \ - couch_secondary_sup.beam \ - couch_server.beam \ - couch_server_sup.beam \ - couch_stats_aggregator.beam \ - couch_stats_collector.beam \ - couch_stream.beam \ - couch_task_status.beam \ - couch_users_db.beam \ - couch_util.beam \ - couch_uuids.beam \ - couch_db_updater.beam \ - couch_work_queue.beam \ - json_stream_parse.beam - -# doc_base = \ -# erlang.png \ -# index.html \ -# modules-frame.html \ -# overview-summary.html \ -# packages-frame.html \ -# stylesheet.css - -# doc_modules = \ -# couch_btree.html \ -# couch_config.html \ -# couch_config_writer.html \ -# couch_db.html \ -# couch_db_update_notifier.html \ -# couch_db_update_notifier_sup.html \ -# couch_doc.html \ -# couch_event_sup.html \ -# couch_file.html \ -# couch_httpd.html \ -# couch_key_tree.html \ -# couch_log.html \ -# couch_query_servers.html \ -# couch_rep.html \ -# couch_rep_sup.html \ -# couch_server.html \ -# couch_server_sup.html \ -# couch_stream.html \ -# couch_util.html - -if WINDOWS -couch.app: couch.app.tpl - modules=`find . -name "*.erl" \! -name ".*" -exec basename {} .erl \; | tr '\n' ',' | sed "s/,$$//"`; \ - sed -e "s|%package_name%|@package_name@|g" \ - -e "s|%version%|@version@|g" \ - -e "s|@modules@|$$modules|g" \ - -e "s|%localconfdir%|../etc/couchdb|g" \ - -e "s|@defaultini@|default.ini|g" \ - -e "s|@localini@|local.ini|g" > \ - $@ < $< -else -couch.app: couch.app.tpl - modules=`{ find . -name "*.erl" \! -name ".*" -exec basename {} .erl \; | tr '\n' ','; echo ''; } | sed "s/,$$//"`; \ - sed -e "s|%package_name%|@package_name@|g" \ - -e "s|%version%|@version@|g" \ - -e "s|@modules@|$$modules|g" \ - -e "s|%localconfdir%|@localconfdir@|g" \ - -e "s|@defaultini@|default.ini|g" \ - -e "s|@localini@|local.ini|g" > \ - $@ < $< - chmod +x $@ -endif - -# $(dist_devdoc_DATA): edoc-info - -# $(ERL) -noshell -run edoc_run files [\"$<\"] - -%.beam: %.erl couch_db.hrl couch_js_functions.hrl - $(ERLC) $(ERLC_FLAGS) ${TEST} $<; -