From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 985E51F47C for ; Sun, 8 Jan 2023 18:41:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1673203291; bh=SgacEmGnAVGMj3N+astmTzoz4JpT0Uut6uyRbb1jyOs=; h=From:To:Subject:Date:From; b=mbF72enl7kQFykXs7jqq4bnS5IiVDq5n3XLwvo8ZHiDVorrAzj/1J0EMMmKsx3kLs 2KuypHWfyfMzO4JTb1z1UqI4b3e8FQVC5mFOMuypVKHpwYVuZp3D2zmmigq7/wXX9l yhScMHOG5Ha3C9c9qwphS9c0ym9+ZwS4FOqr1JdE= From: Eric Wong To: Subject: [PATCH] httpd: undefine ruby_snprintf alias for non-Ruby processes Date: Sun, 8 Jan 2023 18:41:31 +0000 Message-Id: <20230108184131.22288-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: ruby/subst.h (included by ruby.h) replaces `snprintf' with `ruby_snprintf'. This only works in processes linked to Ruby, but won't work in subprocesses spawned by Ruby. --- ext/mwrap/httpd.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ext/mwrap/httpd.h b/ext/mwrap/httpd.h index 03aef9f..da7ff6d 100644 --- a/ext/mwrap/httpd.h +++ b/ext/mwrap/httpd.h @@ -43,6 +43,14 @@ #define TYPE_CSV "text/csv" #define TYPE_PLAIN "text/plain" +/* + * C ruby defines snprintf to ruby_snprintf, we can't have that in + * non-ruby processes spawned by C ruby + */ +#if MWRAP_RUBY && defined(snprintf) +# undef snprintf +#endif + enum mw_qev { MW_QEV_IGNORE = 0, MW_QEV_RD = POLLIN,