diff options
author | kraxel <kraxel> | 2006-07-03 12:30:24 +0000 |
---|---|---|
committer | kraxel <kraxel> | 2006-07-03 12:30:24 +0000 |
commit | 146df176d8ead4435bf5e3f9d5dda7be98531cad (patch) | |
tree | e01a4cf05db925ae46a753ee1a796f9556017133 /xenscreen.c | |
parent | 8f4db7fb5130a0b327154eddc62b161fb66af688 (diff) | |
download | xenwatch-146df176d8ead4435bf5e3f9d5dda7be98531cad.tar.gz |
some small tweaks
Diffstat (limited to 'xenscreen.c')
-rw-r--r-- | xenscreen.c | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/xenscreen.c b/xenscreen.c index e091976..a464236 100644 --- a/xenscreen.c +++ b/xenscreen.c @@ -88,6 +88,7 @@ static void try_attach_screen(struct dom *dom) return; } + /* known-racy, but better than nothing ... */ rc = run_application(1, "fuser", "fuser", "-s", dom->tty, NULL); if (0 == rc) { fprintf(stderr," error: tty %s already in use\n", dom->tty); @@ -98,6 +99,19 @@ static void try_attach_screen(struct dom *dom) "-X", "-S", screen_session, "screen", "-t", dom->name, dom->tty, NULL); +#if 1 + /* + * Hmm, not exactly the most elegant way to do this. + * Switches back from the new window to the previous one. + * Better would be to not switch in the first place, + * seems screen can't do that though :-( + */ + rc = run_application(1, "screen", "screen", + "-X", "-S", screen_session, + "other", + NULL); +#endif + dom->connected = 1; domcnt++; } @@ -199,16 +213,20 @@ int main(int argc, char *argv[]) } /* main loop */ - fprintf(stderr,"... done, watching for new ones appear\n"); + fprintf(stderr,"... done, watching out for new changes now.\n"); for (;;) { if (termsig) { if (!domcnt) break; if (time(NULL) - last_ctrl_c < 3) break; - fprintf(stderr,"Still %d domain(s) active - not quitting.\n", domcnt); - fprintf(stderr,"Better try detach instead (Ctrl-A d).\n"); - fprintf(stderr,"Hit Ctrl-C within 3 secs again to quit nevertheless.\n"); + fprintf(stderr, + "\n" + "Still %d domain(s) active - not quitting.\n" + "Better try detach instead (Ctrl-A d).\n" + "Hit Ctrl-C within 3 secs again to quit nevertheless.\n" + "\n", + domcnt); last_ctrl_c = time(NULL); termsig = 0; } |