zircon/tools/blobfs/main.cc
// Add the blob described by |info| on host to the |blobfs| blobfs store.
Add the blob described by |info| on host to the |blobfs| blobfs store.
Add the blob described by |info| on host to the |blobfs| blobfs store .
zx_status_t AddBlob(blobfs::Blobfs* blobfs, JsonRecorder* json_recorder,
                    const blobfs::MerkleInfo& info) {
  const char* path = info.path.c_str();
  fbl::unique_fd data_fd(open(path, O_RDONLY, 0644));
  if (!data_fd) {
    fprintf(stderr, "error: cannot open '%s'\n", path);
    return ZX_ERR_IO;
  }
  zx_status_t status =
      blobfs::blobfs_add_blob_with_merkle(blobfs, json_recorder, data_fd.get(), info);
  if (status != ZX_OK && status != ZX_ERR_ALREADY_EXISTS) {
    fprintf(stderr, "blobfs: Failed to add blob '%s': %d\n", path, status);
    return status;
  }
  return ZX_OK;
}
zx_status_t AddBlob ( blobfs :: Blobfs * blobfs , JsonRecorder * json_recorder , const blobfs :: MerkleInfo & info ) { const char * path = info . path . c_str ( ) ; fbl :: unique_fd data_fd ( open ( path , O_RDONLY , 0644 ) ) ; if ( ! data_fd ) { fprintf ( stderr , " \n " , path ) ; return ZX_ERR_IO ; } zx_status_t status = blobfs :: blobfs_add_blob_with_merkle ( blobfs , json_recorder , data_fd . get ( ) , info ) ; if ( status != ZX_OK && status != ZX_ERR_ALREADY_EXISTS ) { fprintf ( stderr , " \n " , path , status ) ; return status ; } return ZX_OK ; }
Add the blob described by |info| on host to the |blobfs| blobfs store.
Add the blob described by |info| on host to the |blobfs| blobfs store .