procps/procps-v3.3.3-watch.patch
2012-06-04 15:02:16 +00:00

79 lines
2.0 KiB
Diff

--- watch.c
+++ watch.c 2012-06-04 15:13:19.484011000 +0200
@@ -53,6 +53,7 @@
#include <unistd.h>
#ifdef WITH_WATCH8BIT
# include <wchar.h>
+# include <wctype.h>
# include <ncursesw/ncurses.h>
#else
# include <ncurses.h>
@@ -296,7 +297,11 @@ wint_t my_getwc(FILE * s)
}
#endif /* WITH_WATCH8BIT */
+#ifdef WITH_WATCH8BIT
+void output_header(wchar_t *restrict wcommand, int wcommand_columns, int wcommand_characters, double interval)
+#else
void output_header(char *restrict command, double interval)
+#endif /* WITH_WATCH8BIT */
{
time_t t = time(NULL);
char *ts = ctime(&t);
@@ -434,8 +439,8 @@ int run_command(char *restrict command,
c = carry;
carry = WEOF;
}
- } while (c != WEOF && !isprint(c)
- && c < 12
+ } while (c != WEOF && !iswprint(c)
+ && c < 128
&& wcwidth(c) == 0
&& c != L'\n'
&& c != L'\t'
@@ -718,7 +723,11 @@ int main(int argc, char *argv[])
}
if (show_title)
+#ifdef WITH_WATCH8BIT
+ output_header(wcommand, wcommand_columns, wcommand_characters, interval);
+#else
output_header(command, interval);
+#endif /* WITH_WATCH8BIT */
if (run_command(command, command_argv))
break;
--- skill.c
+++ skill.c 2012-06-04 13:28:45.700010498 +0000
@@ -98,7 +98,8 @@ static void hurt_proc(int tty, int uid,
fprintf(stderr, "%-8s %-8s %5d %-16.16s ? ",
(char *)dn_buf, user_from_uid(uid), pid, cmd);
fflush (stdout);
- getline(&buf, &len, stdin);
+ if (getline(&buf, &len, stdin) == -1)
+ return;
if (rpmatch(buf) < 1) {
free(buf);
return;
--- configure.ac
+++ configure.ac 2012-06-04 13:33:19.308509976 +0000
@@ -125,7 +125,7 @@ AC_CHECK_FUNCS([\
wcwidth
])
-usrbin_execdir='${exec_prefix}/usr/bin'
+usrbin_execdir='${exec_prefix}/bin'
AC_SUBST([usrbin_execdir])
AM_GNU_GETTEXT_VERSION([0.14.1])
--- proc/libprocps.sym
+++ proc/libprocps.sym 2012-06-04 15:01:39.280509970 +0000
@@ -11,6 +11,7 @@ global:
escaped_copy;
free_slabinfo;
get_pid_digits;
+ get_proc_stats;
get_slabinfo;
getbtime;
getdiskstat;