Whamcloud - gitweb
Branch b1_6
authorvitaly <vitaly>
Wed, 22 Apr 2009 14:08:09 +0000 (14:08 +0000)
committervitaly <vitaly>
Wed, 22 Apr 2009 14:08:09 +0000 (14:08 +0000)
b=<bug>
i=deen
i=vs

lctl dk should zero the file before writing the debug log into,
otherwise, if a file was long enough and is not completely overwritten
we get a mix of several logs.

lnet/utils/debug.c

index e0128a3..973cac0 100644 (file)
@@ -631,7 +631,7 @@ int jt_dbg_debug_kernel(int argc, char **argv)
                 return 1;
         }
         if (argc > 1) {
-                fdout = open(argv[1], O_WRONLY | O_CREAT);
+                fdout = open(argv[1], O_WRONLY | O_CREAT | O_TRUNC);
                 if (fdout < 0) {
                         fprintf(stderr, "fopen(%s) failed: %s\n", argv[1],
                                 strerror(errno));