| From: | Noah Misch <noah(at)leadboat(dot)com> | 
|---|---|
| To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> | 
| Cc: | Alexander Law <exclusion(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Pg Bugs <pgsql-bugs(at)postgresql(dot)org> | 
| Subject: | Re: BUG #6510: A simple prompt is displayed using wrong charset | 
| Date: | 2012-10-15 09:48:18 | 
| Message-ID: | 20121015094818.GB4627@tornado.leadboat.com | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-bugs pgsql-general pgsql-hackers | 
On Sun, Oct 14, 2012 at 12:10:42PM -0400, Tom Lane wrote:
> Alexander Law <exclusion(at)gmail(dot)com> writes:
> 
> > +#ifdef WIN32
> > +	termin = fopen("CONIN$", "r");
> > +	termout = fopen("CONOUT$", "w+");
> > +#else
> >  	termin = fopen(DEVTTY, "r");
> >  	termout = fopen(DEVTTY, "w");
> > +#endif
> >  	if (!termin || !termout
> 
> My immediate reaction to this patch is "that's a horrible kluge, why
> shouldn't we change the definition of DEVTTY instead?"
You could make DEVTTY_IN, DEVTTY_IN_MODE, DEVTTY_OUT and DEVTTY_OUT_MODE to
capture all the differences.  That doesn't strike me as an improvement, and no
other function would use them at present.  As I explained in my reply to
Alexander, we should instead remove DEVTTY.
> Is there a
> similar issue in other places where we use DEVTTY?
Yes.  However, the other use of DEVTTY arises only with readline support, not
typical of native Windows builds.
> Also, why did you change the termout output mode, is that important
> or just randomness?
It's essential:
http://archives.postgresql.org/message-id/20121010110555.GA21405@tornado.leadboat.com
nm
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Heikki Linnakangas | 2012-10-15 10:13:01 | Re: BUG #7534: walreceiver takes long time to detect n/w breakdown | 
| Previous Message | Noah Misch | 2012-10-15 09:41:36 | Re: BUG #6510: A simple prompt is displayed using wrong charset | 
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Albe Laurenz | 2012-10-15 10:03:00 | Re: need suggestion | 
| Previous Message | Noah Misch | 2012-10-15 09:41:36 | Re: BUG #6510: A simple prompt is displayed using wrong charset | 
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Pavel Stehule | 2012-10-15 09:56:39 | Re: proposal - assign result of query to psql variable | 
| Previous Message | Noah Misch | 2012-10-15 09:41:36 | Re: BUG #6510: A simple prompt is displayed using wrong charset |