apps/app_keyprefetch.c
static int create_temp_file(const char *path, char **filename)
{
	const char *template_name = "certXXXXXX";
	int fd;

	if (ast_asprintf(filename, "%s/%s", path, template_name) < 0) {
		ast_log(LOG_ERROR, "Failed to set up temporary file path for CURL\n");
		return -1;
	}

	ast_mkdir(path, 0644);

	if ((fd = mkstemp(*filename)) < 0) {
		ast_log(LOG_NOTICE, "Failed to create temporary file for CURL\n");
		ast_free(*filename);
		return -1;
	}

	return fd;
}
/* from res/res_stir_shaken/curl.c */
/*!
 * \brief Create a temporary file located at path
 *
 * \note This function assumes path does not end with a '/'
 *
 * \param path The directory path to create the file in
 * \param filename Function allocates memory and stores full filename (including path) here
 *
 * \retval -1 on failure
 * \return file descriptor on success
 */
from res/res_stir_shaken/curl.c
\brief Create a temporary file located at path

\note This function assumes path does not end with a '/'

\param path The directory path to create the file in
\param filename Function allocates memory and stores full filename (including path) here

\retval -1 on failure
\return file descriptor on success
from res / res_stir_shaken / curl . c \ brief Create a temporary file located at path \ note This function assumes path does not end with a ' / ' \ param path The directory path to create the file in \ param filename Function allocates memory and stores full filename ( including path ) here \ retval - 1 on failure \ return file descriptor on success
static int create_temp_file(const char *path, char **filename)
{
	const char *template_name = "certXXXXXX";
	int fd;
	if (ast_asprintf(filename, "%s/%s", path, template_name) < 0) {
		ast_log(LOG_ERROR, "Failed to set up temporary file path for CURL\n");
		return -1;
	}
	ast_mkdir(path, 0644);
	if ((fd = mkstemp(*filename)) < 0) {
		ast_log(LOG_NOTICE, "Failed to create temporary file for CURL\n");
		ast_free(*filename);
		return -1;
	}
	return fd;
}
static int create_temp_file ( const char * path , char * * filename ) { const char * template_name = " " ; int fd ; if ( ast_asprintf ( filename , " " , path , template_name ) < 0 ) { ast_log ( LOG_ERROR , " \n " ) ; return -1 ; } ast_mkdir ( path , 0644 ) ; if ( ( fd = mkstemp ( * filename ) ) < 0 ) { ast_log ( LOG_NOTICE , " \n " ) ; ast_free ( * filename ) ; return -1 ; } return fd ; }
from res/res_stir_shaken/curl.c
 \brief Create a temporary file located at path
from res / res_stir_shaken / curl . c \ brief Create a temporary file located at path