diff --git a/src/libstore-c/nix_api_store.cc b/src/libstore-c/nix_api_store.cc index 73c820d59..7ce63f5c2 100644 --- a/src/libstore-c/nix_api_store.cc +++ b/src/libstore-c/nix_api_store.cc @@ -131,7 +131,7 @@ nix_err nix_store_realise( Store * store, StorePath * path, void * userdata, - void (*callback)(void * userdata, const char *, const char *)) + void (*callback)(void * userdata, const char *, const StorePath *)) { if (context) context->last_err_code = NIX_OK; @@ -146,8 +146,8 @@ nix_err nix_store_realise( if (callback) { for (const auto & result : results) { for (const auto & [outputName, realisation] : result.builtOutputs) { - auto op = store->ptr->printStorePath(realisation.outPath); - callback(userdata, outputName.c_str(), op.c_str()); + StorePath p{realisation.outPath}; + callback(userdata, outputName.c_str(), &p); } } } diff --git a/src/libstore-c/nix_api_store.h b/src/libstore-c/nix_api_store.h index 89cfc1a3c..51bd1bc89 100644 --- a/src/libstore-c/nix_api_store.h +++ b/src/libstore-c/nix_api_store.h @@ -190,7 +190,7 @@ nix_err nix_store_realise( Store * store, StorePath * path, void * userdata, - void (*callback)(void * userdata, const char * outname, const char * out)); + void (*callback)(void * userdata, const char * outname, const StorePath * out)); /** * @brief get the version of a nix store.