Magellan Linux

Contents of /trunk/xorg-old/patches-6.8.2-r10/0126_all_4.2.99.3-startx-v2.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 167 - (show annotations) (download)
Tue May 8 20:58:51 2007 UTC (17 years ago) by niro
File size: 3931 byte(s)
-import

1 --- XFree86-4.2.99.3/xc/programs/xinit/startx.cpp.startx 2002-09-19 02:19:38.000000000 +0200
2 +++ XFree86-4.2.99.3/xc/programs/xinit/startx.cpp 2002-12-23 13:13:22.000000000 +0100
3 @@ -52,8 +52,6 @@
4 userserverrc=$HOME/.xserverrc
5 sysclientrc=XINITDIR/xinitrc
6 sysserverrc=XINITDIR/xserverrc
7 -defaultclient=BINDIR/xterm
8 -defaultserver=BINDIR/X
9 defaultclientargs=""
10 defaultserverargs=""
11 clientargs=""
12 @@ -82,60 +80,41 @@
13 whoseargs="client"
14 while [ x"$1" != x ]; do
15 case "$1" in
16 - XCOMM '' required to prevent cpp from treating "/*" as a C comment.
17 - /''*|\./''*)
18 - if [ "$whoseargs" = "client" ]; then
19 - if [ x"$clientargs" = x ]; then
20 - client="$1"
21 - else
22 - clientargs="$clientargs $1"
23 - fi
24 - else
25 - if [ x"$serverargs" = x ]; then
26 - server="$1"
27 - else
28 - serverargs="$serverargs $1"
29 - fi
30 - fi
31 - ;;
32 - --)
33 - whoseargs="server"
34 - ;;
35 - *)
36 - if [ "$whoseargs" = "client" ]; then
37 - clientargs="$clientargs $1"
38 - else
39 - XCOMM display must be the FIRST server argument
40 - if [ x"$serverargs" = x ] && @@
41 - expr "$1" : ':[0-9][0-9]*$' > /dev/null 2>&1; then
42 - display="$1"
43 - else
44 - serverargs="$serverargs $1"
45 - fi
46 - fi
47 - ;;
48 + /''*|\.*) if [ "$whoseargs" = "client" ]; then
49 + if [ "x$clientargs" = x ]; then
50 + clientargs="$1"
51 + else
52 + clientargs="$clientargs $1"
53 + fi
54 + else
55 + if [ "x$serverargs" = x ]; then
56 + serverargs="$1"
57 + else
58 + serverargs="$serverargs $1"
59 + fi
60 + fi ;;
61 + --) whoseargs="server" ;;
62 + *) if [ "$whoseargs" = "client" ]; then
63 + if [ "x$clientargs" = x ]; then
64 + clientargs="$defaultclientargs $1"
65 + else
66 + clientargs="$clientargs $1"
67 + fi
68 + else
69 + case "$1" in
70 + :[0-9]*) display="$1"; serverargs="$serverargs $1";;
71 + *) serverargs="$serverargs $1" ;;
72 + esac
73 + fi ;;
74 esac
75 shift
76 done
77
78 -XCOMM process client arguments
79 -if [ x"$client" = x ]; then
80 - XCOMM if no client arguments either, use rc file instead
81 - if [ x"$clientargs" = x ]; then
82 - client="$defaultclientargs"
83 - else
84 - client=$defaultclient
85 - fi
86 +if [ x"$clientargs" = x ]; then
87 + clientargs="$defaultclientargs"
88 fi
89 -
90 -XCOMM process server arguments
91 -if [ x"$server" = x ]; then
92 - XCOMM if no server arguments or display either, use rc file instead
93 - if [ x"$serverargs" = x -a x"$display" = x ]; then
94 - server="$defaultserverargs"
95 - else
96 - server=$defaultserver
97 - fi
98 +if [ x"$serverargs" = x ]; then
99 + serverargs="$defaultserverargs"
100 fi
101
102 if [ x"$XAUTHORITY" = x ]; then
103 @@ -172,7 +151,9 @@
104 done
105 #endif
106
107 -xinit $client $clientargs -- $server $display $serverargs
108 +cleanup() {
109 + [ -n "$PID" ] && kill $PID > /dev/null 2>&1
110 +
111
112 if [ x"$removelist" != x ]; then
113 xauth remove $removelist
114 @@ -195,3 +176,15 @@
115 #if defined(sun) && !defined(i386)
116 kbd_mode -a
117 #endif
118 +}
119 +
120 +
121 +trap cleanup 0
122 +
123 +xinit $clientargs -- $serverargs -deferglyphs 16 &
124 +
125 +PID=$!
126 +
127 +wait $PID
128 +
129 +unset PID
130 --- XFree86-4.2.99.3/xc/programs/xinit/xinit.c.startx 2002-05-31 20:46:13.000000000 +0200
131 +++ XFree86-4.2.99.3/xc/programs/xinit/xinit.c 2002-12-23 13:27:35.000000000 +0100
132 @@ -431,6 +431,7 @@
133 signal(SIGINT, sigCatch);
134 signal(SIGHUP, sigCatch);
135 signal(SIGPIPE, sigCatch);
136 + signal(SIGTERM, sigCatch);
137 #else
138 /* Let those signal interrupt the wait() call in the main loop */
139 memset(&sa, 0, sizeof sa);
140 @@ -442,6 +443,7 @@
141 sigaction(SIGINT, &sa, NULL);
142 sigaction(SIGHUP, &sa, NULL);
143 sigaction(SIGPIPE, &sa, NULL);
144 + sigaction(SIGTERM, &sa, NULL);
145 #endif
146 signal(SIGALRM, sigAlarm);
147 signal(SIGUSR1, sigUsr1);