From ac470dfb4fadaa0b28b6f8b57f4f13a20842b897 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Thu, 12 Feb 2009 18:34:22 -0800 Subject: [PATCH] Check for and report errors writing xorg.conf.new from Xorg -configure Signed-off-by: Alan Coopersmith --- hw/xfree86/common/xf86Configure.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c index b803b4910..1f1ff677c 100644 --- a/hw/xfree86/common/xf86Configure.c +++ b/hw/xfree86/common/xf86Configure.c @@ -733,7 +733,11 @@ DoConfigure(void) snprintf(filename, sizeof(filename), "%s%s" XF86CONFIGFILE ".new", home, addslash); - xf86writeConfigFile(filename, xf86config); + if (xf86writeConfigFile(filename, xf86config) == 0) { + xf86Msg(X_ERROR, "Unable to write config file: \"%s\": %s\n", + filename, strerror(errno)); + goto bail; + } xf86DoConfigurePass1 = FALSE; /* Try to get DDC information filled in */ @@ -829,7 +833,11 @@ DoConfigure(void) (glp)xf86config->conf_screen_lst, (glp)ScreenPtr); } - xf86writeConfigFile(filename, xf86config); + if (xf86writeConfigFile(filename, xf86config) == 0) { + xf86Msg(X_ERROR, "Unable to write config file: \"%s\": %s\n", + filename, strerror(errno)); + goto bail; + } ErrorF("\n");