[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Ludovic Courtès |
Date: |
Sat, 15 Jul 2023 11:37:30 -0400 (EDT) |
branch: master
commit c4a97c155bf187e624c39b71902936012dc7e775
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Sat Jul 15 16:34:06 2023 +0200
'non-blocking-port' avoids 'F_SETFL' call when unneeded.
* src/cuirass/base.scm (non-blocking-port): Avoid second 'fcntl' call
when FLAGS already includes O_NONBLOCK.
---
src/cuirass/base.scm | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/cuirass/base.scm b/src/cuirass/base.scm
index 983383b..87dced7 100644
--- a/src/cuirass/base.scm
+++ b/src/cuirass/base.scm
@@ -187,7 +187,8 @@ any."
(define (non-blocking-port port)
"Make PORT non-blocking and return it."
(let ((flags (fcntl port F_GETFL)))
- (fcntl port F_SETFL (logior O_NONBLOCK flags))
+ (when (zero? (logand O_NONBLOCK flags))
+ (fcntl port F_SETFL (logior O_NONBLOCK flags)))
port))
(define %cuirass-state-directory
- master updated (17a306a -> ee8b6b2), Ludovic Courtès, 2023/07/15
- [no subject], Ludovic Courtès, 2023/07/15
- [no subject], Ludovic Courtès, 2023/07/15
- [no subject], Ludovic Courtès, 2023/07/15
- [no subject], Ludovic Courtès, 2023/07/15
- [no subject],
Ludovic Courtès <=
- [no subject], Ludovic Courtès, 2023/07/15
- [no subject], Ludovic Courtès, 2023/07/15
- [no subject], Ludovic Courtès, 2023/07/15
- [no subject], Ludovic Courtès, 2023/07/15