Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup #9

Merged
merged 6 commits into from
Feb 2, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ GMETAD_SUBDIR =
endif

EXTRA_SUBDIRS = "gmetad-python contrib solaris"
EXTRA_DIST_FILES =
INCLUDES = @APR_INCLUDES@

AUTOMAKE_OPTIONS = dist-bzip2 dist-tarZ dist-zip
Expand All @@ -21,7 +20,7 @@ SUBDIRS = $(GANGLIA_SUBDIRS)
GANGLIA_SUBDIRS_DIST = lib libmetrics tests gmetad gmond gstat gmetric include mans
DIST_SUBDIRS = $(GANGLIA_SUBDIRS_DIST)

EXTRA_DIST = BUGS README.WIN README.AIX ganglia.spec.aix ganglia.spec ganglia.pod ganglia.html ganglia-config.in $(EXTRA_DIST_FILES)
EXTRA_DIST = BUGS README.WIN README.AIX ganglia.spec.aix ganglia.spec ganglia.pod ganglia.html ganglia-config.in

ganglia.sub: ganglia.pod
sed -e 's/GANGLIA_VERSION/@VERSION@/' < $(srcdir)/ganglia.pod > ganglia.sub
Expand Down Expand Up @@ -65,19 +64,18 @@ dist-hook:
ganglia-config: ganglia-config.in $(FIXCONFIG)
$(FIXCONFIG) ganglia-config.in

install-exec-hook: ganglia-config
install-exec-hook: ganglia-config
mkdir -p $(DESTDIR)$(bindir) && \
$(INSTALL_SCRIPT) ganglia-config $(DESTDIR)$(bindir)/ganglia-config

contrib/ganglia_gmond.xml: contrib/ganglia_gmond.xml.in $(FIXCONFIG)
contrib/ganglia_gmond.xml: contrib/ganglia_gmond.xml.in $(FIXCONFIG)
$(FIXCONFIG) contrib/ganglia_gmond.xml.in

solaris/pkginfo: solaris/pkginfo.in $(FIXCONFIG)
solaris/pkginfo: solaris/pkginfo.in $(FIXCONFIG)
$(FIXCONFIG) solaris/pkginfo.in

# Notice that some files declared in this hook never get installed anywhere
# We use the hook to force the files to be generated, but they remain
# within the build tree for someone to inspect or manually copy to
# the desired location if needed
install-data-hook: contrib/ganglia_gmond.xml solaris/pkginfo

install-data-hook: contrib/ganglia_gmond.xml solaris/pkginfo
2 changes: 1 addition & 1 deletion gmetad/process_xml.c
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ startElement_METRIC(void *data, const char *el, const char **attr)
*/
fillmetric(attr, metric, type);
if (metric->dmax && metric->tn > metric->dmax)
return;
return 0;

if (do_summary && !xmldata->ds->dead && !xmldata->rval)
{
Expand Down
2 changes: 1 addition & 1 deletion gmetric/gmetric.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ main( int argc, char *argv[] )
gmond_config = Ganglia_gmond_config_create( args_info.conf_arg, !args_info.conf_given);

/* deal with spoof overrides */
cfg_t *globals = (cfg_t*) cfg_getsec( gmond_config, "globals" );
cfg_t *globals = (cfg_t*) cfg_getsec( (cfg_t *)gmond_config, "globals" );
char *override_hostname = cfg_getstr( globals, "override_hostname" );
char *override_ip = cfg_getstr( globals, "override_ip" );

Expand Down
16 changes: 3 additions & 13 deletions gmond/gmond.c
Original file line number Diff line number Diff line change
Expand Up @@ -588,12 +588,7 @@ setup_listen_channels_pollset( int reset )
if(!reset)
{
if((udp_recv_sockets = (apr_socket_t **)apr_pcalloc(global_context, sizeof(apr_socket_t *) * (num_udp_recv_channels + 1))) == NULL)
{
char apr_err[512];
apr_strerror(status, apr_err, 511);
err_msg("apr_pcalloc failed: %s", apr_err);
exit(1);
}
err_quit("unable to allocate UDP listening sockets");
}

/* Process all the udp_recv_channels */
Expand Down Expand Up @@ -692,13 +687,8 @@ setup_listen_channels_pollset( int reset )
}
}

if((tcp_sockets = (apr_socket_t **)apr_pcalloc(global_context, sizeof(apr_socket_t *) * (num_tcp_accept_channels + 1))) == NULL)
{
char apr_err[512];
apr_strerror(status, apr_err, 511);
err_msg("apr_pcalloc failed: %s", apr_err);
exit(1);
}
if ((tcp_sockets = (apr_socket_t **)apr_pcalloc(global_context, sizeof(apr_socket_t *) * (num_tcp_accept_channels + 1))) == NULL)
err_quit("Unable to allocate TCP listening sockets");

/* Process all the tcp_accept_channels */
for(i=0; i< num_tcp_accept_channels; i++)
Expand Down
12 changes: 6 additions & 6 deletions lib/libgmond.c
Original file line number Diff line number Diff line change
Expand Up @@ -515,12 +515,6 @@ Ganglia_metadata_send_real( Ganglia_metric gmetric, Ganglia_udp_send_channels se
return Ganglia_udp_send_message( send_channels, gmetricmsg, len);
}

int
Ganglia_value_send( Ganglia_metric gmetric, Ganglia_udp_send_channels send_channels )
{
return Ganglia_value_send_real( gmetric, send_channels, NULL );
}

int
Ganglia_value_send_real( Ganglia_metric gmetric, Ganglia_udp_send_channels send_channels, char *override_string )
{
Expand Down Expand Up @@ -583,6 +577,12 @@ Ganglia_value_send_real( Ganglia_metric gmetric, Ganglia_udp_send_channels send_
return Ganglia_udp_send_message( send_channels, gmetricmsg, len);
}

int
Ganglia_value_send( Ganglia_metric gmetric, Ganglia_udp_send_channels send_channels )
{
return Ganglia_value_send_real( gmetric, send_channels, NULL );
}

int
Ganglia_metric_send( Ganglia_metric gmetric, Ganglia_udp_send_channels send_channels )
{
Expand Down
10 changes: 6 additions & 4 deletions libmetrics/cygwin/metrics.c
Original file line number Diff line number Diff line change
Expand Up @@ -717,9 +717,7 @@ g_val_t
proc_run_func( void )
{
DWORD aProcesses[MAXPROCESSES], cbNeeded, cProcesses;
unsigned int i, running = 0;
HANDLE hProcess;
BOOL bResult;
unsigned int running = 0;
g_val_t val;

if (!EnumProcesses(aProcesses, sizeof(aProcesses), &cbNeeded)) {
Expand All @@ -729,6 +727,10 @@ proc_run_func( void )
}
#if (_WIN32_WINNT >= 0x0501)
/* Only for XP or newer */
unsigned int i;
HANDLE hProcess;
BOOL bResult;

for (i = 0; i < cProcesses; i++)
if (aProcesses[i] != 0) {
hProcess = OpenProcess(PROCESS_QUERY_INFORMATION,
Expand Down Expand Up @@ -880,7 +882,7 @@ find_disk_space(double *total, double *avail)

mnttab = setmntent(MOUNTED, "r");
while ((ent = getmntent(mnttab)) != NULL) {
if (islower(ent->mnt_fsname[0])) {
if (islower((int)ent->mnt_fsname[0])) {
drive = ent->mnt_fsname[0] - 'a';
if (drives[drive].total == 0.0) {
statfs(ent->mnt_fsname, &fs);
Expand Down