Commit Graph

492 Commits

Author SHA1 Message Date
Klemens David Morgenstern
42fbbbd8a6 Merge branch 'develop' of github.com:klemens-morgenstern/boost-process into develop 2018-09-27 10:02:01 +07:00
Klemens David Morgenstern
dd0b26de4c closes #180 2018-09-27 10:00:29 +07:00
Klemens Morgenstern
10665bfaff
Merge pull request #181 from krwalker/fix-vc-c4458-warnings
Fix warnings: decl. of 'x' hides class member
2018-09-27 09:55:41 +07:00
K. R. Walker
2576ed166f Fix warnings: decl. of 'x' hides class member
Address C4458 warnings when compiled with Visual C++
2018-09-26 16:54:46 -06:00
Klemens Morgenstern
57e9dfb705
Merge pull request #179 from klemens-morgenstern/develop
Update for master
2018-09-26 13:50:47 +07:00
Klemens David Morgenstern
4fd8887601 fixed group wait-for on windows 2018-09-26 11:50:18 +07:00
Lemmy
3cf4bf6480 Hope fully fixed group waiting 2018-09-25 17:32:32 +02:00
Lemmy
6ba8e88def wait-group fix 2018-09-25 11:45:04 +02:00
Lemmy
0938103427 Reworked wait_for_exit, concerns #99 and #112 2018-09-25 10:45:54 +02:00
Lemmy
e72127f9f8 Implemented proper wait_for for group_handles 2018-09-25 10:27:40 +02:00
Lemmy
eea73753b5 Fixed group wait in linux 2018-09-25 07:40:07 +02:00
Klemens David Morgenstern
4f3b425073 fixed group-wait, finally 2018-09-25 02:37:51 +07:00
Klemens David Morgenstern
dcb8a0266a preserving creation_flags, closes #176 2018-09-24 23:42:53 +07:00
Klemens David Morgenstern
99285a9de6 fixed windows-h variant 2018-09-24 23:27:01 +07:00
Klemens David Morgenstern
6cc31b93d8 readded BOOST_WINAPI_WINAPI_CC 2018-09-24 23:10:33 +07:00
Klemens David Morgenstern
d1ce19d848 fixes #178 2018-09-21 10:48:03 +07:00
Klemens David Morgenstern
8d2bd87707 ALternative (typeless) implementation of #177 2018-08-29 09:37:07 +08:00
Klemens David Morgenstern
44162ecf22 removed errornous noexcept 2018-06-19 18:34:39 +08:00
Klemens David Morgenstern
9549ffe7e1 capture list fix 2018-05-27 11:39:56 +02:00
Klemens David Morgenstern
dd0edb4aee Merge branch 'develop' of github.com:klemens-morgenstern/boost-process into develop 2018-05-26 22:07:15 +02:00
Klemens David Morgenstern
3029f4623a closes #41 2018-05-26 22:06:54 +02:00
Klemens David Morgenstern
74606db379 Merge branch 'bugfixing' into develop 2018-05-26 22:00:12 +02:00
Klemens David Morgenstern
81803868a3 closes #45 2018-05-26 21:59:58 +02:00
Klemens David Morgenstern
eff42f91ef closes #42 2018-05-26 21:57:25 +02:00
Klemens David Morgenstern
a25b6ca35b closes #32 2018-05-26 21:55:07 +02:00
Klemens David Morgenstern
52f030a83c closes #167 2018-05-26 20:32:08 +02:00
Egor Pugin
9cc651bdeb
Add missing returns on windows side. 2018-05-09 20:09:32 +03:00
Tomasz Jonak
41b7e30c18 Add missing return to async_pipe::async_{read,write}_some 2018-05-04 14:03:54 +00:00
Klemens Morgenstern
35fda5aa6a
Update job_workaround.hpp 2018-04-05 20:12:51 +02:00
Klemens Morgenstern
d47b7f7ac4
Update job_workaround.hpp 2018-04-05 10:08:00 +02:00
Klemens David Morgenstern
c5798fdf7f added write_some and read_some overloads - closes #35 2018-03-13 10:11:01 +08:00
Klemens David Morgenstern
5e43e7c07c Merge branch 'develop' of github.com:boostorg/process into develop 2018-03-11 20:58:22 +01:00
Andrey Semashev
900aab5d6d Switched WINAPI calling convention macros to the replacements from Boost.WinAPI
WINAPI macro definition in Boost.WinAPI is deprecated as it may clash with
the macro defined in Windows SDK.
2018-03-11 20:20:49 +03:00
Alex Merry
6625999765 Check the "still running" status code does not clash with WIFSIGNALED
This makes the static_assert reflect the actual assumptions in the code.
2018-02-22 14:31:22 +00:00
Alex Merry
0d3688aca5 Ignore stopped processes
is_running should only concern itself with terminated processes, not
stopped processes (which might be continued later).
2018-02-22 14:12:46 +00:00
Klemens Morgenstern
40be786c43
Merge pull request #150 from amerry/async-exit-status
Return the same exit status in the async handler as the sync method
2018-02-22 13:43:06 +01:00
Klemens Morgenstern
d4a0444223
Merge pull request #147 from amerry/args
Always set arguments on POSIX
2018-02-22 13:05:33 +01:00
Alex Merry
ed32531369 Return the same exit status in the async handler as the sync method
Previously, if the process terminated via a signal on posix, the async
handler would provide an exit status of 0.
2018-02-22 11:53:42 +00:00
Alex Merry
8aaf53d76d Always set arguments on POSIX
Explicitly specifying an executable (either with boost::filesystem::path
or boost::process::exe) and no arguments causes NULL to be passed as the
argument list.

