From f393ff40ef49c582f614ff44107d1132753693a1 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Sat, 12 May 2007 18:00:57 +1000 Subject: [REDIR] Replace copyfd by savefd and use dup2 elsewhere There are two kinds of users to copyfd, those that want to copy an fd to an exact value and those that want to move an fd to a value >= 10. The former can simply use dup2 directly while the latter share a lot of common code that now constitutes savefd. --- src/jobs.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'src/jobs.c') diff --git a/src/jobs.c b/src/jobs.c index 9e28adb..7285d0d 100644 --- a/src/jobs.c +++ b/src/jobs.c @@ -188,18 +188,14 @@ setjobctl(int on) if (on == jobctl || rootshell == 0) return; if (on) { - int ofd; - ofd = fd = open(_PATH_TTY, O_RDWR); + fd = open(_PATH_TTY, O_RDWR); if (fd < 0) { fd += 3; - while (!isatty(fd) && --fd >= 0) - ; + while (!isatty(fd)) + if (--fd < 0) + goto out; } - fd = fcntl(fd, F_DUPFD, 10); - close(ofd); - if (fd < 0) - goto out; - fcntl(fd, F_SETFD, FD_CLOEXEC); + fd = savefd(fd); do { /* while we are in the background */ if ((pgrp = tcgetpgrp(fd)) < 0) { out: -- cgit 1.4.1 0d8799c995dc4ffc7bcc7c4067c1244'>tree commit diff
path: root/bundle/badwolf (unfollow)
Commit message (Collapse)Author
2013-03-24Add paredit.vimJune McEnroe
2013-03-14Update base16-vimJune McEnroe
It's still crap
2013-03-12Hide mode from below statuslineJune McEnroe
2013-03-12Switch to powerlineJune McEnroe
Which I'm not going to bother configuring because it thinks it's all fancy and for other things that aren't Vim so it stores its config file in ~/.config which I keep in a different repo and I only want to use it for Vim so fuck you, Powerline. </rant>
2013-03-12Remove vim-powerlineJune McEnroe
2013-02-03Update base16 and refheapJune McEnroe
2013-02-03Ignore plugin/private.vimJune McEnroe
2012-09-29Disable GUI dialogsJune McEnroe