From c9cfc9a9f356386e07e6273f91dd3d46ca076c12 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Mon, 9 Feb 2009 18:08:01 +0000 Subject: Don't try to change the window name unless the pid of the process chosen has changed. Reduces CPU use. osdep-* stuff is a bit horrible now but there we go :-/. --- osdep-darwin.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'osdep-darwin.c') diff --git a/osdep-darwin.c b/osdep-darwin.c index 9ca0b3dd..441e5f57 100644 --- a/osdep-darwin.c +++ b/osdep-darwin.c @@ -1,4 +1,4 @@ -/* $Id: osdep-darwin.c,v 1.4 2009-02-07 19:41:35 nicm Exp $ */ +/* $Id: osdep-darwin.c,v 1.5 2009-02-09 18:08:01 nicm Exp $ */ /* * Copyright (c) 2009 Joshua Elsasser @@ -25,7 +25,9 @@ #include #include -char *get_argv0(int, char *); +int osdep_get_name(int, char *, pid_t *, char **); + +#define unused __attribute__ ((unused)) /* * XXX This actually returns the executable path, not the process's argv[0]. @@ -33,8 +35,8 @@ char *get_argv0(int, char *); * Apple's 'ps' source and start digging. */ -char * -get_argv0(int fd, __attribute__ ((unused)) char *tty) +int +osdep_get_name(int fd, unused char *tty, unused pid_t *last_pid, char **name) { int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, 0 }; size_t size; -- cgit