Blame infostore_trunc.patch
|
Dan Smith |
fb0793d |
# HG changeset patch
|
|
Dan Smith |
fb0793d |
# User Kaitlin Rupert <karupert@us.ibm.com>
|
|
Dan Smith |
fb0793d |
# Date 1217613773 25200
|
|
Dan Smith |
fb0793d |
# Node ID ca56c48f31038a8dc718e09ef8bf68a8917408fa
|
|
Dan Smith |
fb0793d |
# Parent 9f2f9b117797907bfa2b89a499b4eb5bb62cd458
|
|
Dan Smith |
fb0793d |
(#2) When saving out the infostore, clear any previous data.
|
|
Dan Smith |
fb0793d |
|
|
Dan Smith |
fb0793d |
Updates:
|
|
Dan Smith |
fb0793d |
|
|
Dan Smith |
fb0793d |
-Replace additional open call with ftruncate()
|
|
Dan Smith |
fb0793d |
|
|
Dan Smith |
fb0793d |
Signed-off-by: Kaitlin Rupert <karupert@us.ibm.com>
|
|
Dan Smith |
fb0793d |
|
|
Dan Smith |
fb0793d |
diff -r 9f2f9b117797 -r ca56c48f3103 libxkutil/infostore.c
|
|
Dan Smith |
fb0793d |
--- a/libxkutil/infostore.c Mon Aug 04 11:57:27 2008 -0700
|
|
Dan Smith |
fb0793d |
+++ b/libxkutil/infostore.c Fri Aug 01 11:02:53 2008 -0700
|
|
Dan Smith |
fb0793d |
@@ -150,6 +150,9 @@
|
|
Dan Smith |
fb0793d |
long size = 0;
|
|
Dan Smith |
fb0793d |
|
|
Dan Smith |
fb0793d |
lseek(ctx->fd, 0, SEEK_SET);
|
|
Dan Smith |
fb0793d |
+
|
|
Dan Smith |
fb0793d |
+ if (ftruncate(ctx->fd, 0) != 0)
|
|
Dan Smith |
fb0793d |
+ CU_DEBUG("Unable to truncate infostore");
|
|
Dan Smith |
fb0793d |
|
|
Dan Smith |
fb0793d |
save = xmlSaveToFd(ctx->fd, NULL, 0);
|
|
Dan Smith |
fb0793d |
if (save == NULL) {
|