Re: [dev] [st] [PATCH] Replace close and dup with dup2.

2015-05-05 Thread suigin
On Mon, May 04, 2015 at 12:47:38PM +0200, Roberto E. Vargas wrote: > > > > Second I don't have any warning with any of the compilers I use. > > > > Good for you. How is that in any way relevant? There is no prescribed > > compiler, is there? Also, the idea with this sort of distribution model > >

Re: [dev] [st] [PATCH] Replace close and dup with dup2.

2015-05-04 Thread Alex Pilon
> > > Second I don't have any warning with any of the compilers I use. > > > > Good for you. How is that in any way relevant? There is no prescribed > > compiler, is there? Also, the idea with this sort of distribution model > > is that the users also catch things that the maintainer won't. > > I w

Re: [dev] [st] [PATCH] Replace close and dup with dup2.

2015-05-04 Thread Roberto E. Vargas
> > Second I don't have any warning with any of the compilers I use. > > Good for you. How is that in any way relevant? There is no prescribed > compiler, is there? Also, the idea with this sort of distribution model > is that the users also catch things that the maintainer won't. I wanted to sa

Re: [dev] [st] [PATCH] Replace close and dup with dup2.

2015-04-29 Thread Connor Lane Smith
Hi, I'm personally in favour of using dup2. It is quite clear that dup2(cmdfd, STDIN_FILENO) duplicates the fd into the position of STDIN_FILENO. That's what it says. On the other hand, the combination of close(STDIN_FILENO) and dup(cmdfd) is less efficient (two syscalls) and also means that the r

Re: [dev] [st] [PATCH] Replace close and dup with dup2.

2015-04-27 Thread Alex Pilon
On Mon, Apr 27, 2015 at 10:55:48AM +0200, Roberto E. Vargas Caballero wrote: > > Matter of style maybe. It's still annoying to have noise in the build. > > I don't admit this types of commits about quiting some compiler. Ideally, that's fine, and I'd very much agree with you. However, practically,

Re: [dev] [st] [PATCH] Replace close and dup with dup2.

2015-04-27 Thread Roberto E. Vargas Caballero
Hi, > Matter of style maybe. It's still annoying to have noise in the build. I don't admit this types of commits about quiting some compiler. First point, warnings are not part of the standard, so you are free of take care of them or not. If you don't like to have noise add some flags to your lo

Re: [dev] [st] [PATCH] Replace close and dup with dup2.

2015-04-22 Thread Alex Pilon
On Wed, Apr 22, 2015 at 09:28:10AM +0200, Roberto E. Vargas Caballero wrote: > We don't have any opportunity of having a race condition, so there is > no reason to use dup2 instead of dup. So I wil keep the current > version. Matter of style maybe. It's still annoying to have noise in the build.

Re: [dev] [st] [PATCH] Replace close and dup with dup2.

2015-04-22 Thread Roberto E. Vargas Caballero
We don't have any opportunity of having a race condition, so there is no reason to use dup2 instead of dup. So I wil keep the current version.

[dev] [st] [PATCH] Replace close and dup with dup2.

2015-04-21 Thread noname
--- st.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/st.c b/st.c index 0204b2e..adf0b62 100644 --- a/st.c +++ b/st.c @@ -1298,8 +1298,7 @@ ttynew(void) { if (opt_line) { if((cmdfd = open(opt_line, O_RDWR)) < 0) die("open lin