Ticket #18502: patch-btrfs-image.c.diff

File patch-btrfs-image.c.diff, 879 bytes (added by 0xffea@…, 15 years ago)
  • btrfs-image.c

    old new  
    249249static int metadump_init(struct metadump_struct *md, struct btrfs_root *root,
    250250                         FILE *out, int num_threads, int compress_level)
    251251{
    252         int i, ret;
     252        int i, ret = 0;
    253253
    254254        memset(md, 0, sizeof(*md));
    255255        pthread_cond_init(&md->cond, NULL);
     
    608608                if (async->start == BTRFS_SUPER_INFO_OFFSET)
    609609                        update_super(outbuf);
    610610
     611#ifdef __APPLE__
     612                ret = pwrite(outfd, outbuf, size, async->start);
     613#else
    611614                ret = pwrite64(outfd, outbuf, size, async->start);
     615#endif
    612616                BUG_ON(ret != size);
    613617
    614618                pthread_mutex_lock(&mdres->mutex);
     
    834838        }
    835839
    836840        if (num_threads == 0 && compress_level > 0) {
     841#ifdef _SC_NPROCESSORS_ONLN
    837842                num_threads = sysconf(_SC_NPROCESSORS_ONLN);
     843#endif
    838844                if (num_threads <= 0)
    839845                        num_threads = 1;
    840846        }