Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 104565
Collapse All | Expand All

(-)gtkdiskfree-1.9.3/src/mount.c (-28 / +8 lines)
Lines 31-71 Link Here
31
void
31
void
32
open_cmd_tube (const gchar *cmd, const gchar *mount_point)
32
open_cmd_tube (const gchar *cmd, const gchar *mount_point)
33
{
33
{
34
	gint status;
34
	gchar error[MAXLINE], *line, *status;
35
	gchar error[MAXLINE], *line;
35
	FILE *sh;
36
	FILE *sh, *tmp;
37
	
36
	
38
	setbuf(stdout, error);
37
	setbuf(stdout, error);
39
	line = g_strconcat(cmd, " ", mount_point, " &> ", TUBE_NAME, NULL);
38
	line = g_strconcat(cmd, " ", mount_point, " 2>&1", NULL);
40
	sh = popen(line, "r");
39
	sh = popen(line, "r");
41
	g_free(line);
40
	g_free(line);
42
	
41
	
43
	status = pclose(sh);
42
	status = fgets(error, MAXLINE-1, sh);
44
	
43
45
	if (status == 0) {
44
	if (status && (pclose(sh) != 0))
46
		remove(TUBE_NAME);
47
		gui_list_main_update(GTK_TREE_VIEW(list_treeview));
48
		
49
		return;
50
	} else {
51
		if ((tmp = fopen(TUBE_NAME, "r")) == NULL) {
52
			gui_list_main_update(GTK_TREE_VIEW(list_treeview)); 
53
			
54
			return;
55
		}
56
		if (fgets(error, MAXLINE-1, tmp) == NULL) {
57
			fclose(tmp);
58
			remove(TUBE_NAME);
59
			gui_list_main_update(GTK_TREE_VIEW(list_treeview));
60
			
61
			return;
62
		}
63
		fclose(tmp);
64
		remove(TUBE_NAME);
65
		error_window(error);
45
		error_window(error);
66
	}
46
67
	gui_list_main_update(GTK_TREE_VIEW(list_treeview));
47
	gui_list_main_update(GTK_TREE_VIEW(list_treeview));
68
	
48
69
	return;
49
	return;
70
}
50
}
71
51

Return to bug 104565