FreeBSD Bugzilla – Attachment 152624 Details for
Bug 197376
lang/python27: random module leaks file descriptor into child process
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
leaked fd test program from LLDB test suite
main.c (text/x-csrc), 581 bytes, created by
Ed Maste
on 2015-02-06 16:35:46 UTC
(
hide
)
Description:
leaked fd test program from LLDB test suite
Filename:
MIME Type:
Creator:
Ed Maste
Created:
2015-02-06 16:35:46 UTC
Size:
581 bytes
patch
obsolete
>#include <sys/types.h> >#include <sys/stat.h> >#include <unistd.h> >#include <errno.h> >#include <stdio.h> > >int >main (int argc, char const **argv) >{ > struct stat buf; > int i, rv = 0; > > // Make sure stdin/stdout/stderr exist. > for (i = 0; i <= 2; ++i) { > if (fstat(i, &buf) != 0) > return 1; > } > > // Make sure no other file descriptors are open. > for (i = 3; i <= 256; ++i) { > if (fstat(i, &buf) == 0 || errno != EBADF) { > fprintf(stderr, "File descriptor %d is open.\n", i); > rv = 2; > } > } > > return rv; >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 197376
: 152624