Quellcode durchsuchen

Merge pull request #365 from mjtrangoni/gcc73-fixes

fix some gcc-7.3 warnings
Bryan Heden vor 7 Jahren
Ursprung
Commit
3cd9f8f91d
5 geänderte Dateien mit 10 neuen und 13 gelöschten Zeilen
  1. 0 1
      lib/utils_cmd.c
  2. 7 6
      plugins/check_disk.c
  3. 1 1
      plugins/check_procs.c
  4. 0 3
      plugins/check_uptime.c
  5. 2 2
      plugins/negate.c

+ 0 - 1
lib/utils_cmd.c

@@ -298,7 +298,6 @@ _cmd_fetch_output (int fd, output * op, int flags)
 int
 cmd_run (const char *cmdstring, output * out, output * err, int flags)
 {
-	int fd, pfd_out[2], pfd_err[2];
 	int i = 0, argc;
 	size_t cmdlen;
 	char **argv = NULL;

+ 7 - 6
plugins/check_disk.c

@@ -59,7 +59,7 @@ const char *email = "devel@nagios-plugins.org";
 #endif
 
 /* If nonzero, show inode information. */
-static int inode_format = 1;
+// static int inode_format = 1;
 
 /* If nonzero, show even filesystems with zero size or
    uninteresting types. */
@@ -174,13 +174,14 @@ main (int argc, char **argv)
   char status_lit[4];
   char *perf;
   char *preamble;
-  double inode_space_pct;
+  char *flag_header;
+  //double inode_space_pct;
   double warning_high_tide;
   double critical_high_tide;
   int temp_result;
 
-  struct mount_entry *me, *last_me = NULL;
-  struct fs_usage fsp, tmpfsp;
+  struct mount_entry *me;
+  struct fs_usage fsp;
   struct parameter_list *temp_list, *path;
 
 #ifdef __CYGWIN__
@@ -460,8 +461,8 @@ process_arguments (int argc, char **argv)
   struct parameter_list *se;
   struct parameter_list *temp_list = NULL, *previous = NULL;
   struct parameter_list *temp_path_select_list = NULL;
-  struct mount_entry *me, *temp_me;
-  int result = OK;
+  struct mount_entry *me;
+  //int result = OK;
   regex_t re;
   int cflags = REG_NOSUB | REG_EXTENDED;
   int default_cflags = cflags;

+ 1 - 1
plugins/check_procs.c

@@ -256,7 +256,7 @@ main (int argc, char **argv)
 
 			/* Ignore self */
 			if ((usepid && mypid == procpid) ||
-				(!usepid && ((ret = stat_exe(procpid, &statbuf) != -1) && statbuf.st_dev == mydev && statbuf.st_ino == myino) ||
+				((!usepid && ((ret = stat_exe(procpid, &statbuf) != -1) && statbuf.st_dev == mydev && statbuf.st_ino == myino)) ||
 				 (ret == -1 && errno == ENOENT))) {
 				if (verbose >= 3)
 					 printf("not considering - is myself or gone\n");

+ 0 - 3
plugins/check_uptime.c

@@ -129,9 +129,6 @@ int getuptime () {
 static int process_arguments (int argc, char **argv) {
 
 	int c;
-	int escape = 0;
-	char *temp;
-	
 	int option = 0;
 	static struct option longopts[] = {
 		{"critical", required_argument, 0, 'c'},

+ 2 - 2
plugins/negate.c

@@ -59,8 +59,8 @@ static int state[4] = {
 int
 main (int argc, char **argv)
 {
-	int found = 0, result = STATE_UNKNOWN;
-	char *buf, *sub;
+	int result = STATE_UNKNOWN;
+	char *sub;
 	char **command_line;
 	output chld_out, chld_err;
 	int i;