[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Console server patch
From: |
James Morrison |
Subject: |
Re: Console server patch |
Date: |
Fri, 16 May 2003 23:43:19 -0400 (EDT) |
From: marco@linuxrulez.nl
Date: Sat, 17 May 2003 01:11:43 +0200 (CEST)
X-Priority: 3
Importance: Normal
Sender: bug-hurd-bounces+ja2morri=student.math.uwaterloo.ca@gnu.org
X-Spam-Status: No, hits=-4.3 required=5.0
tests=NO_REAL_NAME,PORN_10,UNIFIED_PATCH version=2.20
X-Spam-Level:
Hi,
Here is a patch to configuring width, height and the number of lines
in the console server. I've sent this patch before, but this patch is
seperated from the console-client part for supporting non 80x25
resolutions. That will make it easier to review and apply. I will continue
my work on the console-client for this.
If there are some problems with this code, please tell me.
Thanks,
Marco
I'll eventually get to trying this but keep working; it looks pretty good.
+ if (!err && cons->lines != DEFAULT_LINES)
+ {
+ char *buf;
+ asprintf (&buf, "--lines=%d", cons->lines);
+ if (buf)
+ err = argz_add (argz, argz_len, buf);
+ else
+ err = errno;
+ }
+ if (!err && cons->width != DEFAULT_WIDTH)
+ {
+ char *buf;
+ asprintf (&buf, "--width=%d", cons->lines);
+ if (buf)
+ err = argz_add (argz, argz_len, buf);
+ else
+ err = errno;
+ }
+ if (!err && cons->height != DEFAULT_HEIGHT)
+ {
+ char *buf;
+ asprintf (&buf, "--height=%d", cons->height);
+ if (buf)
I mentioned before, this is not a valid way to check if asprintf failed.
You should do
if (asprintf(&buf, ...) < 0)
error case
Jim