~n-muench/ubuntu/oneiric/open-vm-tools/open-vm-tools.fix-836277

« back to all changes in this revision

Viewing changes to lib/vmBackupLib/stateMachine.c

  • Committer: Bazaar Package Importer
  • Author(s): Devid Antonio Filoni
  • Date: 2008-08-15 21:21:40 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20080815212140-05fhxj8wroosysmj
Tags: 2008.08.08-109361-1ubuntu1
* Merge from Debian unstable (LP: #258393), remaining Ubuntu change:
  - add ubuntu_toolchain_FTBFS.dpatch patch, fix FTBFS
* Update ubuntu_toolchain_FTBFS.dpatch patch for the new version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
#include "strutil.h"
57
57
#include "util.h"
58
58
#include "vmstdio.h"
 
59
#include "conf.h"
59
60
 
60
61
#define VMBACKUP_ENQUEUE_EVENT() {                                      \
61
62
   gBackupState->timerEvent = EventManager_Add(gEventQueue,             \
68
69
static DblLnkLst_Links *gEventQueue = NULL;
69
70
static VmBackupState *gBackupState = NULL;
70
71
static VmBackupSyncProvider *gSyncProvider = NULL;
 
72
static Bool gLoggingEnabled = FALSE;
71
73
 
72
74
static void DebugOutput(const char *fmt, ...);
73
75
 
464
466
 
465
467
   gBackupState->SendEvent = VmBackupSendEvent;
466
468
   gBackupState->pollPeriod = 100;
 
469
   gBackupState->loggingEnabled = gLoggingEnabled;
467
470
 
468
471
   if (argsSize > 0) {
469
472
      int generateManifests = 0;
617
620
Bool
618
621
VmBackup_Init(RpcIn *rpcin,                     // IN
619
622
              DblLnkLst_Links *eventQueue,      // IN
620
 
              VmBackupSyncProvider *provider)   // IN
 
623
              VmBackupSyncProvider *provider,   // IN
 
624
              Bool loggingEnabled)              // IN
621
625
{
622
626
   DebugOutput("*** %s\n", __FUNCTION__);
623
627
   ASSERT(gEventQueue == NULL);
628
632
   ASSERT(provider->snapshotDone != NULL);
629
633
   ASSERT(provider->release != NULL);
630
634
 
 
635
   gLoggingEnabled = loggingEnabled;
631
636
   RpcIn_RegisterCallback(rpcin,
632
637
                          VMBACKUP_PROTOCOL_START,
633
638
                          VmBackupStart,
699
704
static void 
700
705
DebugOutput(const char *fmt, ...)
701
706
{
702
 
#ifdef VMX86_DEBUG
703
 
   char *str;
 
707
   if (gLoggingEnabled) {
 
708
      char *str;
 
709
      va_list args;
704
710
 
705
 
   va_list args;
706
 
   va_start(args, fmt);
707
 
   str = Str_Vasprintf(NULL, fmt, args);
708
 
   va_end(args);
709
 
   if (str != NULL) {
710
 
#if defined(_WIN32)
711
 
      OutputDebugString(str);
 
711
      va_start(args, fmt);
 
712
      str = Str_Vasprintf(NULL, fmt, args);
 
713
      va_end(args);
 
714
      if (str != NULL) {
 
715
#if defined _WIN32
 
716
         OutputDebugString(str);
712
717
#else
713
 
      fprintf(stderr, "%s", str);
 
718
         fprintf(stderr, "%s", str);
714
719
#endif
715
 
      free(str);
 
720
         free(str);
 
721
      }
716
722
   }
717
 
#endif
718
723
}
719
724