]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Yet More SnowMotion Logging
authorOliver Kurth <okurth@vmware.com>
Fri, 27 Jul 2018 18:46:21 +0000 (11:46 -0700)
committerOliver Kurth <okurth@vmware.com>
Fri, 27 Jul 2018 18:46:21 +0000 (11:46 -0700)
Prior logging indicates an issue when reading back from disk, so
tweak the logging to report the count# (since SuperFgets doesn't log
null terminators) of bytes and add a log to Dictionary_WriteFile to log
the last 100 bytes of the buffer.

open-vm-tools/lib/include/vmstdio.h
open-vm-tools/lib/misc/vmstdio.c

index 00adc11840009492632819d097b89288d0c12420..18dcc8347a62c003fa44110503f6357669b8deac 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * Copyright (C) 1998-2017 VMware, Inc. All rights reserved.
+ * Copyright (C) 1998-2018 VMware, Inc. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published
@@ -37,7 +37,7 @@ typedef enum {
    StdIO_Success,
 } StdIO_Status;
 
-typedef void (*SnowMotionLogger)(char *buf);
+typedef void (*SnowMotionLogger)(char *buf, size_t count);
 
 void
 StdIO_ToggleSnowMotionLogging(SnowMotionLogger logger);
index 6d8075eb5bde9956f98e636b28635a6a44455715..c633fbac461ce3453a0284468eb2dc02cce7e0d1 100644 (file)
@@ -166,7 +166,7 @@ SuperFgets(FILE *stream,   // IN:
    *count = size;
 
    if (snowMotionLogger != NULL) {
-      snowMotionLogger(buf);
+      snowMotionLogger(buf, *count);
    }
 
    return buf;