Number: 67
Title: graphviz 1.7.7 fails to build on sparc/solaris 2.8
Submitter: Schneelocke
Date: Tue Dec 18 15:55:33 2001
Subsys: Other
Version: 1.7.7
System: Sparc-Solaris-2.8
Severity: minor
Problem:
graphviz 1.7.7 fails to build on a solaris 2.8 system. this is due to the usage of sys_nerr and sys_errlist in lefty/ws/x11/libfilereq/SelFile.c. the patch below fixes this problem for me, but it is untested, and I'm not a C programmer anyway.

Thanks for taking a look, and hope the patch does help indeed! If you need any further information or whatever, please don't hesitate to contact me.
Input:

none.
Fix:

--- graphviz-1.7.7-orig/lefty/ws/x11/libfilereq/SelFile.c       Fri Jun  1 05:41:16 2001
+++ graphviz-1.7.7/lefty/ws/x11/libfilereq/SelFile.c    Tue Dec 18 21:44:50 2001
@@ -575,19 +575,11 @@
     SFchdir(SFstartDir);
     if ((fp = fopen(name, mode)) == NULL) {
        char *buf;
-       if (errno <= sys_nerr) {
-           buf = XtMalloc(strlen(failed) + strlen(sys_errlist[errno]) +
-                          strlen(prompt) + 2);
-           strcpy(buf, failed);
-           strcat(buf, sys_errlist[errno]);
-           strcat(buf, "n");
-           strcat(buf, prompt);
-       } else {
-           buf = XtMalloc(strlen(failed) + strlen(prompt) + 2);
-           strcpy(buf, failed);
-           strcat(buf, "n");
-           strcat(buf, prompt);
-       }
+       char *errormsg = strerror(errno);
+       buf = XtMalloc(strlen(failed) + strlen(errormsg) + strlen(prompt) + 2);
+       strcpy(buf, failed);
+       strcat(buf, errormsg);
+       strcat(buf, "n");
        XtSetArg(args[0], XtNlabel, buf);
        XtSetValues(selFilePrompt, args, ONE);
        XtFree(buf);

Owner: erg
Status: Fixed (15 Jan 2002)