ALT Linux Team development discussions
 help / color / mirror / Atom feed
* [devel] procps.git
@ 2006-09-14  0:51 Alexey Tourbin
  2006-09-14  1:06 ` Dmitry V. Levin
                   ` (3 more replies)
  0 siblings, 4 replies; 18+ messages in thread
From: Alexey Tourbin @ 2006-09-14  0:51 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 2348 bytes --]

И чо, я сделал патч к procps, куда его теперь коммитить?
В /people/ldv/packages/procps.git писать не дают, а куда тогда?

$ git-push --all git.alt:/people/ldv/packages/procps.git
updating 'refs/heads/master'
  from 25366cd4b1691a887e135a58ab894dff6cbae560
  to   64ef9663bc217c76ee80007a8cda189a3c7e6919
updating 'refs/heads/origin'
  from 0000000000000000000000000000000000000000
  to   25366cd4b1691a887e135a58ab894dff6cbae560
Generating pack...
Done counting 7 objects.
Result has 4 objects.
Deltifying 4 objects.
 100% (4/4) done
Total 4, written 4 (delta 3), reused 0 (delta 0)
Unpacking 4 objects
unable to create temporary sha1 filename ./objects/obj_aObEAo: Permission denied
fatal: failed to write object
unpack unpacker exited with error code
ng refs/heads/master n/a (unpacker error)
ng refs/heads/origin n/a (unpacker error)
$ git-log -p --max-count=1
commit 64ef9663bc217c76ee80007a8cda189a3c7e6919
Author: Alexey Tourbin <at@localhost.localdomain>
Date:   Thu Sep 14 04:42:46 2006 +0400

    Implement the following behaviour:
    
    1) execute a program also when a key is pressed;
    2) but if that key is 'q' then exit instead.
    
    This makes watch look more like an interactive program.

diff --git a/procps/watch.c b/procps/watch.c
index 18ded5e..4abad74 100644
--- a/procps/watch.c
+++ b/procps/watch.c
@@ -20,6 +20,7 @@ #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <sys/ioctl.h>
+#include <sys/select.h>
 #include <time.h>
 #include <unistd.h>
 #include <locale.h>
@@ -227,6 +228,7 @@ main(int argc, char *argv[])
 	nonl();
 	noecho();
 	cbreak();
+	nodelay(stdscr, TRUE);
 
 	for (;;) {
 		time_t t = time(NULL);
@@ -236,6 +238,10 @@ main(int argc, char *argv[])
 		FILE *p;
 		int x, y;
 		int oldeolseen = 1;
+		int key;
+
+		if ((key = getch()) == 'q') 
+			do_exit(0);
 
 		if (screen_size_changed) {
 			get_terminal_size();
@@ -314,7 +320,16 @@ main(int argc, char *argv[])
 
 		first_screen = 0;
 		refresh();
-		usleep(interval * 1000000);
+
+		/* wait until tiemout or until a key press */
+		{
+			fd_set set;
+			int fd = fileno(stdin);
+			struct timeval timeout = { interval, 0 };
+			FD_ZERO(&set);
+			FD_SET(fd, &set);
+			select(fd + 1, &set, NULL, NULL, &timeout);
+		}
 	}
 
 	endwin();
$

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2006-09-14 19:34 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-14  0:51 [devel] procps.git Alexey Tourbin
2006-09-14  1:06 ` Dmitry V. Levin
2006-09-14  1:15   ` Alexey Tourbin
2006-09-14  1:26     ` Dmitry V. Levin
2006-09-14  5:51       ` Kirill Maslinsky
2006-09-14 12:23         ` Dmitry V. Levin
2006-09-14 12:56           ` Anton Farygin
2006-09-14 13:08             ` Dmitry V. Levin
2006-09-14 13:10               ` Anton Farygin
2006-09-14 19:34   ` Michael Shigorin
2006-09-14  1:32 ` Alexey Tourbin
2006-09-14  1:32   ` Alexey Tourbin
2006-09-14  5:23 ` [devel] watch(1) Alexey Tourbin
2006-09-14 13:38   ` Dmitry V. Levin
2006-09-14  5:40 ` [devel] procps.git Alexey Tourbin
2006-09-14 13:43   ` Dmitry V. Levin
2006-09-14 14:05     ` Alexey Tourbin
2006-09-14 14:21       ` [devel] [jt] procps.git Dmitry V. Levin

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git