diff --git a/tensorflow/c/env.cc b/tensorflow/c/env.cc index 6d8528bc42f..ce715c43acb 100644 --- a/tensorflow/c/env.cc +++ b/tensorflow/c/env.cc @@ -147,8 +147,8 @@ TF_StringStream* TF_GetLocalTempDirectories() { return list; } -void TF_GetTempFileName(const char* extension, char** name) { - *name = strdup(::tensorflow::io::GetTempFilename(extension).c_str()); +char* TF_GetTempFileName(const char* extension) { + return strdup(::tensorflow::io::GetTempFilename(extension).c_str()); } TF_CAPI_EXPORT extern uint64_t TF_NowNanos(void) { diff --git a/tensorflow/c/env.h b/tensorflow/c/env.h index 29ec417a75e..7dc7ac32f08 100644 --- a/tensorflow/c/env.h +++ b/tensorflow/c/env.h @@ -154,8 +154,7 @@ TF_CAPI_EXPORT extern TF_StringStream* TF_GetLocalTempDirectories(void); // Creates a temporary file name with an extension. // The caller is responsible for freeing the returned pointer. -TF_CAPI_EXPORT extern void TF_GetTempFileName(const char* extension, - char** name); +TF_CAPI_EXPORT extern char* TF_GetTempFileName(const char* extension); // Returns the number of nanoseconds since the Unix epoch. TF_CAPI_EXPORT extern uint64_t TF_NowNanos(void);