Path: csiph.com!4.us.feeder.erje.net!feeder.erje.net!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail From: Bize Ma Newsgroups: gnu.bash.bug Subject: Re: write() not retried after EINTR in printf and echo Date: Wed, 19 Dec 2018 22:15:27 -0500 Lines: 23 Approved: bug-bash@gnu.org Message-ID: References: NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: usenet.stanford.edu 1545275743 18540 208.118.235.17 (20 Dec 2018 03:15:43 GMT) X-Complaints-To: action@cs.stanford.edu Cc: bug-bash To: Chester Ramey Envelope-to: bug-bash@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=M8Vek0as1NK73jWZaHlnRz2RxZqM750Wu/kHIF19Vu0=; b=JN5rXrpJvHphh0uvgM45hvg+2m+ARVIV8611cN6lbr2XjPkwDaMc9Nwa0rmrP9lEpw HpYYzSDCz+LHGw22rfSeBwflJIUKA6iopxww2cDwAy/+HLN3otKXkD9yExpHj8BQq44T 3P2b9SKaLbPZK3SwSYxFYI1OGniXllouuxi44aS6ZJVnxHUQj81fMAiVM4xv1rKFVoXc Wgc9UouZOYIohwHpArvKO/moBGO6CEFVpz8x2U5jm1Q1UtBi/VMxMYJtn/ttLAKA9lDl eUWs6TG4ebMgbr/Ut2bEvU/+/BkxUcj6W8fpH5KAj2+l+b60j0GLjZlostBZmvNcI+wA 3cag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=M8Vek0as1NK73jWZaHlnRz2RxZqM750Wu/kHIF19Vu0=; b=M5lObHLFOepxLfhitQFQqCwSJZaQ6UvY/BHBjAccjiEXnQpAfsCB5c5WxmnZ/cQLRL 55TxwBt5pmynLULxQzEsDkA8ubk25zUXCtoS6/OSz2nFJaxxCcHaa+okq/FmY72Nt6iG YMCFXZFCQFyhdaKI9Z+aY0CcTkzrgUx571cWoVzOo4JtE6xo6aP9GvlpBrivLRw1i0uG 470IdiTQ4+T5AzwablhVEt97dt12hqR/Ej3p9wsm2MfdcIU3Lj73TrBk0SpYd7JCXVEu dxzxAPf/fxRSa1/+8K5skcZbxKbmDzQL93j86nX6zHC9tPn1G+aH4ruYrMCNkB/Cf3tP k81Q== X-Gm-Message-State: AA+aEWYcoNoi8Wm2S2MyJbnzpsCLS1160HBb6+0QVXeSM0xwUjPCteVU D7P6DnT0fbT03K0aujBEzHbBL7uvoIfBlweLIgc= X-Google-Smtp-Source: AFSGD/UmFG43A2bmMJPD4lGYDT4B0JZ5+VfmBIiSkSYox7VQJ5ujDUOtufWrp6dxUtLYEk2PsZPrymfMrpVQLxMAWDM= X-Received: by 2002:a9d:17c6:: with SMTP id j64mr17350566otj.357.1545275739801; Wed, 19 Dec 2018 19:15:39 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::32e X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com gnu.bash.bug:14930 Chet Ramey () wrote: > And yet, when you look at the source, the signal handlers are installed > with SA_RESTART. For example, > > # if defined (SIGWINCH) > act.sa_flags = (sig == SIGWINCH) ? SA_RESTART : 0; > # else > act.sa_flags = 0; > # endif /* SIGWINCH */ > > in lib/readline/signals.c:rl_set_sighandler(). > > True for SIGWINCH, but "write error: Interrupted system call" is still exposed to users (which it shouldn't) for other signals: { pid=$BASHPID; trap : USR1; (sleep 1; kill -USR1 "$pid") & printf %0100000d 1; } | sleep 20