Permalink
Browse files

Better GTK2 and SELinux support.

  • Loading branch information...
megastep committed Mar 30, 2010
1 parent 641db10 commit be36605795b538fe33e4f6c044adb63bf2a77dc6
Showing with 25 additions and 9 deletions.
  1. +1 −1 configure.in
  2. +2 −2 copy.c
  3. +11 −4 gtk_ui.c
  4. +10 −2 install.c
  5. +1 −0 install.h
View
@@ -194,7 +194,7 @@ esac
GTK_STATIC=$BSTATIC
case "$target" in
*linux*)
*i?86*linux*)
# Newer glibc's require to depend at least on them
STATIC=""
GTK_STATIC="\$(BDYNAMIC)" ;;
View
4 copy.c
@@ -328,7 +328,7 @@ ssize_t copy_file(install_info *info, const char *cdrom, const char *path, const
mode = (int) strtol(mode_str, NULL, 8);
}
while ( (copied=file_read(info, buf, BUFSIZ, input)) > 0 ) {
while ( (copied=file_read(info, buf, sizeof(buf), input)) > 0 ) {
if ( file_write(info, buf, copied, output) != copied ) {
break;
}
@@ -409,7 +409,7 @@ ssize_t copy_file(install_info *info, const char *cdrom, const char *path, const
log_warning(_("Invalid SELinux context '%s' for file '%s'"), se_context, base);
}
# else
run_command(info, "chcon", se_context, final, 0);
run_command3(info, "chcon", "-ht", se_context, final, 0);
# endif
}
#endif
View
@@ -1912,11 +1912,14 @@ static install_state gtkui_pick_class(install_info *info)
static void gtkui_idle(install_info *info)
{
#ifdef ENABLE_GTK2
/* if (g_main_context_pending(NULL))
g_main_context_iteration(NULL, FALSE); */
/*
if( gtk_events_pending() ) {
gtk_main_iteration_do(FALSE);
}
gtk_main_iteration();
} */
#else
while( gtk_events_pending() ) {
while( gtk_events_pending() == TRUE) {
gtk_main_iteration();
}
#endif
@@ -2210,7 +2213,11 @@ static void gtkui_shutdown(install_info *info)
window = glade_xml_get_widget(setup_glade_license, "license_dialog");
gtk_widget_hide(window);
}
gtkui_idle(info);
/* This seems to work better on GTK2 */
while( gtk_events_pending() == TRUE) {
gtk_main_iteration();
}
// gtkui_idle(info);
}
int gtkui_okay(Install_UI *UI, int *argc, char ***argv)
View
@@ -3052,18 +3052,24 @@ int run_script(install_info *info, const char *script, int arg, int include_tags
}
int run_command(install_info *info, const char *cmd, const char *arg1, const char *arg2, int warn)
{
return run_command3(info, cmd, arg1, arg2, NULL, warn);
}
int run_command3(install_info *info, const char *cmd, const char *arg1, const char *arg2, const char *arg3, int warn)
{
int exitval = 0;
pid_t child;
log_debug("Running command: '%s' '%s' '%s'\n", cmd, arg1 ? arg1 : "", arg2 ? arg2 : "");
log_debug("Running command: '%s' '%s' '%s' '%s'\n", cmd, arg1 ? arg1 : "", arg2 ? arg2 : "", arg3 ? arg3 : "");
switch( child = fork() ) {
case 0: {/* Inside the child */
char *argv[4];
argv[0] = strdup(cmd);
argv[1] = arg1 ? strdup(arg1) : NULL;
argv[2] = arg2 ? strdup(arg2) : NULL;
argv[3] = NULL;
argv[3] = arg3 ? strdup(arg3) : NULL;
argv[4] = NULL;
execvp(cmd, argv);
if ( warn ) {
perror("execv");
@@ -3074,6 +3080,8 @@ int run_command(install_info *info, const char *cmd, const char *arg1, const cha
free(argv[1]);
if (arg2)
free(argv[2]);
if (arg3)
free(argv[3]);
_exit(1);
}
case -1: /* Error */
View
@@ -425,6 +425,7 @@ extern void pop_curdir(void);
/* Run a program in the background */
int run_command(install_info *info, const char *cmd, const char *arg1, const char *arg2, int warn);
int run_command3(install_info *info, const char *cmd, const char *arg1, const char *arg2, const char *arg3, int warn);
/* Manage the list of corrupt files if we're restoring */
extern void add_corrupt_file(const product_t *prod, const char *path, const char *option);

0 comments on commit be36605

Please sign in to comment.