<p>OK, so... I could add <code>open</code> and <code>dup2</code>. But maybe a better option is to add a higher level call like <code>util.close_stderr</code> that would do</p>

<pre><code>   if (!have_forked)
    return luaL_error(L, "exec not permitted in this context");
   fd = open('/dev/null', 'w');
   if (fd == 2)
       return pushresult(L, 0, NULL);
   return pushresult(L, dup2(fd, 2), NULL);
</code></pre>

<p>and similar for <code>util.close_stdout</code>. This should be easy to use in scriptlets and hard to abuse.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/rpm-software-management/rpm/pull/44#issuecomment-191387511">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ANb80-ACDf1yXuq-y6JgmQ5neq-n7p1iks5ppeUwgaJpZM4HFPFo.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/rpm-software-management/rpm/pull/44#issuecomment-191387511"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>