Sent it in private again... Maybe a reply-to is missing ?

----- Forwarded message from Balazs Scheidler <[EMAIL PROTECTED]> -----

Date: Sat, 8 Jan 2000 14:20:09 +0100
From: Balazs Scheidler <[EMAIL PROTECTED]>
To: "Eric J. Schwertfeger" <[EMAIL PROTECTED]>
Subject: Re: How to set up lsh?

> 
> That was the problem.  I deleted the file, ran lsh, and had no garbage in
> the file. Ran lsh again, and still no garbage. Replaced captured_keys with
> 100 lines of "testing\n", this time got garbage at the end of the line.
> 
> Looked at the truss output:
> 
> syscall open("/home/ejs/.lsh/captured_keys",521,0600)
> 
>       521 is O_APPEND|O_CREAT|O_WRONLY so that looks right.
> 
> syscall fcntl(0x6,0x4,0x4)
> 
>       0x4 is F_SETFL
> 
> syscall fcntl(0x6,0x2,0x1)
> 
>       0x2 is F_SETFD

This must be the problem. According to linux manpage:

       F_SETFL  Set the descriptor's flags to the value specified
                by arg.  Only O_APPEND,  O_NONBLOCK  and  O_ASYNC
                may be set; the other flags are unaffected.

So O_APPEND must be present here as well, this patch should fix the problem
(against lsh-000.2):

--- io.c~       Sun Dec 12 20:32:03 1999
+++ io.c        Sat Jan  8 14:15:46 2000
@@ -913,7 +913,7 @@

 void io_set_nonblocking(int fd)
 {
-  if (fcntl(fd, F_SETFL, O_NONBLOCK) < 0)
+  if (fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_NONBLOCK) < 0)
     fatal("io_set_nonblocking: fcntl() failed, %z", STRERROR(errno));
 }


-- 
Bazsi
PGP info: KeyID 9AF8D0A9 Fingerprint CD27 CFB0 802C 0944 9CFD 804E C82C 8EB1
     url: http://www.balabit.hu/pgpkey.txt

----- End forwarded message -----

-- 
Bazsi
PGP info: KeyID 9AF8D0A9 Fingerprint CD27 CFB0 802C 0944 9CFD 804E C82C 8EB1
     url: http://www.balabit.hu/pgpkey.txt

Reply via email to