|
Lines 26-31
Link Here
|
| 26 |
#include <fcntl.h> |
26 |
#include <fcntl.h> |
| 27 |
#include <pwd.h> |
27 |
#include <pwd.h> |
| 28 |
#include <unistd.h> |
28 |
#include <unistd.h> |
|
|
29 |
#include <utmp.h> |
| 29 |
#include <string.h> |
30 |
#include <string.h> |
| 30 |
#include <signal.h> |
31 |
#include <signal.h> |
| 31 |
#include <sys/stat.h> |
32 |
#include <sys/stat.h> |
|
Lines 96-101
gdm_static_display_manage (GdmDisplay *display)
Link Here
|
| 96 |
} |
97 |
} |
| 97 |
|
98 |
|
| 98 |
static gboolean |
99 |
static gboolean |
|
|
100 |
gdm_static_display_should_manager_again (void) |
| 101 |
{ |
| 102 |
struct utmp *ut; |
| 103 |
|
| 104 |
setutent(); |
| 105 |
while ((ut = getutent()) != NULL) { |
| 106 |
if (ut->ut_type == RUN_LVL) { |
| 107 |
int current; |
| 108 |
current = ut->ut_pid % 256; |
| 109 |
endutent(); |
| 110 |
|
| 111 |
if (current == 0 || current == 6) |
| 112 |
return FALSE; |
| 113 |
return TRUE; |
| 114 |
} |
| 115 |
} |
| 116 |
|
| 117 |
endutent(); |
| 118 |
|
| 119 |
return TRUE; |
| 120 |
} |
| 121 |
|
| 122 |
static gboolean |
| 99 |
gdm_static_display_finish (GdmDisplay *display) |
123 |
gdm_static_display_finish (GdmDisplay *display) |
| 100 |
{ |
124 |
{ |
| 101 |
int status; |
125 |
int status; |
|
Lines 108-116
gdm_static_display_finish (GdmDisplay *display)
Link Here
|
| 108 |
/* restart static displays */ |
132 |
/* restart static displays */ |
| 109 |
gdm_display_unmanage (display); |
133 |
gdm_display_unmanage (display); |
| 110 |
|
134 |
|
| 111 |
status = gdm_display_get_status (display); |
135 |
if (gdm_static_display_should_manager_again ()) { |
| 112 |
if (status != GDM_DISPLAY_FAILED) { |
136 |
status = gdm_display_get_status (display); |
| 113 |
gdm_display_manage (display); |
137 |
if (status != GDM_DISPLAY_FAILED) { |
|
|
138 |
gdm_display_manage (display); |
| 139 |
} |
| 114 |
} |
140 |
} |
| 115 |
|
141 |
|
| 116 |
return TRUE; |
142 |
return TRUE; |