Author: adrian.chadd
Date: Fri Jul 10 05:13:39 2009
New Revision: 14178
Modified:
playpen/LUSCA_HEAD_storework/libsqstore/store_log.c
playpen/LUSCA_HEAD_storework/libsqstore/store_log.h
Log:
Add a function which writes out a progress entry
Modified: playpen/LUSCA_HEAD_storework/libsqstore/store_log.c
==============================================================================
--- playpen/LUSCA_HEAD_storework/libsqstore/store_log.c (original)
+++ playpen/LUSCA_HEAD_storework/libsqstore/store_log.c Fri Jul 10 05:13:39
2009
@@ -64,3 +64,21 @@
sh->op = SWAP_LOG_COMPLETED;
return write(1, sh, sizeof(storeSwapLogData));
}
+
+int
+storeSwapLogPrintProgress(int fd, u_int32_t progress, u_int32_t total)
+{
+ char buf[128];
+ storeSwapLogProgress *sp = (storeSwapLogProgress *) buf;
+
+ bzero(buf, sizeof(buf));
+ sp->op = SWAP_LOG_PROGRESS;
+ sp->total = total;
+ sp->progress = progress;
+
+ /* storeSwapLogData is the record size */
+ if (write(1, buf, sizeof(storeSwapLogData)) <= 0)
+ return 0;
+ return 1;
+}
+
Modified: playpen/LUSCA_HEAD_storework/libsqstore/store_log.h
==============================================================================
--- playpen/LUSCA_HEAD_storework/libsqstore/store_log.h (original)
+++ playpen/LUSCA_HEAD_storework/libsqstore/store_log.h Fri Jul 10 05:13:39
2009
@@ -67,6 +67,7 @@
extern int storeSwapLogUpgradeEntry(storeSwapLogData *dst,
storeSwapLogDataOld *src);
extern int storeSwapLogPrintHeader(int fd);
+extern int storeSwapLogPrintProgress(int fd, u_int32_t progress, u_int32_t
total);
extern int storeSwapLogPrintCompleted(int fd);
#endif
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"lusca-commit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/lusca-commit?hl=en
-~----------~----~----~----~------~----~------~--~---