Re: Use symbolic name instead of hardcoded value on telnet(1)

2015-11-20 Thread Jérémie Courrèges-Anglas
Ricardo Mestre  writes:

> That was fast, thank you! In the meantime I found a few more offenders,
> patch below.

It is unclear to me whether the cvs patch should be committed.  Most of
those calls *may* go away soon, along with the surrounding code.

> PS: I previously sent a patch for route, which also uses
> shutdown with a number, but for now I'm still waiting for comments on
> that one.

Well, it was included at the end of your diff, so I committed it.

Thanks!
-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE



Re: Use symbolic name instead of hardcoded value on telnet(1)

2015-11-20 Thread Ricardo Mestre
 while (--argc > 0) {
            if (**(++argv)== '-') {
switch (key = keyword(1 + *argv)) {

On 20/11/2015 12:44, Jérémie Courrèges-Anglas wrote:
> Ricardo Mestre  writes:
> 
>> Use symbolic name instead of hardcoded value on telnet(1):
> 
> Committed, thanks.
> 
>> Index: commands.c
>> ===
>> RCS file: /cvs/src/usr.bin/telnet/commands.c,v
>> retrieving revision 1.79
>> diff -u -p -u -r1.79 commands.c
>> --- commands.c   13 Nov 2015 17:04:48 -  1.79
>> +++ commands.c   20 Nov 2015 12:30:50 -
>> @@ -1192,7 +1192,7 @@ static void
>>  close_connection(void)
>>  {
>>  if (connected) {
>> -(void) shutdown(net, 2);
>> +(void) shutdown(net, SHUT_RDWR);
>>  printf("Connection closed.\r\n");
>>  (void)close(net);
>>  connected = 0;
>>
> 



Re: Use symbolic name instead of hardcoded value on telnet(1)

2015-11-20 Thread Jérémie Courrèges-Anglas
Ricardo Mestre  writes:

> Use symbolic name instead of hardcoded value on telnet(1):

Committed, thanks.

> Index: commands.c
> ===
> RCS file: /cvs/src/usr.bin/telnet/commands.c,v
> retrieving revision 1.79
> diff -u -p -u -r1.79 commands.c
> --- commands.c13 Nov 2015 17:04:48 -  1.79
> +++ commands.c20 Nov 2015 12:30:50 -
> @@ -1192,7 +1192,7 @@ static void
>  close_connection(void)
>  {
>   if (connected) {
> - (void) shutdown(net, 2);
> + (void) shutdown(net, SHUT_RDWR);
>   printf("Connection closed.\r\n");
>   (void)close(net);
>   connected = 0;
>

-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE



Use symbolic name instead of hardcoded value on telnet(1)

2015-11-20 Thread Ricardo Mestre
Use symbolic name instead of hardcoded value on telnet(1):

Index: commands.c
===
RCS file: /cvs/src/usr.bin/telnet/commands.c,v
retrieving revision 1.79
diff -u -p -u -r1.79 commands.c
--- commands.c  13 Nov 2015 17:04:48 -  1.79
+++ commands.c  20 Nov 2015 12:30:50 -
@@ -1192,7 +1192,7 @@ static void
 close_connection(void)
 {
if (connected) {
-   (void) shutdown(net, 2);
+   (void) shutdown(net, SHUT_RDWR);
printf("Connection closed.\r\n");
(void)close(net);
connected = 0;