~ubuntu-branches/ubuntu/quantal/ceph/quantal

« back to all changes in this revision

Viewing changes to src/mon/MonitorStore.cc

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2012-08-27 08:23:21 UTC
  • mto: This revision was merged to the branch mainline in revision 21.
  • Revision ID: package-import@ubuntu.com-20120827082321-2cfej6ddvk63vsqq
Tags: upstream-0.48.1
ImportĀ upstreamĀ versionĀ 0.48.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
174
174
  char tfn[1024];
175
175
  snprintf(tfn, sizeof(tfn), "%s.new", fn);
176
176
 
177
 
  int fd = TEMP_FAILURE_RETRY(::open(tfn, O_WRONLY|O_CREAT, 0600));
 
177
  int fd = TEMP_FAILURE_RETRY(::open(tfn, O_WRONLY|O_CREAT|O_TRUNC, 0600));
178
178
  if (fd < 0) {
179
179
    int err = errno;
180
180
    derr << "MonitorStore::put_int: failed to open '" << tfn << "': "
379
379
    snprintf(fn, sizeof(fn), "%s/%llu", dfn, (long long unsigned)p->first);
380
380
    snprintf(tfn, sizeof(tfn), "%s.new", fn);
381
381
 
382
 
    int fd = ::open(tfn, O_WRONLY|O_CREAT, 0600);
 
382
    int fd = ::open(tfn, O_WRONLY|O_CREAT|O_TRUNC, 0600);
383
383
    if (fd < 0) {
384
384
      int err = -errno;
385
385
      derr << "failed to open " << tfn << ": " << cpp_strerror(err) << dendl;