/******************************************************************************/ enum xwait_status
wait_for_xserver(uid_t uid, struct list *env_names, struct list *env_values, int display)
{ enum xwait_status rv = XW_STATUS_MISC_ERROR; int fd[2] = {-1, -1}; struct list *cmd = make_xwait_command(display);
// Construct the command to execute to check the display if (cmd == NULL)
{
LOG(LOG_LEVEL_ERROR, "Can't create xwait command list - no mem");
} elseif (g_pipe(fd) != 0)
{
LOG(LOG_LEVEL_ERROR, "Can't create pipe : %s", g_get_strerror());
} else
{
pid_t pid = g_fork(); if (pid < 0)
{ // Error already logged
} elseif (pid == 0)
{ /* Child process */
/* Send stdout and stderr up the pipe */
g_file_close(fd[0]);
g_file_duplicate_on(fd[1], 1);
g_file_duplicate_on(fd[1], 2);
/* Move to the user context... */
env_set_user(uid, 0,
display,
env_names,
env_values);
/* ...and run the program */
g_execvp_list((constchar *)cmd->items[0], cmd);
LOG(LOG_LEVEL_ERROR, "Can't run %s - %s",
(constchar *)cmd->items[0], g_get_strerror());
g_exit(rv);
} else
{
LOG(LOG_LEVEL_DEBUG, "Waiting for X server to start on display :%d",
display);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.