GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — zlib: do not hang archiving a FIFO or device · nodejs/node@2bda6db

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib/internal/zip
    • archive.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/internal/zip/archive.js‎

Copy file name to clipboardExpand all lines: lib/internal/zip/archive.js
+7-4Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,15 @@ async function* fileEntries(files, followSymlinks) {
133133
// would let a symlink swapped in after the classification above redirect
134134
// the read - a TOCTOU that defeats followSymlinks:false. O_NOFOLLOW makes
135135
// a final-component symlink fail the open outright when not following;
136-
// the fstat then confirms a regular file, never a FIFO, device, or
137-
// socket (which as a stream source could block or emit unbounded data).
136+
// O_NONBLOCK keeps the open itself from blocking on a FIFO or a slow
137+
// device (it has no effect on a regular file's reads), so the fstat can
138+
// then reject anything that is not a regular file - a FIFO, device, or
139+
// socket, which as a stream source could block or emit unbounded data.
138140
// Metadata comes from that same fstat so it describes the inode we read.
139-
const flags = followSymlinks ?
141+
const flags = (followSymlinks ?
140142
fs.constants.O_RDONLY :
141-
fs.constants.O_RDONLY | (fs.constants.O_NOFOLLOW || 0);
143+
fs.constants.O_RDONLY | (fs.constants.O_NOFOLLOW || 0)) |
144+
(fs.constants.O_NONBLOCK || 0);
142145
const handle = await fs.promises.open(sourcePath, flags);
143146
let ownsHandle = true;
144147
try {

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.