summaryrefslogtreecommitdiff
path: root/hw/xfree86/utils/xorgconfig
diff options
context:
space:
mode:
authorAlan Coopersmith <Alan.Coopersmith@sun.com>2004-10-05 17:28:15 +0000
committerAlan Coopersmith <Alan.Coopersmith@sun.com>2004-10-05 17:28:15 +0000
commitd737bc3300cf1847bcea08ca781f37ee3ee62692 (patch)
tree0f611c760377d0f024f6f64f9d2abd2115eb0d5c /hw/xfree86/utils/xorgconfig
parent75217be88ccb87a54c84e31697ffb98b5f9b8e0a (diff)
Make xorgconfig ask again instead of giving up and throwing away all your
answers when you give a bad file name or bad amount of video RAM. (Sun bug id 5070654 - Derek Wang)
Diffstat (limited to 'hw/xfree86/utils/xorgconfig')
-rw-r--r--hw/xfree86/utils/xorgconfig/xorgconfig.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/hw/xfree86/utils/xorgconfig/xorgconfig.c b/hw/xfree86/utils/xorgconfig/xorgconfig.c
index 62ab9e94b..16a8fa297 100644
--- a/hw/xfree86/utils/xorgconfig/xorgconfig.c
+++ b/hw/xfree86/utils/xorgconfig/xorgconfig.c
@@ -94,7 +94,7 @@
* Chisato Yamauchi(cyamauch@phyas.aichi-edu.ac.jp)
*/
/* $XConsortium: xf86config.c /main/21 1996/10/28 05:43:57 kaleb $ */
-/* $XdotOrg: xc/programs/Xserver/hw/xfree86/xf86config/xorgconfig.c,v 1.5 2004/08/11 20:25:13 krh Exp $ */
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/xf86config/xorgconfig.c,v 1.6 2004/08/13 23:57:38 alanc Exp $ */
#include <stdlib.h>
#include <stdio.h>
@@ -241,7 +241,7 @@ char *temp_dir = "";
int card_selected; /* Card selected from database. */
-static void write_XF86Config(char *filename);
+static int write_XF86Config(char *filename);
/*
@@ -1370,7 +1370,7 @@ static int exists_dir(char *name) {
return S_ISDIR(sbuf.st_mode) ? 1 : 0;
}
-static void
+static int
screen_configuration(void) {
int i, c/*, np*/;
char s[80];
@@ -1533,8 +1533,8 @@ screen_configuration(void) {
config_virtualy8bpp = 400;
}
else {
- printf("Fatal error: Invalid amount of video memory.\n");
- exit(-1);
+ printf("Invalid amount of video memory. Please try again\n");
+ return(1);
}
#if 0
@@ -1821,6 +1821,7 @@ skipclockprobing:
if (answerisyes(s))
config_virtual = 1;
}
+ return(0);
}
static char *defaultdepthtext =
@@ -2523,7 +2524,7 @@ write_fontpath_section(FILE *f)
}
}
-static void
+static int
write_XF86Config(char *filename)
{
FILE *f;
@@ -2539,7 +2540,7 @@ write_XF86Config(char *filename)
if (getuid() != 0)
printf("Maybe you need to be root to write to the specified directory?\n");
#endif
- exit(-1);
+ return(1);
}
fprintf(f, "%s", XF86Config_firstchunk_text);
@@ -2732,6 +2733,7 @@ write_XF86Config(char *filename)
fprintf(f, serverlayout_section_text2);
fclose(f);
+ return(0);
}
static char *
@@ -2952,7 +2954,7 @@ main(int argc, char *argv[]) {
emptylines();
- screen_configuration();
+ while(screen_configuration()){};
emptylines();
@@ -2960,7 +2962,7 @@ main(int argc, char *argv[]) {
emptylines();
- write_XF86Config(ask_XF86Config_location());
+ while(write_XF86Config(ask_XF86Config_location())){};
printf("%s", finalcomment_text);