View | Details | Raw Unified | Return to bug 8574
Collapse All | Expand All

(-)x11setupdrv.c.orig (-2 / +14 lines)
Lines 45-50 Link Here
45
	{"driver", no_argument, 0, 'd'},
45
	{"driver", no_argument, 0, 'd'},
46
	{"nosetup", no_argument, 0, 'n'},
46
	{"nosetup", no_argument, 0, 'n'},
47
	{"help", no_argument, 0, 'h'},
47
	{"help", no_argument, 0, 'h'},
48
	{"setdrv", required_argument, 0, 's' },
48
	{0, no_argument, 0, 0}
49
	{0, no_argument, 0, 0}
49
};
50
};
50
51
Lines 65-73 Link Here
65
	int param = 0;
66
	int param = 0;
66
	int driver = 0;
67
	int driver = 0;
67
	int nosetup = 0;
68
	int nosetup = 0;
69
	int setdrv = 0;
70
	unsigned char drv_name[51];
68
	const char *cmdline;
71
	const char *cmdline;
69
	
72
	
70
	while ((c = getopt_long (argc, argv, "cpdnh", longopts, 0)) != -1)
73
	while ((c = getopt_long (argc, argv, "cpdnhs:", longopts, 0)) != -1)
71
		switch (c) {
74
		switch (c) {
72
			case 'c':
75
			case 'c':
73
				config = 1;
76
				config = 1;
Lines 83-88 Link Here
83
				break;
86
				break;
84
			case 'h':
87
			case 'h':
85
				usage (stdout, EXIT_SUCCESS);
88
				usage (stdout, EXIT_SUCCESS);
89
				break;
90
			case 's':
91
				strncpy(drv_name,optarg,50);
92
				setdrv=1;
93
				break;
86
			default:
94
			default:
87
				usage (stderr, EXIT_FAILURE);
95
				usage (stderr, EXIT_FAILURE);
88
		}
96
		}
Lines 101-107 Link Here
101
	XF86ConfigPtr conf;
109
	XF86ConfigPtr conf;
102
	if (!(conf = xf86readConfigFile ()))
110
	if (!(conf = xf86readConfigFile ()))
103
		error (1, errno, "%s: unable to parse config file", filename);
111
		error (1, errno, "%s: unable to parse config file", filename);
104
	xf86closeConfigFile ();
105
	
112
	
106
	const char *drivername =
113
	const char *drivername =
107
		conf->conf_layout_lst->lay_adjacency_lst->adj_screen->scrn_device->dev_driver;
114
		conf->conf_layout_lst->lay_adjacency_lst->adj_screen->scrn_device->dev_driver;
Lines 114-119 Link Here
114
	if (nosetup == 0) {
121
	if (nosetup == 0) {
115
		char *path;
122
		char *path;
116
		
123
		
124
		if ( setdrv == 1) {
125
		    conf->conf_layout_lst->lay_adjacency_lst->adj_screen->scrn_device->dev_driver=strdup(drv_name);
126
		     xf86writeConfigFile ( filename, conf );
127
		}
117
		if (asprintf (&path, "%s/%s", DRVDIR, drivername) < 0)
128
		if (asprintf (&path, "%s/%s", DRVDIR, drivername) < 0)
118
			error (1, errno, "asprintf");
129
			error (1, errno, "asprintf");
119
		execl (path, drivername, param ? filename : NULL, NULL);
130
		execl (path, drivername, param ? filename : NULL, NULL);
Lines 123-128 Link Here
123
		execl (path, "x11", NULL);
134
		execl (path, "x11", NULL);
124
	};
135
	};
125
136
137
	xf86closeConfigFile ();
126
	/* error (1, errno, "execl: %s", path); */
138
	/* error (1, errno, "execl: %s", path); */
127
	return 1;
139
	return 1;
128
}
140
}

Return to bug 8574