com php-src: fix bugsnet #66591 and github #60: phpdbg.c
| From: | Bob Weinand | Date: | Wed, 29 Jan 2014 07:28:54 +0000 |
| Subject: | com php-src: fix bugsnet #66591 and github #60: phpdbg.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-77084@lists.php.net to get a copy of this message | ||
Commit: 261a5305c6b3528ec45d6e185c50dbac61916dd6
Author: krakjoe <joe.watkins@live.co.uk> Wed, 29 Jan 2014 07:28:54 +0000
Parents: c768abd420b92dca952ca5b39d6ea0a4395d802b
Branches: PHP-5.6
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=261a5305c6b3528ec45d6e185c50dbac61916dd6
Log:
fix bugsnet #66591 and github #60
Bugs:
https://bugs.php.net/66591
https://bugs.php.net/60
Changed paths:
M phpdbg.c
Diff:
diff --git a/phpdbg.c b/phpdbg.c
index e7f841c..179424b 100644
--- a/phpdbg.c
+++ b/phpdbg.c
@@ -831,7 +831,13 @@ int main(int argc, char **argv) /* {{{ */
zend_bool remote = 0;
int run = 0;
int step = 0;
+
+#ifdef _WIN32
char *bp_tmp_file;
+#else
+ char bp_tmp_file[] = "/tmp/phpdbg.XXXXXX";
+#endif
+
#ifndef _WIN32
char *address;
int listen[2];
@@ -871,8 +877,12 @@ int main(int argc, char **argv) /* {{{ */
phpdbg_main:
if (!cleaning) {
+#ifdef _WIN32
bp_tmp_file = malloc(L_tmpnam);
tmpnam(bp_tmp_file);
+#else
+ mkstemp(bp_tmp_file);
+#endif
if (bp_tmp_file == NULL) {
phpdbg_error("Unable to create temporary file");
}
@@ -1342,7 +1352,11 @@ phpdbg_out:
free(sapi_name);
}
+#ifdef _WIN32
free(bp_tmp_file);
+#else
+ unlink(bp_tmp_file);
+#endif
return 0;
} /* }}} */