Commit graph

26 commits

Author SHA1 Message Date
David CARLIER
6b037200a4
sapi/cli: setting process name little optimisation. (#14767) 2024-07-02 12:12:34 +01:00
Arnaud Le Blanc
11accb5cdf
Preferably include from build dir (#13516)
* Include from build dir first

This fixes out of tree builds by ensuring that configure artifacts are included
from the build dir.

Before, out of tree builds would preferably include files from the src dir, as
the include path was defined as follows (ignoring includes from ext/ and sapi/) :

    -I$(top_builddir)/main
    -I$(top_srcdir)
    -I$(top_builddir)/TSRM
    -I$(top_builddir)/Zend
    -I$(top_srcdir)/main
    -I$(top_srcdir)/Zend
    -I$(top_srcdir)/TSRM
    -I$(top_builddir)/

As a result, an out of tree build would include configure artifacts such as
`main/php_config.h` from the src dir.

After this change, the include path is defined as follows:

    -I$(top_builddir)/main
    -I$(top_builddir)
    -I$(top_srcdir)/main
    -I$(top_srcdir)
    -I$(top_builddir)/TSRM
    -I$(top_builddir)/Zend
    -I$(top_srcdir)/Zend
    -I$(top_srcdir)/TSRM

* Fix extension include path for out of tree builds

* Include config.h with the brackets form

`#include "config.h"` searches in the directory containing the including-file
before any other include path. This can include the wrong config.h when building
out of tree and a config.h exists in the source tree.

Using `#include <config.h>` uses exclusively the include path, and gives
priority to the build dir.
2024-06-26 00:26:43 +02:00
Niels Dossche
1bd33b7476 CLI: change uses of sprintf into snprintf 2024-06-14 08:12:03 -07:00
Peter Kokot
e76f9e2b50
Remove DARWIN symbol (#13346)
When targeting Darwin systems (macOS, etc.), the compiler defines the
__APPLE__ symbol, which should be sufficient and a more established
detection method practice in these cases.
2024-02-07 21:07:48 +01:00
Ilija Tovilo
0bf8ecf9b3
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix bug GH-11246 cli/get_set_process_title
2023-05-31 17:10:17 +02:00
James Lucas
c6ae7a55b7
Fix bug GH-11246 cli/get_set_process_title
Fail to clobber_error only when the argv is a non-contiguous area
Don't increment the end_of_error if a non-contiguous area is encountered in environ

Closes GH-11247
2023-05-31 17:08:37 +02:00
David Carlier
81aedad452 opcache/pcntl/cli: Fixes few functions signatures. 2023-02-09 19:57:48 +00:00
George Peter Banyard
9a7d37ac66
Use size_t for get_ps_title() length parameter 2022-06-30 13:23:13 +01:00
George Peter Banyard
b468d6fb54
Use bool and rename variable for ease of comprehension in ps_title.c 2022-06-30 13:23:13 +01:00
David Carlier
14393b5fb3 Move includes in ps_title.c
The HAVE_UNISTD_H check has to be after including config.h.

Also include sys/types.h, which may be needed for setproctitle.
2017-12-16 17:20:05 +01:00
Anatol Belski
2ec54af8df fix buffer overflow 2017-04-03 14:22:23 +02:00
Anatol Belski
53034feda5 pull ps_title behind the logic to support the current codepage 2016-08-11 13:38:28 +02:00
David Carlier
85e985f191 couple of resource leaks fixes and use after free's 2016-06-27 07:44:21 +01:00
Anatol Belski
eb5dfedb6b don't expect set/get title symbols are always there 2015-03-18 20:50:54 +01:00
Xinchen Hui
fc33f52d8c bump year 2015-01-15 23:27:30 +08:00
Stanislav Malyshev
b7a7b1a624 trailing whitespace removal 2015-01-10 15:07:38 -08:00
Anatol Belski
96805364fa fix var declaration used by macro conditions 2014-11-10 23:30:15 +01:00
Anatol Belski
5ad7cad103 fix sprintf spec 2014-11-10 23:30:15 +01:00
Anatol Belski
3942ed52be fix compilation warning 2014-10-10 19:00:17 +02:00
Anatol Belski
9873cc29c1 fix format 2014-09-14 23:10:41 +02:00
Xinchen Hui
c081ce628f Bump year 2014-01-03 11:08:10 +08:00
Nuno Lopes
1a71bf646e leave a sane environment behind (even if empty) when exiting
some OS atexit() handlers call getenv()
2013-04-07 02:32:20 -04:00
Xinchen Hui
bed44e562e missed part of the patch 2013-03-29 23:47:46 +08:00
Xinchen Hui
953f07503a Fixed bug #64544 (Valgrind warnings after using putenv)
The frozen_envion is needed, since if an item in environ is updated
(like the test script HOME one), invalid free still shows up
2013-03-29 23:42:50 +08:00
Keyur Govande
5bf6323e51 Patch for Bug #64544.
The process title change module keeps track of the locally allocated
environ, so it doesn't need to worry about when environ changes
underneath it, for example by putenv()/setenv()
2013-03-29 14:27:36 +00:00
Keyur Govande
a0a995cff3 Support for CLI process title (https://wiki.php.net/rfc/cli_process_title)
A new commit into branch 5.5
2013-03-07 18:54:34 +00:00