]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
synclient: observe data flag on import_find
authorSage Weil <sage@newdream.net>
Wed, 18 Jun 2008 15:05:30 +0000 (08:05 -0700)
committerSage Weil <sage@newdream.net>
Wed, 18 Jun 2008 15:05:30 +0000 (08:05 -0700)
src/client/SyntheticClient.cc

index a82f8a4503f38f2955c8aa92b611c61d79a4cb39..9e1f76d3ae390f27a4d1eaecf0e55e2af5f0d037 100644 (file)
@@ -3110,7 +3110,11 @@ void SyntheticClient::import_find(const char *base, const char *find, bool data)
       } else {
        int fd = client->open(f.c_str(), O_WRONLY|O_CREAT, mode & 0777);
        assert(fd > 0); 
-       client->write(fd, "", 0, size);
+       if (data) {
+         client->write(fd, "", 0, size);
+       } else {
+         client->truncate(f.c_str(), size);
+       }
        client->close(fd);
 
        //client->chmod(f.c_str(), mode & 0777);