[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: gEDA-user: Segfault in PS hid -> patch
On Thu, 11 Jan 2007 15:56:10 -0500
DJ Delorie <dj@xxxxxxxxxxx> wrote:
>
> Ok, I applied your patch. I'd like to see Message() get used though.
>
Thanks for applying.
I have been playing with replacing perror with Message() in ps.c and eps.c but now I get error messages from ps.c in stderr whereas eps.c sends them to the message log.
IMO eps.c behaves correctly and I'd like to have ps.c to do that also, what am I overlooking? Attached are the changes I made.
Hans
>
> _______________________________________________
> geda-user mailing list
> geda-user@xxxxxxxxxxxxxx
> http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
>
--
$ cat .sig /dev/null
diff -ruN pcb/src/hid/ps/eps.c pcb-ps-message/src/hid/ps/eps.c
--- pcb/src/hid/ps/eps.c 2007-01-11 22:28:38.000000000 +0100
+++ pcb-ps-message/src/hid/ps/eps.c 2007-01-11 23:29:54.000000000 +0100
@@ -17,6 +17,7 @@
#include "hid.h"
#include "../hidint.h"
#include "../ps/ps.h"
+#include "error.h"
#ifdef HAVE_LIBDMALLOC
#include <dmalloc.h>
@@ -272,7 +273,7 @@
f = fopen (filename, "w");
if (!f)
{
- perror (filename);
+ Message (_("Error: Could not open %s for writing.\n"), filename);
return;
}
diff -ruN pcb/src/hid/ps/ps.c pcb-ps-message/src/hid/ps/ps.c
--- pcb/src/hid/ps/ps.c 2007-01-11 22:05:27.000000000 +0100
+++ pcb-ps-message/src/hid/ps/ps.c 2007-01-11 23:01:14.000000000 +0100
@@ -18,6 +18,7 @@
#include "../hidint.h"
#include "../ps/ps.h"
#include "../../print.h"
+#include "error.h"
#ifdef HAVE_LIBDMALLOC
#include <dmalloc.h>
@@ -259,12 +260,12 @@
char *buf;
if (!multi_file)
{
- printf("PS: open %s\n", base);
+ Message("PS: open %s\n", base);
return fopen (base, "w");
}
buf = malloc (strlen (base) + strlen (suff) + 5);
sprintf(buf, "%s.%s.ps", base, suff);
- printf("PS: open %s\n", buf);
+ Message("PS: open %s\n", buf);
f = fopen(buf, "w");
free (buf);
return f;
@@ -405,7 +406,7 @@
f = psopen (filename, "toc");
if (!f)
{
- perror (filename);
+ Message (_("Error: Could not open %s for writing.\n"), filename);
return;
}
ps_start_file (f);
@@ -510,7 +511,7 @@
f = psopen (filename, layer_type_to_file_name (idx));
if (!f)
{
- perror(filename);
+ Message (_("Error: Could not open %s for writing.\n"), filename);
return 0;
}
_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user