This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: What to do when setup fails?


On Wed, 10 Nov 2004, Dave Korn wrote:

> From mount.cc:
> [snip]
>     fatal ("mount");
>
>   Luke, if setup is failing to create that key, you must be trying to
> install for all users while running as a user with inadequate rights,
> mustn't you?  The attached patch would tell you what the actual error
> code was, if you felt like rebuilding setup.

Quoting the patch:

-    fatal ("mount");
+  {
+  char errbuffer[40];
+    _snprintf (errbuffer, 40, "mount %d", GetLastError ());
+    fatal (errbuffer);
+  }

Umm, isn't this exactly what fatal() does already?

Quoting dialog.cc:

void
fatal (const char *msg)
{
  DWORD e = GetLastError ();
  char *buf;
  FormatMessage (FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
                 0, e, 0, (CHAR *) & buf, 0, 0);
  MessageBox (0, buf, msg, 0);
  LogSingleton::GetInstance().exit (1);
  // Keep gcc happy - some sort of bug!
  exit (1);
}

	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"The Sun will pass between the Earth and the Moon tonight for a total
Lunar eclipse..." -- WCBS Radio Newsbrief, Oct 27 2004, 12:01 pm EDT

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]