Set the process title where possible

Gerald Pfeifer gerald at pfeifer.com
Sun Jan 20 14:23:08 CST 2008


Kris Moore submitted an earlier version of this patch which was checking
for FreeBSD.  This updated version uses autoconf to check for the presence
of the setproctitle system call and uses this if applicable.  Kris acked
this version.

Our colleagues from PC-BSD especially would appreciate to see this in the
next release of Wine.

Gerald

ChangeLog:
Kris Moore <kris at pcbsd.com> and Gerald Pfeifer <gerald at pfeifer.com>
Use setproctitle where applicable to set the process name.

Index: configure.ac
===================================================================
RCS file: /home/wine/wine/configure.ac,v
retrieving revision 1.738
diff -u -3 -p -r1.738 configure.ac
--- configure.ac	17 Jan 2008 14:49:45 -0000	1.738
+++ configure.ac	20 Jan 2008 20:16:07 -0000
@@ -1364,6 +1365,7 @@ AC_CHECK_FUNCS(\
 	rfork \
 	sched_yield \
 	select \
+	setproctitle \
 	setrlimit \
 	settimeofday \
 	sigaltstack \
Index: dlls/kernel32/process.c
===================================================================
RCS file: /home/wine/wine/dlls/kernel32/process.c,v
retrieving revision 1.20
diff -u -3 -p -r1.20 process.c
--- dlls/kernel32/process.c	17 Jan 2008 14:49:38 -0000	1.20
+++ dlls/kernel32/process.c	20 Jan 2008 20:16:07 -0000
@@ -897,6 +897,10 @@ static void start_process( void *arg )
  */
 static void set_process_name( int argc, char *argv[] )
 {
+#ifdef HAVE_SETPROCTITLE
+    setproctitle("-%s", argv[1]);
+#endif
+
 #ifdef HAVE_PRCTL
     int i, offset;
     char *p, *prctl_name = argv[1];



More information about the wine-patches mailing list