From f6b60511d5bec0fbbcb1267888f01991d9b00a7f Mon Sep 17 00:00:00 2001 From: adilger Date: Wed, 9 Jul 2008 22:37:09 +0000 Subject: [PATCH] Branch b1_x_lnet_gate Avoid compiler warning if _GNU_SOURCE is #defined already by Makefile. --- lnet/utils/debug.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lnet/utils/debug.c b/lnet/utils/debug.c index bfcacb2..bb5760d 100644 --- a/lnet/utils/debug.c +++ b/lnet/utils/debug.c @@ -24,7 +24,9 @@ */ #define __USE_FILE_OFFSET64 -#define _GNU_SOURCE +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif #include #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); -- 1.8.3.1