GNU bug report logs -
#71980
[3.0.10] posix.test uses depcrecated tmpnam
Previous Next
Reported by: Matt Wette <matt.wette <at> gmail.com>
Date: Sun, 7 Jul 2024 16:28:02 UTC
Severity: normal
Done: Ludovic Courtès <ludo <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
With `--disable-tmpnam' argument to configure, posix.test fails:
missing `tmpnam`.
patch attached
--- test-suite/tests/posix.test-orig 2024-07-03 15:45:16.352132881 -0700
+++ test-suite/tests/posix.test 2024-07-07 09:21:53.342855356 -0700
@@ -361,20 +361,21 @@
(status:exit-val (system* "something-that-does-not-exist"))))
(pass-if-equal "https://bugs.gnu.org/52835"
- "bong\n"
- (let ((file (tmpnam)))
+ "bong\n"
+ (let ((port (mkstemp "T-XXXXXX")))
;; Redirect stdout and stderr to FILE.
(define status
- (call-with-output-file file
- (lambda (port)
- (with-output-to-port port
+ (with-output-to-port port
+ (lambda ()
+ (with-error-to-port port
(lambda ()
- (with-error-to-port port
- (lambda ()
- (system* "sh" "-c" "echo bong >&2"))))))))
+ (system* "sh" "-c" "echo bong >&2"))))))
(and (zero? (status:exit-val status))
- (call-with-input-file file get-string-all))))
+ (zero? (seek port 0 SEEK_SET))
+ (let ((contents (get-string-all port)))
+ (close-port port)
+ contents))))
(pass-if-equal "https://bugs.gnu.org/63024"
0
[PATCH (text/plain, attachment)]
This bug report was last modified 269 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.