Menu

#1 [twine] Die gracefully if misconfigured

open
nobody
None
5
2002-09-16
2002-09-16
John Tobey
No

This patch fixes the behavior of the twine executable
in the case where it can not load the Root class. The
current behavior is to dump core. The new behavior is
to print "Failed to load Root class: 4" to stderr and
exit. To reproduce the core dump, check out a fresh
source tree, configure with a non-existent prefix,
build but do not install, and execute ./twine/twine .

The patch initializes the stream pointer hd_log before
use in HD_startupLocal(). Perhaps a good idea would be
to factor out the common first few lines of
HD_startupLocal() and HD_connect().

Index: libhd/hd_server.c

RCS file:
/cvsroot/integratis/integratis/libhd/hd_server.c,v
retrieving revision 1.138
diff -u -r1.138 hd_server.c
--- libhd/hd_server.c 8 May 2002 19:55:00 -0000
1.138
+++ libhd/hd_server.c 16 Sep 2002 01:27:24 -0000
@@ -1477,6 +1477,10 @@
HDStatus_t status;
BEGIN (374);

+ /* set default hd_log if not already set */
+ if (!hd_log)
+ hd_log = stderr;
+
/* Attempt to switch to predefined username */
uid = hd_name_to_uid (hd_const_user);
if (uid >= 0) {

Discussion

  • John Tobey

    John Tobey - 2002-09-16

    unmangled patch

     
  • John Tobey

    John Tobey - 2002-09-16

    Logged In: YES
    user_id=8224

    It's a bad idea to paste cvs diff output into this form. I
    will try to attach the un-html-mangled version of the patch
    as a file.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.