Skip to content

Commit b54f25c

Browse files
author
Keyur Govande
committed
Fixes for review comments by auroraeosrose
1 parent 9a881e0 commit b54f25c

File tree

5 files changed

+13
-7
lines changed

5 files changed

+13
-7
lines changed

sapi/cli/php_cli.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ ZEND_END_ARG_INFO()
482482
static const zend_function_entry additional_functions[] = {
483483
ZEND_FE(dl, arginfo_dl)
484484
PHP_FE(cli_set_process_title, arginfo_cli_set_process_title)
485-
PHP_FE(cli_get_process_title, NULL)
485+
PHP_FE(cli_get_process_title, arginfo_cli_get_process_title)
486486
{NULL, NULL, NULL}
487487
};
488488

sapi/cli/php_cli_process_title.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ PHP_FUNCTION(cli_get_process_title)
5656
const char* title = NULL;
5757
int rc;
5858

59+
if (zend_parse_parameters_none() == FAILURE) {
60+
return;
61+
}
62+
5963
rc = get_ps_title(&length, &title);
6064
if (rc != PS_TITLE_SUCCESS) {
6165
php_error_docref(NULL TSRMLS_CC, E_WARNING, "cli_get_process_title had an error: %s", ps_title_errno(rc));

sapi/cli/php_cli_process_title.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ ZEND_BEGIN_ARG_INFO(arginfo_cli_set_process_title, 0)
2525
ZEND_ARG_INFO(0, title)
2626
ZEND_END_ARG_INFO()
2727

28+
ZEND_BEGIN_ARG_INFO(arginfo_cli_get_process_title, 0)
29+
ZEND_END_ARG_INFO()
30+
2831
PHP_FUNCTION(cli_set_process_title);
2932
PHP_FUNCTION(cli_get_process_title);
3033

sapi/cli/php_cli_server.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ zend_module_entry cli_server_module_entry = {
433433

434434
const zend_function_entry server_additional_functions[] = {
435435
PHP_FE(cli_set_process_title, arginfo_cli_set_process_title)
436-
PHP_FE(cli_get_process_title, NULL)
436+
PHP_FE(cli_get_process_title, arginfo_cli_get_process_title)
437437
{NULL, NULL, NULL}
438438
};
439439

sapi/cli/ps_title.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ extern char** environ;
4848
#endif
4949

5050
#ifdef HAVE_SYS_PSTAT_H
51-
#include <sys/pstat.h> // for HP-UX
51+
#include <sys/pstat.h> /* for HP-UX */
5252
#endif
5353
#ifdef HAVE_PS_STRINGS
54-
#include <machine/vmparam.h> // for old BSD
54+
#include <machine/vmparam.h> /* for old BSD */
5555
#include <sys/exec.h>
5656
#endif
5757
#if defined(DARWIN)
@@ -237,7 +237,7 @@ char** save_ps_args(int argc, char** argv)
237237
#endif /* PS_USE_CLOBBER_ARGV */
238238

239239
#ifdef PS_USE_CHANGE_ARGV
240-
save_argv[0] = ps_buffer; // ps_buffer here is a static const array of size PS_BUFFER_SIZE
240+
save_argv[0] = ps_buffer; /* ps_buffer here is a static const array of size PS_BUFFER_SIZE */
241241
save_argv[1] = NULL;
242242
#endif /* PS_USE_CHANGE_ARGV */
243243

@@ -265,7 +265,7 @@ char** save_ps_args(int argc, char** argv)
265265
int is_ps_title_available()
266266
{
267267
#ifdef PS_USE_NONE
268-
return PS_TITLE_NOT_AVAILABLE; // disabled functionality
268+
return PS_TITLE_NOT_AVAILABLE; /* disabled functionality */
269269
#endif
270270

271271
if (!save_argv)
@@ -402,7 +402,6 @@ void cleanup_ps_args(char **argv)
402402

403403
#ifdef PS_USE_CLOBBER_ARGV
404404
{
405-
// clean up environ
406405
int i;
407406
for (i = 0; environ[i] != NULL; i++)
408407
free(environ[i]);

0 commit comments

Comments
 (0)