From 69956d6d52578e6c3726acf1d0559d23ed742b39 Mon Sep 17 00:00:00 2001 From: Craig Small Date: Mon, 26 Aug 2002 10:05:18 +0000 Subject: [PATCH] hitting enter in fuser means no --- ChangeLog | 3 +++ doc/killall.1 | 5 ++--- src/fuser.c | 27 +++++++++++++-------------- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index 66b3367..56a4207 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,11 @@ Changes in 21.1 =============== +2002-08-19 + * Changed killall.1 to be less ambigous, Debian #127851 2002-08-18 * Added patches from James Morrison so it works on Hurd * Fixed UTF8 Problem. closes Debian #140960 + * Return for fuser -k will mean no. 2002-08-17 * Now has LFS support. Closes Debian #129157 and #156017 diff --git a/doc/killall.1 b/doc/killall.1 index c11799f..2e1621e 100644 --- a/doc/killall.1 +++ b/doc/killall.1 @@ -33,9 +33,8 @@ Signals can be specified either by name (e.g. \fB\-HUP\fP) or by number If the command name contains a slash (\fB/\fP), processes executing that particular file will be selected for killing, independent of their name. .PP -\fBkillall\fP returns a non-zero return code if no process has been killed -for any of the listed commands. If at least one process has been killed for -each command, \fBkillall\fP returns zero. +\fBkillall\fP returns a zero return code if at least one process has been +killed for each ilisted command. \fBkillall\fP returns zero otherwise. .PP A \fBkillall\fP process never kills itself (but may kill other \fBkillall\fP processes). diff --git a/src/fuser.c b/src/fuser.c index c6998a0..bc88ac8 100644 --- a/src/fuser.c +++ b/src/fuser.c @@ -586,20 +586,19 @@ ask (pid_t pid) int ch, c; fflush (stdout); - do - { - fprintf (stderr, _("Kill process %d ? (y/n) "), pid); - fflush (stderr); - do - if ((ch = getchar ()) == EOF) - exit (0); - while (ch == '\n' || ch == '\t' || ch == ' '); - do - if ((c = getchar ()) == EOF) - exit (0); - while (c != '\n'); - } - while (ch != 'y' && ch != 'n' && ch != 'Y' && ch != 'N'); + do { + fprintf (stderr, _("Kill process %d ? (y/n) "), pid); + fflush (stderr); + do { + if ((ch = getchar ()) == EOF) + exit (0); + if (ch == '\n') return 0; + } while (ch == '\t' || ch == ' '); + do + if ((c = getchar ()) == EOF) + exit (0); + while (c != '\n'); + } while (ch != '\n' && ch != 'y' && ch != 'n' && ch != 'Y' && ch != 'N'); return ch == 'y' || ch == 'Y'; } -- 2.40.0