Skip to content
This repository has been archived by the owner on Jan 15, 2019. It is now read-only.

Commit

Permalink
core: fix compiling with embedded perl #2197
Browse files Browse the repository at this point in the history
i fucked up, sorry. buy me more beer for proper code and tests :p

refs #2197
  • Loading branch information
Michael Friedrich committed Aug 21, 2012
1 parent ec9c5e3 commit eeb8cde
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions base/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ int my_system_r(icinga_macros *mac, char *cmd, int timeout, int *early_timeout,
int dbuf_chunk = 1024;
int flags;
#ifdef EMBEDDEDPERL
char *temp_buffer = NULL;
char fname[512] = "";
char *args[5] = {"", DO_CLEAN, "", "", NULL };
SV *plugin_hndlr_cr = NULL; /* perl.h holds typedef struct */
Expand Down Expand Up @@ -3598,7 +3599,7 @@ int file_uses_embedded_perl(char *fname) {
return FALSE;

/* grab the first line - we should see Perl. go home if not */
if (fgets(line1, 80, fp) == NULL || strstr(buf, "/bin/perl") == NULL) {
if (fgets(buf, 80, fp) == NULL || strstr(buf, "/bin/perl") == NULL) {
fclose(fp);
}

Expand All @@ -3610,7 +3611,7 @@ int file_uses_embedded_perl(char *fname) {
buf[sizeof(buf) - 1] = '\0';

/* line contains Icinga directives - keep Nagios compatibility */
if (strstr(linen, "# nagios:") || strstr(linen, "# icinga:")) {
if (strstr(buf, "# nagios:") || strstr(buf, "# icinga:")) {
char *p;
p = strstr(buf + 8, "epn");
if (!p)
Expand Down

0 comments on commit eeb8cde

Please sign in to comment.