Not only is this unexpected behaviour for the child process (which
doesn't even have argv[0]), it is not portable across UNIX systems. From
the execve(2) man page on Linux:

"On Linux, either argv or envp can be specified as NULL, which has the
same effect as specifying these arguments as a pointer to a list
containing a single NULL pointer.  Do not take advantage of this
misfeature!  It is nonstandard and nonportable:  on  most other UNIX
systems doing this will result in an error (EFAULT)."
2018-02-21 15:43:32 +00:00
Alex Merry
92ee239891 Only reap children we are watching for when handling SIGCHLD
There may be other io_context instances with child instances, and child
instances with no associated io_context. If we pass 0 to ::waitpid(), we
will reap their processes as well, without updating the state of the
corresponding child instance.

Instead, we call `::waitpid` once for each child we are watching for.
This has some amount of overhead (multiple system calls), but ensures
correct behaviour (providing nothing other than an asio::signal_set is
watching for SIGCHLD).
2018-02-20 14:32:33 +00:00
Connor Lane Smith
a610fe74ff
Fix search_path not to return directories on POSIX 2018-02-14 13:56:34 +00:00
Markus Tillinger
a55946eb5d Fix: Inconsistent behaviour in various overloaded functions/methods #139
Removed duplicated code in overloaded functions.
Replaced system_clock with steady_clock.
2018-02-08 21:49:49 +01:00
Klemens David Morgenstern
60302c0017 Merge branch 'develop' of github.com:klemens-morgenstern/boost-process into develop 2018-02-06 20:20:18 +01:00
Klemens David Morgenstern
08eaf8b7a1 added BOOST_NO_ANSI_APIS support, closes #26 2018-02-06 20:20:02 +01:00
Klemens Morgenstern
cc70ec9362
Update pipe_in.hpp 2018-02-06 10:29:16 +01:00
Klemens Morgenstern
b58ecc7c9d
Update async_in.hpp 2018-02-06 10:27:16 +01:00
Klemens Morgenstern
668cbcdaf4
Update windows.hpp 2018-02-06 10:23:02 +01:00
Klemens David Morgenstern
6d7cbd0989 closes #83 2018-02-06 00:32:55 +01:00
Klemens David Morgenstern
0764f788a6 typo fix 2018-02-06 00:24:45 +01:00
Klemens David Morgenstern
2b95dd7011 Merge branch 'develop' of github.com:klemens-morgenstern/boost-process into develop 2018-02-06 00:08:26 +01:00
Klemens David Morgenstern
ae380c30ad added CREATE_NO_WINDOW flags, closes #129 2018-02-06 00:07:35 +01:00
Klemens Morgenstern
d2265890bd
Merge pull request #138 from markus-t314/consistent_wait_handling
Fixed inconsistent posix-wait-handling
2018-02-05 23:42:04 +01:00
Klemens Morgenstern
831d49c1b3
Merge pull request #137 from markus-t314/fix_issue136
Fix: [posix] inconsistent exit status when child received signal #136
2018-02-05 23:38:59 +01:00
Klemens Morgenstern
6935c53510
Merge pull request #132 from egorpugin/patch-1
Fix initialization of atomic var. This fixes mingw build.
2018-02-05 23:34:11 +01:00
Klemens David Morgenstern
f30d90a179 Merge remote-tracking branch 'remotes/boostorg/develop' into develop 2018-02-05 23:32:17 +01:00
Markus Tillinger
342554b3d8 Fixed inconsistent posix-wait-handling
Refactored: Removed duplicated code
Made wait_until compatible with steady_clock
2018-02-03 22:11:37 +01:00
Markus Tillinger
7aa812a0e1 Fix: [posix] inconsistent exit status when child received signal #136 2018-02-03 17:47:14 +01:00
hrayrbabajanyan
ba790dad0a
eval_exit_status would return 0 in case if the child received SIBABRT 2018-02-01 02:53:24 +04:00
Adrian Imboden
444d5eb702 fix use of uninitalized variable 2018-01-06 13:36:42 +01:00
Egor Pugin
3e12e989ab
Fix initialization of atomic var. This fixes mingw build. 2018-01-06 14:04:32 +03:00
Klemens Morgenstern
faf848bd8b
Merge pull request #125 from ca-l-eb/fixes
Fix async_pipe reassignment and child_decl
2017-11-05 15:39:13 -05:00
Caleb Dechant
d78c7901b3 Revert async_pipe dtor to original 2017-11-05 11:48:20 -08:00
Klemens Morgenstern
09e98d8746
Merge pull request #122 from egorpugin/develop
Fix multithreaded async pipes creation.
2017-11-05 13:47:56 -05:00
Egor Pugin
b268e0e1fb
Change atomic var to size_t. 2017-11-05 17:28:42 +03:00
Caleb Dechant
996f4b357c Fix child_decl's move constructor
The _terminated field is now copied from the moved child.
2017-11-04 17:25:00 -07:00
Caleb Dechant
8ce3e760dc Fix async_pipe move assignment and destructor
Simplify async_pipe's move assignment so it now properly closes the old
pipe handles by swapping the asio stream_descriptors.

Reassigning async_pipes previously raised exceptions complaining about
EBADF or EEXIST. I think the ::close calls in the destructor and the
move assignment were not closing the pipe correctly.
2017-11-04 17:22:15 -07:00
Caleb Dechant
337a6e3e83 Fix move assignment for child
_terminate field is now copied from the move assingment operator on
child. This fixes the issue that a child process could previously only
be terminated() once (even after reassignment).
2017-11-02 16:03:05 -07:00
klemens-morgenstern
b1f50e953b some additions attempted fixes for the windows part 2017-10-25 09:07:23 +02:00
klemens-morgenstern
852d8f3d9d renamed windows/io_service_ref.hpp 2017-10-24 23:54:58 +02:00
klemens-morgenstern
2c026e43a8 removed constness for gcc 4.8 2017-10-24 23:17:42 +02:00
klemens-morgenstern
51396227a0 renamed native() to native_handle() 2017-10-24 23:15:53 +02:00
klemens-morgenstern
75d3049199 Merge branch 'develop' of github.com:klemens-morgenstern/boost-process into develop 2017-10-24 22:36:48 +02:00
Klemens Morgenstern
3d9a8b2353 Merge pull request #22 from Lastique/update_winapi
Update Boost.WinAPI usage to the new location and namespace
2017-10-24 16:35:40 -04:00
Andrey Semashev
d9231d466c Updated Boost.WinAPI usage to the new location and namespace. 2017-10-24 23:27:56 +03:00
Christopher Kohlhoff
153e05eac0 Updates to compile against latest asio. 2017-10-23 21:23:44 +11:00
Klemens Morgenstern
883b6ac937 Merge pull request #15 from ganboing/develop
fix uninitialized variable and close(-1) behavior
2017-10-22 15:41:53 -04:00
Klemens Morgenstern
764fff1f65 Merge pull request #17 from gevorgvoskanyan/search_path_unused_var
remove unused variable in boost::process::detail::posix::search_path()
2017-10-22 15:35:58 -04:00
Gevorg Voskanyan
6adf1bf545 fix param path comment for search_path() 2017-10-22 23:20:02 +04:00
Gevorg Voskanyan
126659f2f9 remove unused variable in boost::process::detail::posix::search_path() 2017-10-22 22:50:45 +04:00
Gevorg Voskanyan
63952fa2a6 s/seperated/separated 2017-10-22 22:20:27 +04:00
Bo Gan
2f00162817 fix uninitialized variable and close(-1) behavior 2017-09-12 12:37:20 -07:00
Egor Pugin
c2602e86e9 Make counter 64 bits. 2017-08-29 14:20:51 +03:00
Egor Pugin
e2a2a57820 Fix multithreaded async pipes creation. 2017-08-29 14:19:21 +03:00
Klemens Morgenstern
547c04fc1f Updated vfork check 2017-08-22 22:02:48 +02:00
Klemens Morgenstern
79e26878b1 Strange typo fix
Trying to fix #118
2017-08-22 18:24:53 +02:00
sehe
3ab038fc0f fix rdbuf() implementation on pipe 2017-08-22 09:56:44 +02:00
Klemens Morgenstern
66989a25f2 Update wait_group.hpp 2017-08-02 22:23:09 +02:00
klemens-morgenstern
054d7980ab hopefully closes #106 2017-08-02 21:08:33 +02:00
Klemens Morgenstern
4c6b0fff2a Merge pull request #115 from klemens-morgenstern/sigchld_service
Sigchld service
2017-08-02 13:50:09 +02:00
Klemens Morgenstern
449eef0b98 Update async.hpp 2017-08-02 09:37:06 +02:00
Klemens Morgenstern
264b517b38 Update async.hpp 2017-08-02 09:35:41 +02:00
klemens-morgenstern
aeee4e5dbb windows wait_for fix 2017-08-02 08:31:30 +02:00
Klemens David Morgenstern
e08e095fd1 WEXITSTATUS fix 2017-08-02 01:52:58 -04:00
Klemens David Morgenstern
da34b4020d Trying to get the sigchld-service to work 2017-08-01 18:41:55 -04:00
Klemens David Morgenstern
99001ccb50 Fixed wait_for & wait_until, closes #11 2017-08-01 18:00:44 -04:00
klemens-morgenstern
f402f48138 started on sigchld_service.hpp 2017-08-01 20:58:09 +02:00
klemens-morgenstern
1960360099 typo fixes 2017-08-01 20:07:22 +02:00
klemens-morgenstern
83019b5f70 started on the wait for fix for posix 2017-08-01 19:35:55 +02:00
Klemens Morgenstern
15445fd2bf Merge pull request #110 from thomasschaub/develop
Respect WIFSIGNALED in all relevant places
2017-07-25 20:27:13 +02:00
Thomas Schaub
062b26e046 Avoid string charset conversion 2017-07-25 18:12:13 +02:00
Thomas Schaub
bb0fe86292 Respect WIFSIGNALED in all relevant places
Was only respected for one `waitpid` call
2017-07-25 18:01:53 +02:00
Egor Pugin
3e31d43d61 Fix access rights. 2017-07-24 00:27:17 +03:00
Klemens Morgenstern
085adc07ec Merge pull request #12 from egorpugin/develop
Fix incorrect on_exit() callback called on any child exited.
2017-07-23 23:18:39 +02:00
Egor Pugin
8df9c467e5 Fix incorrect on_exit() callback called on any child exited. 2017-07-24 00:10:30 +03:00
Thomas Schaub
529d09f43b Respect WIFSIGNALED 2017-07-19 12:00:44 +02:00
klemens-morgenstern
74dd6570e3 small fixes, closes #97 2017-05-07 12:44:38 +02:00
klemens-morgenstern
826177a12e Merge branch 'develop' of github.com:boostorg/process into develop
# Conflicts:
#	include/boost/process/detail/windows/search_path.hpp
2017-05-01 10:56:24 +02:00
Takeshi Abe
6a64b9e0bd Allow const char * as throw_last_error()'s argument 2017-05-01 17:29:35 +09:00
klemens-morgenstern
ae2b0a9024 removed tabs 2017-04-23 19:16:39 +02:00
klemens-morgenstern
712ebf772b changed search_path to use PATHEXT on windows, closes #91 2017-04-23 19:14:18 +02:00
klemens-morgenstern
7a99be71d3 tab fix 2017-04-23 17:46:18 +02:00
klemens-morgenstern
210efd8dc5 Merge branch 'async-pipe-fix' into develop 2017-04-23 17:43:42 +02:00
klemens-morgenstern
a25665aeff removed merge error 2017-04-23 17:29:12 +02:00
klemens-morgenstern
ee4428c226 Merge branch 'whitespaces' into develop
# Conflicts:
#	include/boost/process/io.hpp
2017-04-23 17:28:35 +02:00
klemens-morgenstern
74814e46c1 closes #90 2017-04-23 15:09:39 +02:00
klemens-morgenstern
007dd97486 added pid_t typedef, closes #82 2017-04-23 15:03:50 +02:00
klemens-morgenstern
f0082aa797 closes #89 2017-04-23 14:54:46 +02:00
klemens-morgenstern
ba14d9f870 Normalize all the line endings 2017-04-23 14:48:16 +02:00
Jarda
1ac22670c7 Fix extension adding 2017-04-05 11:24:18 +02:00
klemens-morgenstern
9cab8d455a Updated environment reset on windows 2017-03-19 18:04:38 +01:00
Klemens Morgenstern
f1bd81d56e Merge pull request #79 from ChrisKitching/moreWarnings
Fix some more warnings...
2017-03-17 19:13:24 +01:00
Chris Kitching
28dc0c8830
Repair more Wunused warnings 2017-03-17 17:39:33 +00:00
Chris Kitching
7e217fe012
Stop using mixed line-endings... 2017-03-17 17:39:05 +00:00
Klemens Morgenstern
04063ee076 compile fix for async_pipe 2017-03-16 20:19:25 +01:00
klemens-morgenstern
64bf929094 closes #78 2017-03-16 16:40:52 +01:00
klemens-morgenstern
18ab3ae8c1 fixed async_pipe to pipe conversion 2017-03-16 16:40:13 +01:00
klemens-morgenstern
6c63771ca9 fixed environment on windows 2017-03-16 12:18:47 +01:00
klemens-morgenstern
3a733827eb closes #74 2017-03-16 10:41:51 +01:00
klemens-morgenstern
226b3bd1fc added broken note to group 2017-03-16 10:19:24 +01:00
Klemens Morgenstern
158565dbef Merge pull request #76 from ChrisKitching/warnings
Silence a variety of warnings that spam users of the library
2017-03-16 10:18:01 +01:00
Klemens Morgenstern
a410059f6b Native environment fixes 2017-03-16 10:05:04 +01:00
Chris Kitching
3cf5cf49e3
Silence a Wmissing-braces warning 2017-03-15 17:09:27 +00:00
Chris Kitching
deb6af4b2b
Suppress many Wunused warnings 2017-03-15 16:47:30 +00:00
Chris Kitching
b784a5b3cf
Zero-initialise avoiding subelement bracing warnings 2017-03-15 16:34:49 +00:00
Chris Kitching
f74523503d
Avoid unused-argument warning on Windows 2017-03-15 16:29:20 +00:00
Andrew Naumov
aa048edd69 fix is_wchar_t<start_dir_init<wchar_t>> 2017-03-14 22:49:10 +03:00
klemens-morgenstern
b15530152a added tests for environment (clear / erase) 2017-03-12 22:34:00 +01:00
Klemens Morgenstern
94f87c4615 Merge pull request #69 from andrejnau/add_conv_for_env
add char_converter for basic_environment
2017-03-11 22:06:07 +01:00
Andrew Naumov
ba5a6bfcf1 add char_converter for basic_environment 2017-03-11 23:10:54 +03:00
Andrew Naumov
054bdc47c1 fix is_wchar_t<wchar_t*> 2017-03-11 10:29:24 +03:00
klemens-morgenstern
843e56ec1a minor cleanup 2017-03-02 00:16:05 +01:00
Klemens Morgenstern
f18b585740 Implemented and tested execvpe 2017-03-01 22:39:18 +01:00
klemens-morgenstern
87027b2176 typo fix 2017-03-01 16:22:54 +01:00
klemens-morgenstern
e4a3d459c5 changed string to native 2017-02-28 21:39:43 +01:00
klemens-morgenstern
4d6e802fca replaced tabs with spaces 2017-02-28 21:28:42 +01:00
klemens-morgenstern
2f6e83b4e4 type fix 2017-02-28 21:22:59 +01:00
klemens-morgenstern
da42203fef typo fix 2017-02-28 21:14:16 +01:00
klemens-morgenstern
87cbedccd8 changed to correct search_path function 2017-02-28 18:55:43 +01:00
klemens-morgenstern
d561667301 removed unneeded const 2017-02-28 18:53:42 +01:00
klemens-morgenstern
9cfab7e19c attempted const fix 2017-02-28 17:17:24 +01:00