# HG changeset patch # User Paul Boddie # Date 1702342006 -3600 # Node ID 3757bedaf79e88ebe9c2e3698be0d79a60dfa90c # Parent 7c8ba245fbba6014b6edf85b051ff85c862cdaf1 Discard pipe endpoints to ensure that notifications are issued. diff -r 7c8ba245fbba -r 3757bedaf79e libexec/lib/src/process_creating.cc --- a/libexec/lib/src/process_creating.cc Mon Dec 11 19:23:39 2023 +0100 +++ b/libexec/lib/src/process_creating.cc Tue Dec 12 01:46:46 2023 +0100 @@ -451,6 +451,10 @@ long err = _start(argc, argv, writer, process); + /* Discard the writer since it will not be used in this task. */ + + ipc_cap_free_um(writer); + /* Communicate the error using the signal value. */ if (err) diff -r 7c8ba245fbba -r 3757bedaf79e test_files/programs/dstest_exec_payload.c --- a/test_files/programs/dstest_exec_payload.c Mon Dec 11 19:23:39 2023 +0100 +++ b/test_files/programs/dstest_exec_payload.c Tue Dec 12 01:46:46 2023 +0100 @@ -52,6 +52,7 @@ client_write(output, "Terminating.\n", 13); client_flush(output); + client_close(output); return 0; } diff -r 7c8ba245fbba -r 3757bedaf79e tests/dstest_exec.cc --- a/tests/dstest_exec.cc Mon Dec 11 19:23:39 2023 +0100 +++ b/tests/dstest_exec.cc Tue Dec 12 01:46:46 2023 +0100 @@ -78,6 +78,10 @@ printf("Finished program initiation.\n"); + /* Release the writing end of the pipe. */ + + client_close(writer); + /* Wait for a signal from the process or input from the process. */ err = notify_subscribe(process_notifiable(process), NOTIFY_TASK_ALL, notifier); @@ -124,6 +128,7 @@ notify_values_t values = process_notification_values(process); printf("End process (flags %" pFMTnotify_flags "x values: %ld, %ld)\n", flags, values.sig, values.val); + printf("End reader (flags %" pFMTnotify_flags "x)\n", file_notifications(reader)); err = process_error(process);