Changeset 13968
- Timestamp:
- Feb 4, 2013, 9:07:24 PM (10 years ago)
- Location:
- trunk/libtransmission
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/variant-benc.c
r13687 r13968 14 14 #include <ctype.h> /* isdigit() */ 15 15 #include <errno.h> 16 #include <stdlib.h> /* strtoul() , strtod(), realloc(), qsort(), mkstemp()*/16 #include <stdlib.h> /* strtoul() */ 17 17 #include <string.h> /* strlen(), memchr() */ 18 18 -
trunk/libtransmission/variant.c
r13868 r13968 14 14 #include <errno.h> 15 15 #include <stdio.h> /* rename() */ 16 #include <stdlib.h> /* strto ul(), strtod(), realloc(), qsort(), mkstemp() */16 #include <stdlib.h> /* strtod(), realloc(), qsort(), mkstemp() */ 17 17 #include <string.h> 18 18 19 19 #ifdef WIN32 /* tr_mkstemp() */ 20 20 #include <fcntl.h> 21 # define _S_IREAD 25622 # define _S_IWRITE 12821 #include <share.h> 22 #include <sys/stat.h> 23 23 #endif 24 24 … … 1134 1134 { 1135 1135 #ifdef WIN32 1136 1137 const int n = strlen (template) + 1; 1136 1138 const int flags = O_RDWR | O_BINARY | O_CREAT | O_EXCL | _O_SHORT_LIVED; 1137 1139 const mode_t mode = _S_IREAD | _S_IWRITE; 1138 mktemp (template); 1139 return open (template, flags, mode); 1140 wchar_t templateUTF16[n]; 1141 1142 if (MultiByteToWideChar(CP_UTF8, 0, template, -1, templateUTF16, n)) 1143 { 1144 _wmktemp(templateUTF16); 1145 WideCharToMultiByte(CP_UTF8, 0, templateUTF16, -1, template, n, NULL, NULL); 1146 return _wopen(chkFilename(templateUTF16), flags, mode); 1147 } 1148 errno = EINVAL; 1149 return -1; 1150 1140 1151 #else 1152 1141 1153 return mkstemp (template); 1154 1142 1155 #endif 1143 1156 }
Note: See TracChangeset
for help on using the changeset viewer.