From 8ad237190a8d3ae259570a9018de06cad76becc6 Mon Sep 17 00:00:00 2001 From: MySQL Build Team Date: Thu, 4 Jun 2009 18:47:38 +0200 Subject: [PATCH] Some portability fixes. include/Makefile.am: use @PERL@ to call scripts/dheadgen.pl - don't rely on #! /usr/bin/perl scripts/dheadgen.pl: use 2-arg open() for compatibility with older Perl versions storage/innobase/srv/srv0srv.c: Don't use C++-style comments in C code --- include/Makefile.am | 2 +- scripts/dheadgen.pl | 12 ++++++------ storage/innobase/srv/srv0srv.c | 22 +++++++++++----------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/include/Makefile.am b/include/Makefile.am index 214ef8862e9..dd6f53f7ca2 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -87,7 +87,7 @@ probes_mysql_dtrace.h: $(DTRACEPROVIDER) endif probes_mysql_nodtrace.h: $(DTRACEPROVIDER) - $(top_srcdir)/scripts/dheadgen.pl -f $(DTRACEPROVIDER) > $@ + @PERL@ $(top_srcdir)/scripts/dheadgen.pl -f $(DTRACEPROVIDER) > $@ # Don't update the files from bitkeeper %::SCCS/s.% diff --git a/scripts/dheadgen.pl b/scripts/dheadgen.pl index 5ead0f90a31..374b232a04e 100755 --- a/scripts/dheadgen.pl +++ b/scripts/dheadgen.pl @@ -267,23 +267,23 @@ usage() if ($infile !~ /(.+)\.d$/); # If the system has native support for DTrace, we'll use that binary instead. # if (-x '/usr/sbin/dtrace' && !$force) { - open(my $dt, '-|', "/usr/sbin/dtrace -C -h -s $infile -o /dev/stdout") + open(DTRACE, "-| /usr/sbin/dtrace -C -h -s $infile -o /dev/stdout") or die "can't invoke dtrace(1M)"; - while (<$dt>) { + while () { emit_dtrace($_); } - close($dt); + close(DTRACE); exit(0); } emit_prologue($infile); -open(my $d, '<', $infile) or die "couldn't open $infile"; -@lines = <$d>; -close($d); +open(D, "< $infile") or die "couldn't open $infile"; +@lines = ; +close(D); while (1) { my $nl = 0; diff --git a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c index e0fe6f40197..21aafcfd7d7 100644 --- a/storage/innobase/srv/srv0srv.c +++ b/storage/innobase/srv/srv0srv.c @@ -422,28 +422,28 @@ FILE* srv_misc_tmpfile; ulint srv_main_thread_process_no = 0; ulint srv_main_thread_id = 0; -// The following count work done by srv_master_thread. +/* The following count work done by srv_master_thread. */ -// Iterations by the 'once per second' loop. +/* Iterations by the 'once per second' loop */ ulint srv_main_1_second_loops = 0; -// Calls to sleep by the 'once per second' loop. +/* Calls to sleep by the 'once per second' loop */ ulint srv_main_sleeps = 0; -// Iterations by the 'once per 10 seconds' loop. +/* Iterations by the 'once per 10 seconds' loop */ ulint srv_main_10_second_loops = 0; -// Iterations of the loop bounded by the 'background_loop' label. +/* Iterations of the loop bounded by the 'background_loop' label */ ulint srv_main_background_loops = 0; -// Iterations of the loop bounded by the 'flush_loop' label. +/* Iterations of the loop bounded by the 'flush_loop' label */ ulint srv_main_flush_loops = 0; -// Calls to log_buffer_flush_to_disk. +/* Calls to log_buffer_flush_to_disk */ ulint srv_sync_flush = 0; -// Calls to log_buffer_flush_maybe_sync. +/* Calls to log_buffer_flush_maybe_sync */ ulint srv_async_flush = 0; -// Number of microseconds threads wait because of -// innodb_thread_concurrency +/* Number of microseconds threads wait because of +innodb_thread_concurrency */ static ib_longlong srv_thread_wait_mics = 0; -// Number of microseconds for spinlock delay +/* Number of microseconds for spinlock delay */ static ib_longlong srv_timed_spin_delay = 0; /*