commit:     f1a84b73bda0e324e8fec7dfdb17775af4b54ccd
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Nov  7 19:39:08 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Nov  7 19:39:08 2025 +0000
URL:        https://gitweb.gentoo.org/proj/steve.git/commit/?id=f1a84b73

Use plain Python API for blocking writes

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 steve.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/steve.py b/steve.py
index 44bc4df..241e8d9 100755
--- a/steve.py
+++ b/steve.py
@@ -64,12 +64,13 @@ def main() -> None:
     os.mkfifo(args.path)
     try:
         _ = os.open(args.path, os.O_RDONLY | os.O_NONBLOCK)
-        write_fd = os.open(args.path, os.O_WRONLY)
+        job_file = args.path.open("wb")
         if args.control_fifo is not None:
             print(f"Waiting for clients to open {args.control_fifo}")
             control_file = args.control_fifo.open("rb")
 
-        os.write(write_fd, b"." * args.jobs)
+        job_file.write(b"." * args.jobs)
+        job_file.flush()
 
         print(f"Started for {args.jobs} jobs")
         print(f'MAKEFLAGS="--jobserver-auth=fifo:{args.path}"')

Reply via email to