Skip to contentSkip to conversation

Flush the debug message out to the log file.

PATCH Superseded Venkateswararao Jujjuri (JV) 2 participants 3 messages Jun 1, 2010 – Jun 2, 2010

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Flush the debug message out to the log file.

This patch fluesh the debug messages to the log file at the end of each debug message.

---
 hw/virtio-9p-debug.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
hw/virtio-9p-debug.c +2 -0
index 2fb2673..5bfa689 100644
@@ -481,4 +481,6 @@ void pprint_pdu(V9fsPDU *pdu)
     }
 
     fprintf(llogfile, ")\n");
+    /* Flush the log message out */
+    fseek(llogfile, 0L, SEEK_CUR);
 }
Signature · 1 line
1.6.5.2
#1 lore raw
Quoted 13 lines · Venkateswararao Jujjuri (JV)

This patch fluesh the debug messages to the log file at the end of each debug message.

---
 hw/virtio-9p-debug.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
hw/virtio-9p-debug.c +0 -0
index 2fb2673..5bfa689 100644

hw/virtio-9p-debug.c void pprint_pdu(V9fsPDU *pdu) · line 486

Quoted 6 lines
hw/virtio-9p-debug.c +2 -0
@@ -481,4 +481,6 @@ void pprint_pdu(V9fsPDU *pdu)
     }
 
     fprintf(llogfile, ")\n");
+    /* Flush the log message out */
+    fseek(llogfile, 0L, SEEK_CUR);
 }

Why do one use fseek to flush ? why not fflush(3)

-aneesh

#2 lore raw
Quoted 16 lines · Aneesh Kumar K. V
Quoted 15 lines · Venkateswararao Jujjuri (JV)

This patch fluesh the debug messages to the log file at the end of each debug message.

---
 hw/virtio-9p-debug.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
hw/virtio-9p-debug.c +0 -0
index 2fb2673..5bfa689 100644
@@ -481,4 +481,6 @@ void pprint_pdu(V9fsPDU *pdu)
     }
 
Quoted 7 lines

hw/virtio-9p-debug.c void pprint_pdu(V9fsPDU *pdu) · line 486

Quoted 4 lines
hw/virtio-9p-debug.c +2 -0
     fprintf(llogfile, ")\n");
+    /* Flush the log message out */
+    fseek(llogfile, 0L, SEEK_CUR);
 }

Why do one use fseek to flush ? why not fflush(3)

Good question. :)
Even though functionally both are same, I will send a patch with fflush() as it is more straightforward.

- JV

Quoted 3 lines

-aneesh