Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3408)

Issue 110042: rc: make Read not ignore interrupts/errors (again)

Can't Edit
Can't Publish+Mail
Start Review
Created:
14 years, 8 months ago by knieriem
Modified:
8 years, 7 months ago
Reviewers:
Visibility:
Public.

Description

Rc normally allows to interrupt unfinished commands, like a command with an open { or ' character (sometimes created without intention due to unbalanced delimiters). If an interrupt signal is issued on one of the next lines after writing e.g. % echo ' this should exit from the quoting block, and print a line like rc: /dev/stdin: token EOF: syntax error. Starting with rev 2474 this doesn't work anymore, as the new readnb function, which takes care of nonblocked fds, accidentally suppresses a return value of -1, which was possible before and resulted in the EOF token. The patch restructures the loop, so that normal errors, i.e. errors different from EAGAIN, won't go unnoticed. Perhaps the `goto' is not ok in terms of style, but it seems that here it makes it clearer that in the normal case it won't loop again, only in case of errno==EGAIN.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+7 lines, -2 lines) Patch
M src/cmd/rc/unixcrap.c View 2 chunks +7 lines, -2 lines 0 comments Download

Messages

Total messages: 3
knieriem
14 years, 8 months ago (2009-08-18 21:23:00 UTC) #1
russcox_gmail.com
thanks for fixing this. codebot: apply rc: make read not ignore interrupts/errors (again)
14 years, 8 months ago (2009-08-23 17:24:27 UTC) #2
old.codebot
14 years, 8 months ago (2009-08-23 17:25:44 UTC) #3
# codebot: apply

applied.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b