Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't compile in cygwin #92

Closed
Milly opened this issue Dec 4, 2013 · 7 comments
Closed

Can't compile in cygwin #92

Milly opened this issue Dec 4, 2013 · 7 comments

Comments

@Milly
Copy link
Contributor

Milly commented Dec 4, 2013

7bbe961 において追加された Ignore tty 処理で使われている TIOCNOTTY が Cygwin には無いためコンパイルエラーとなります。

同じようなことで修正されてるソースがあったので以下の様にしてみました。
これで以下の環境で動作しています。

  • Windows8.1 CYGWIN_NT-6.2 1.7.25(0.270/5/3) x86_64
--- a/autoload/proc.c
+++ b/autoload/proc.c
@@ -486,6 +486,9 @@ vp_pipe_open(char *args)
         }

         {
+#ifdef __CYGWIN__
+            setsid();
+#else
             /* Ignore tty. */
             char name[L_ctermid];
             if (ctermid(name)[0] != '\0') {
@@ -495,6 +498,7 @@ vp_pipe_open(char *args)
                     close(tfd);
                 }
             }
+#endif
         }

         argv = malloc(sizeof(char *) * (argc+1));
@ichizok
Copy link
Collaborator

ichizok commented Dec 5, 2013

#ifdef __CYGWIN__ より #ifndef TIOCNOTTY でガードした方がいいですね

@Milly
Copy link
Contributor Author

Milly commented Dec 5, 2013

tty 切り離すのに setsid() 使うのは Cygwin だけなんですかね?
#else~#endif の間で改めて #ifdef TIOCNOTTY したほうがいいのかな(切り離すのあきらめるとして)

@ichizok
Copy link
Collaborator

ichizok commented Dec 5, 2013

単純に TIOCNOTTY がなければ setsid() でいいと思います。
TIOCNOTTY があるなら、セッション作らずにttyを切り離せるということなので

@Milly
Copy link
Contributor Author

Milly commented Dec 5, 2013

なるほどです 👍

@Shougo Shougo closed this as completed in b2bb6d3 Dec 5, 2013
@Shougo
Copy link
Owner

Shougo commented Dec 5, 2013

修正しました。確認をおねがいします。

@Milly
Copy link
Contributor Author

Milly commented Dec 5, 2013

Cygwin でのコンパイル、動作に問題ありません。
ありがとうございました。

@Shougo
Copy link
Owner

Shougo commented Dec 5, 2013

了解です

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants