mirror of
https://github.com/transmission/transmission.git
synced 2025-12-24 20:35:36 +00:00
(trunk libT) #4625 "Transmission 2.42 fails to build on Solaris 10: Undefined symbol 'mkdtemp'" -- fixed.
This commit is contained in:
@@ -101,7 +101,7 @@ AC_HEADER_STDC
|
||||
AC_HEADER_TIME
|
||||
|
||||
AC_CHECK_HEADERS([stdbool.h])
|
||||
AC_CHECK_FUNCS([iconv_open pread pwrite lrintf strlcpy daemon dirname basename strcasecmp localtime_r fallocate64 posix_fallocate memmem strsep strtold syslog valloc getpagesize posix_memalign statvfs htonll ntohll])
|
||||
AC_CHECK_FUNCS([iconv_open pread pwrite lrintf strlcpy daemon dirname basename strcasecmp localtime_r fallocate64 posix_fallocate memmem strsep strtold syslog valloc getpagesize posix_memalign statvfs htonll ntohll mkdtemp])
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_MAKE_SET
|
||||
ACX_PTHREAD
|
||||
|
||||
@@ -2756,7 +2756,7 @@ deleteLocalData( tr_torrent * tor, tr_fileFunc func )
|
||||
|
||||
base = tr_strdup_printf( "%s__XXXXXX", tr_torrentName( tor ) );
|
||||
tmpdir = tr_buildPath( top, base, NULL );
|
||||
mkdtemp( tmpdir );
|
||||
tr_mkdtemp( tmpdir );
|
||||
tr_free( base );
|
||||
|
||||
for( f=0; f<tor->info.fileCount; ++f )
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#if defined(SYS_DARWIN)
|
||||
#define HAVE_GETPAGESIZE
|
||||
#define HAVE_ICONV_OPEN
|
||||
#define HAVE_MKDTEMP
|
||||
#define HAVE_VALLOC
|
||||
#endif
|
||||
|
||||
@@ -504,6 +505,18 @@ tr_dirname( const char * path )
|
||||
return ret;
|
||||
}
|
||||
|
||||
char*
|
||||
tr_mkdtemp( char * template )
|
||||
{
|
||||
#ifdef HAVE_MKDTEMP
|
||||
return mkdtemp( template );
|
||||
#else
|
||||
if( !mktemp( template ) || mkdir( template, 0700 ) )
|
||||
return NULL;
|
||||
return template;
|
||||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
tr_mkdir( const char * path,
|
||||
int permissions
|
||||
|
||||
@@ -222,6 +222,9 @@ int tr_mkdir( const char * path, int permissions ) TR_GNUC_NONNULL(1);
|
||||
*/
|
||||
int tr_mkdirp( const char * path, int permissions ) TR_GNUC_NONNULL(1);
|
||||
|
||||
/** @brief Portability wrapper for mkdtemp() that uses the system implementation if available */
|
||||
char* tr_mkdtemp( char * template );
|
||||
|
||||
|
||||
/**
|
||||
* @brief Loads a file and returns its contents.
|
||||
|
||||
Reference in New Issue
Block a user