<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rneovim.git/src/nvim/os, branch v0.1.7</title>
<subtitle>Neovim fork with Rahm's personal hacks.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/'/>
<entry>
<title>shell_write_cb: Schedule error message. (#5670)</title>
<updated>2016-11-26T12:08:42+00:00</updated>
<author>
<name>Justin M. Keyes</name>
<email>justinkz@gmail.com</email>
</author>
<published>2016-11-26T12:08:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=7be113d7959df83bdec1e4d9a3e98264bc5d7a5b'/>
<id>7be113d7959df83bdec1e4d9a3e98264bc5d7a5b</id>
<content type='text'>
Closes #5558</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Closes #5558</pre>
</div>
</content>
</entry>
<entry>
<title>os_nodetype: open fd with O_NONBLOCK (#5515)</title>
<updated>2016-10-21T20:03:01+00:00</updated>
<author>
<name>Justin M. Keyes</name>
<email>justinkz@gmail.com</email>
</author>
<published>2016-10-21T20:03:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=1ff162c0d99c67043e8b10704e2426192e4f2abf'/>
<id>1ff162c0d99c67043e8b10704e2426192e4f2abf</id>
<content type='text'>
Closes #5267

Helped-by: oni-link &lt;knil.ino@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Closes #5267

Helped-by: oni-link &lt;knil.ino@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>system('foo &amp;', 'bar'): Show error, don't crash.</title>
<updated>2016-10-18T23:39:05+00:00</updated>
<author>
<name>Justin M. Keyes</name>
<email>justinkz@gmail.com</email>
</author>
<published>2016-10-18T12:39:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=9706664b8827614817a43f3a4ac4b6ae8463a906'/>
<id>9706664b8827614817a43f3a4ac4b6ae8463a906</id>
<content type='text'>
Closes #3529
Closes #5241

In Vim,
    :echo system('cat - &amp;', 'foo')
works because for both system() and :! Vim writes input to a temp file and uses
shell syntax to redirect the file to the backgrounded `cat` (get_cmd_output()
.. make_filter_cmd()).

In Nvim,
    :echo system('cat - &amp;', 'foo')
fails because we write the input directly via pipes (shell.c:do_os_system()),
but (per POSIX[1]) backgrounded process input stream is redirected from
/dev/null (unless overridden by shell redirection; supported only by some shells
[2]), so our writes are ignored, the process exits quickly, and if we are
writing data larger than the buffer size we'll see EPIPE.

This still works:
    :%w !tee &gt; foo1358.txt &amp;
but this does not:
    :%w !tee foo1358.txt &amp;
though it *should* (why doesn't it?) because we still do the temp file dance
in do_bang() .. do_filter().

[1] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_03_02
[2] http://unix.stackexchange.com/a/71218
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Closes #3529
Closes #5241

In Vim,
    :echo system('cat - &amp;', 'foo')
works because for both system() and :! Vim writes input to a temp file and uses
shell syntax to redirect the file to the backgrounded `cat` (get_cmd_output()
.. make_filter_cmd()).

In Nvim,
    :echo system('cat - &amp;', 'foo')
fails because we write the input directly via pipes (shell.c:do_os_system()),
but (per POSIX[1]) backgrounded process input stream is redirected from
/dev/null (unless overridden by shell redirection; supported only by some shells
[2]), so our writes are ignored, the process exits quickly, and if we are
writing data larger than the buffer size we'll see EPIPE.

This still works:
    :%w !tee &gt; foo1358.txt &amp;
but this does not:
    :%w !tee foo1358.txt &amp;
though it *should* (why doesn't it?) because we still do the temp file dance
in do_bang() .. do_filter().

[1] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_03_02
[2] http://unix.stackexchange.com/a/71218
</pre>
</div>
</content>
</entry>
<entry>
<title>event/multiqueue.c: Rename "queue" to "multiqueue".</title>
<updated>2016-10-01T22:24:49+00:00</updated>
<author>
<name>Justin M. Keyes</name>
<email>justinkz@gmail.com</email>
</author>
<published>2016-09-29T15:09:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=6186df3562e33e92f04ed8c850204ceabc4746e1'/>
<id>6186df3562e33e92f04ed8c850204ceabc4746e1</id>
<content type='text'>
`lib/queue.h` implements a basic queue. `event/queue.c` implements
a specialized data structure on top of lib/queue.h; it is not a "normal"
queue.

Rename the specialized multi-level queue implemented in event/queue.c to
"multiqueue", to avoid confusion when reading the code.

Before this change one can eventually notice that "macros (uppercase
symbols) are for the normal queue, lowercase operations are for the
multi-level queue", but that is unnecessary friction for new developers
(or existing developers just visiting this part of the codebase).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`lib/queue.h` implements a basic queue. `event/queue.c` implements
a specialized data structure on top of lib/queue.h; it is not a "normal"
queue.

Rename the specialized multi-level queue implemented in event/queue.c to
"multiqueue", to avoid confusion when reading the code.

Before this change one can eventually notice that "macros (uppercase
symbols) are for the normal queue, lowercase operations are for the
multi-level queue", but that is unnecessary friction for new developers
(or existing developers just visiting this part of the codebase).
</pre>
</div>
</content>
</entry>
<entry>
<title>doc: minor comment tweaks</title>
<updated>2016-09-28T01:01:57+00:00</updated>
<author>
<name>Justin M. Keyes</name>
<email>justinkz@gmail.com</email>
</author>
<published>2016-09-26T17:31:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=9c2f4ce20d4ab36b17887ae927bab73432565515'/>
<id>9c2f4ce20d4ab36b17887ae927bab73432565515</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>refactor: eliminate misc2.c</title>
<updated>2016-09-13T14:20:09+00:00</updated>
<author>
<name>Justin M. Keyes</name>
<email>justinkz@gmail.com</email>
</author>
<published>2016-09-11T02:01:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=df072c3b2b20fb7d3d9d50b5ab0df92827aa628f'/>
<id>df072c3b2b20fb7d3d9d50b5ab0df92827aa628f</id>
<content type='text'>
move `call_shell` to misc1.c
Move some fns to state.c
Move some fns to option.c
Move some fns to memline.c
Move `vim_chdir*` fns to file_search.c
Move some fns to new module, bytes.c
Move some fns to fileio.c
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
move `call_shell` to misc1.c
Move some fns to state.c
Move some fns to option.c
Move some fns to memline.c
Move `vim_chdir*` fns to file_search.c
Move some fns to new module, bytes.c
Move some fns to fileio.c
</pre>
</div>
</content>
</entry>
<entry>
<title>shell_escape: rename; refactor</title>
<updated>2016-09-11T01:04:57+00:00</updated>
<author>
<name>Justin M. Keyes</name>
<email>justinkz@gmail.com</email>
</author>
<published>2016-09-10T23:50:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=395ef5642e6e61d8f59d1ef67dd7d203b9bb72e6'/>
<id>395ef5642e6e61d8f59d1ef67dd7d203b9bb72e6</id>
<content type='text'>
- rename to shell_xescape_xquote
- move to os/shell.c
- disallow NULL argument
- eliminate casts, nesting
- test: empty shellxquote/shellxescape
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- rename to shell_xescape_xquote
- move to os/shell.c
- disallow NULL argument
- eliminate casts, nesting
- test: empty shellxquote/shellxescape
</pre>
</div>
</content>
</entry>
<entry>
<title>system(): Respect 'sxe' and 'sxq' #2789</title>
<updated>2016-09-10T20:21:40+00:00</updated>
<author>
<name>Zhaosheng Pan</name>
<email>brglng@gmail.com</email>
</author>
<published>2015-06-03T11:01:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=0991041ae72e866add2a820a6b0401d21b9a8fab'/>
<id>0991041ae72e866add2a820a6b0401d21b9a8fab</id>
<content type='text'>
Fixes #2773
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes #2773
</pre>
</div>
</content>
</entry>
<entry>
<title>signal_init: unblock all signals on startup. #5283</title>
<updated>2016-09-03T23:16:23+00:00</updated>
<author>
<name>Nicolas Hillegeer</name>
<email>nicolas@hillegeer.com</email>
</author>
<published>2016-09-01T21:24:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=a9c5423263d876d2ff65b18b81ee3b323bf0577d'/>
<id>a9c5423263d876d2ff65b18b81ee3b323bf0577d</id>
<content type='text'>
As discussed on #5243 and #5283.

Helped-by: John Szakmeister &lt;john@szakmeister.net&gt;
Helped-by: Justin M. Keyes &lt;justinkz@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As discussed on #5243 and #5283.

Helped-by: John Szakmeister &lt;john@szakmeister.net&gt;
Helped-by: Justin M. Keyes &lt;justinkz@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>signal_init: Always unblock SIGCHLD. (#5243)</title>
<updated>2016-08-29T17:39:32+00:00</updated>
<author>
<name>Justin M. Keyes</name>
<email>justinkz@gmail.com</email>
</author>
<published>2016-08-29T17:39:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=10a54ad12e2d78c629220c4266066cf9b997d684'/>
<id>10a54ad12e2d78c629220c4266066cf9b997d684</id>
<content type='text'>
Inherited signal mask may block SIGCHLD, which causes libuv to hang at
epoll_wait.

Closes #5230

Helped-by: Nicolas Hillegeer &lt;nicolas@hillegeer.com&gt;
Helped-by: John Szakmeister &lt;john@szakmeister.net&gt;

Note: the #pragma gymnastics are a workaround for broken system headers on
macOS.

  signal.h:
      int  sigaddset(sigset_t *, int);
      #define     sigaddset(set, signo)   (*(set) |= __sigbits(signo), 0)
  sys/_types/_sigset.h:
      typedef __darwin_sigset_t            sigset_t;
  sys/_types.h:
      typedef __uint32_t   __darwin_sigset_t;      /* [???] signal set */

sigset_t is defined as unsigned int, but the sigaddset() ORs it with an int,
mixing the types.  So GCC generates a sign-conversion warning:

  sig.c:9:13: warning: implicit conversion changes signedness: 'int' to 'unsigned int' [-Wsign-conversion]
    (*(&amp;s) |= __sigbits((sigset_t) 20), 0);
           ~~ ^~~~~~~~~~~~~~~~~~~~~~~~
  1 warning generated.

System headers are normally ignored when the compiler generates warnings:
https://gcc.gnu.org/onlinedocs/cpp/System-Headers.html

  &gt; GCC gives code found in system headers special treatment. All warnings,
  &gt; other than those generated by ‘#warning’ (see Diagnostics), are suppressed
  &gt; while GCC is processing a system header. Macros defined in a system header
  &gt; are immune to a few warnings wherever they are expanded. This immunity is
  &gt; granted on an ad-hoc basis, when we find that a warning generates lots of
  &gt; false positives because of code in macros defined in system headers.

Instead of the #pragma workaround, we could cast the sigset_t pointer:

    # if defined(__APPLE__)
      sigaddset((int *)&amp;mask, SIGCHLD);
    # else
      sigaddset(&amp;mask, SIGCHLD);
    # endif

but that could break if the headers are later fixed.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Inherited signal mask may block SIGCHLD, which causes libuv to hang at
epoll_wait.

Closes #5230

Helped-by: Nicolas Hillegeer &lt;nicolas@hillegeer.com&gt;
Helped-by: John Szakmeister &lt;john@szakmeister.net&gt;

Note: the #pragma gymnastics are a workaround for broken system headers on
macOS.

  signal.h:
      int  sigaddset(sigset_t *, int);
      #define     sigaddset(set, signo)   (*(set) |= __sigbits(signo), 0)
  sys/_types/_sigset.h:
      typedef __darwin_sigset_t            sigset_t;
  sys/_types.h:
      typedef __uint32_t   __darwin_sigset_t;      /* [???] signal set */

sigset_t is defined as unsigned int, but the sigaddset() ORs it with an int,
mixing the types.  So GCC generates a sign-conversion warning:

  sig.c:9:13: warning: implicit conversion changes signedness: 'int' to 'unsigned int' [-Wsign-conversion]
    (*(&amp;s) |= __sigbits((sigset_t) 20), 0);
           ~~ ^~~~~~~~~~~~~~~~~~~~~~~~
  1 warning generated.

System headers are normally ignored when the compiler generates warnings:
https://gcc.gnu.org/onlinedocs/cpp/System-Headers.html

  &gt; GCC gives code found in system headers special treatment. All warnings,
  &gt; other than those generated by ‘#warning’ (see Diagnostics), are suppressed
  &gt; while GCC is processing a system header. Macros defined in a system header
  &gt; are immune to a few warnings wherever they are expanded. This immunity is
  &gt; granted on an ad-hoc basis, when we find that a warning generates lots of
  &gt; false positives because of code in macros defined in system headers.

Instead of the #pragma workaround, we could cast the sigset_t pointer:

    # if defined(__APPLE__)
      sigaddset((int *)&amp;mask, SIGCHLD);
    # else
      sigaddset(&amp;mask, SIGCHLD);
    # endif

but that could break if the headers are later fixed.</pre>
</div>
</content>
</entry>
</feed>
