We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8084ddb commit 209d157Copy full SHA for 209d157
src/phongo_ini.c
@@ -15,6 +15,7 @@
15
*/
16
17
#include <stdio.h>
18
+#include <time.h>
19
20
#include <php.h>
21
#include <main/php_open_temporary_file.h>
@@ -27,16 +28,13 @@ ZEND_EXTERN_MODULE_GLOBALS(mongodb)
27
28
29
static FILE* phongo_ini_tmp_file(const char* tmp_dir)
30
{
- time_t t;
31
int fd = -1;
32
char* prefix;
33
int len;
34
zend_string* filename = NULL;
35
FILE* stream = NULL;
36
37
- /* TODO: consider using time() retval directly instead of time_t struct */
38
- time(&t);
39
- len = spprintf(&prefix, 0, "PHONGO-%ld", t);
+ len = spprintf(&prefix, 0, "PHONGO-%ld", time(NULL));
40
41
/* TODO: Refactor this to use fdopen (see: PHPC-2181) */
42
fd = php_open_temporary_fd(tmp_dir, prefix, &filename);
0 commit comments