Whamcloud - gitweb
Branch b1_x_lnet_gate
authoradilger <adilger>
Wed, 9 Jul 2008 22:37:09 +0000 (22:37 +0000)
committeradilger <adilger>
Wed, 9 Jul 2008 22:37:09 +0000 (22:37 +0000)
Avoid compiler warning if _GNU_SOURCE is #defined already by Makefile.

lnet/utils/debug.c

index bfcacb2..bb5760d 100644 (file)
@@ -24,7 +24,9 @@
  */
 
 #define __USE_FILE_OFFSET64
-#define  _GNU_SOURCE
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
 
 #include <stdio.h>
 #ifdef HAVE_NETDB_H
@@ -72,7 +74,7 @@ static const char *libcfs_debug_subsystems[] =
          "pinger", "filter", "", "echo",
          "ldlm", "lov", "", "",
          "", "", "", "lmv",
-         "", "sec", "gss", "", 
+         "", "sec", "gss", "",
          "mgc", "mgs", "fid", "fld", NULL};
 static const char *libcfs_debug_masks[] =
         {"trace", "inode", "super", "ext2",
@@ -372,7 +374,7 @@ static int add_rec(struct dbg_line *line, struct dbg_line ***linevp, int *lenp,
                 *linevp = linev;
                 *lenp = nlen;
         }
-        linev[used] = line; 
+        linev[used] = line;
         return 1;
 }
 
@@ -439,10 +441,10 @@ static int parse_buffer(FILE *in, FILE *out)
                 line->text = p;
 
                 if (!add_rec(line, &linev, &linev_len, kept)) {
-                        fprintf(stderr, "malloc failed; printing accumulated " 
+                        fprintf(stderr, "malloc failed; printing accumulated "
                                 "records and exiting.\n");
                         break;
-                }        
+                }
                 kept++;
         }
 
@@ -482,7 +484,7 @@ int jt_dbg_debug_kernel(int argc, char **argv)
                 strcpy(filename, argv[1]);
         else
                 sprintf(filename, "/tmp/lustre-log."CFS_TIME_T".%u",
-                       time(NULL),getpid());
+                        time(NULL),getpid());
 
         if (stat(filename, &st) == 0 && S_ISREG(st.st_mode))
                 unlink(filename);