~ubuntu-branches/ubuntu/quantal/open-vm-tools/quantal-201210021442

« back to all changes in this revision

Viewing changes to libvmtools/fileLogger.c

  • Committer: Bazaar Package Importer
  • Author(s): Serge Hallyn
  • Date: 2011-03-31 14:20:05 UTC
  • mfrom: (1.4.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110331142005-3n9red91p7ogkweo
Tags: 2011.03.28-387002-0ubuntu1
* Merge latest upstream git tag.  This has the unlocked_ioctl change
  needed to fix dkms build failures (LP: #727342)
* Changes in debian/rules:
  - work around a bug in toolbox/Makefile, where install-exec-hook is
    not happening.  This needs to get fixed the right way.
  - don't install 'vmware-user' which seems to no longer exist
  - move /etc/xdg into open-vm-toolbox (which should be done using .install)
* debian/open-vm-tools.init: add 'modprobe [-r] vmblock'. (LP: #332323)
* debian/rules and debian/open-vm-toolbox.lintian-overrides:
  - Make vmware-user-suid-wrapper suid-root (LP: #332323)

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
#endif
35
35
 
36
36
#include "vm_assert.h"
 
37
#include "vm_atomic.h"
37
38
 
38
39
typedef struct FileLoggerData {
39
40
   LogHandlerData    handler;
167
168
   if (g_file_test(path, G_FILE_TEST_EXISTS)) {
168
169
      struct stat fstats;
169
170
      if (g_stat(path, &fstats) > -1) {
 
171
#if GLIB_CHECK_VERSION(2, 10, 0)
170
172
         g_atomic_int_set(&data->logSize, (gint) fstats.st_size);
 
173
#else
 
174
         data->logSize = (gint) fstats.st_size;
 
175
         Atomic_MFence();
 
176
#endif
171
177
      }
172
178
 
173
179
      if (!data->append || g_atomic_int_get(&data->logSize) >= data->maxSize) {
213
219
            g_free(g_ptr_array_index(logfiles, id));
214
220
         }
215
221
         g_ptr_array_free(logfiles, TRUE);
 
222
#if GLIB_CHECK_VERSION(2, 10, 0)
216
223
         g_atomic_int_set(&data->logSize, 0);
 
224
#else
 
225
         data->logSize = 0;
 
226
         Atomic_MFence();
 
227
#endif
217
228
         data->append = FALSE;
218
229
      }
219
230
   }