public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Cygwin 3.3.6: PHP's SplFileObject::fwrite seems broken
@ 2022-10-02  1:47 Hans Henrik Bergan
  2022-10-02  5:16 ` Hans Henrik Bergan
  0 siblings, 1 reply; 7+ messages in thread
From: Hans Henrik Bergan @ 2022-10-02  1:47 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 578 bytes --]

running PHP 7.3.7 in Cygwin 3.3.6, and SplFileObject::fwrite seems
completely broken.
to reproduce:
$ touch bug.txt; chmod 0777 bug.txt; php -r '$o=new
SplFileObject("bug.txt");var_dump($o->fwrite("test"));var_dump(error_get_last());'
int(0)
NULL

so both fwrite() and error_get_last() failed to pick up that there was an
error,
but strace reveals:
67 487251 [main] php 1693 __set_errno: ssize_t write(int, const void*,
size_t):1350 setting errno 9
60 487311 [main] php 1693 write: -1 = write(3, 0x6FFFFFE65BF8, 4), errno 9

errno 9 probably means: 9 EBADF Bad file descriptor.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-10-08 17:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-02  1:47 Cygwin 3.3.6: PHP's SplFileObject::fwrite seems broken Hans Henrik Bergan
2022-10-02  5:16 ` Hans Henrik Bergan
2022-10-02  0:39   ` Ken Brown
2022-10-02 13:58     ` Andrey Repin
2022-10-02 13:49   ` Andrey Repin
2022-10-03 16:59     ` Hans Henrik Bergan
2022-10-08 17:21       ` Ken Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).