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

stty --version check fails with Busybox #12

Open
GoogleCodeExporter opened this issue Dec 1, 2015 · 1 comment
Open

stty --version check fails with Busybox #12

GoogleCodeExporter opened this issue Dec 1, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

The test for stty is not working if we use Busybox. That one doesn't have a 
--version parameter. The solution is to check if the program is available 
without directly calling it. The following patch is working for me:

<pre>
--- php_serial.class.php.orig
+++ php_serial.class.php
@@ -49,7 +49,7 @@
        {
            $this->_os = "linux";

-           if($this->_exec("stty --version") === 0)
+           if($this->_exec("which stty", $output) === 0)
            {
                register_shutdown_function(array($this, "deviceClose"));
            }
</pre>

Original issue reported on code.google.com by [email protected] on 4 Oct 2012 at 11:36

@GoogleCodeExporter
Copy link
Author

Forget the $output. That was used in my debugging :). The correct patch is as 
follow:

<pre>
--- php_serial.class.php.orig
+++ php_serial.class.php
@@ -49,7 +49,7 @@
        {
            $this->_os = "linux";

-           if($this->_exec("stty --version") === 0)
+           if($this->_exec("which stty") === 0)
            {
                register_shutdown_function(array($this, "deviceClose"));
            }
</pre>

Original comment by [email protected] on 4 Oct 2012 at 11:40

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

No branches or pull requests

1 participant