[ 
https://issues.apache.org/jira/browse/SQOOP-339?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13106878#comment-13106878
 ] 

Joseph Boyd commented on SQOOP-339:
-----------------------------------

Rather than test the OS variable, could we just run the 'mknod' command, and 
then run the 'mkfifo' command if mknod fails (returns non-zero)?  This would 
allow the fix to work on other (BSD-ish?) systems that may not have mknod with 
fifo options.

This is the approach used within gnu coreutils itself 
(coreutils-8.13/src/copy.c)
  [ http://ftp.gnu.org/gnu/coreutils/coreutils-8.13.tar.gz ]


I don't have a strong opinion either way, as I'm not at all sure these things 
are run on non-linux and non-mac os's very often.



> Use of non-portable mknod utility causes build problems on Mac OS X
> -------------------------------------------------------------------
>
>                 Key: SQOOP-339
>                 URL: https://issues.apache.org/jira/browse/SQOOP-339
>             Project: Sqoop
>          Issue Type: Bug
>    Affects Versions: 1.3.0, 1.4.0
>            Reporter: Joseph Boyd
>            Assignee: Joey Echeverria
>            Priority: Minor
>         Attachments: SQOOP-339-1.patch, SQOOP-339-2.patch
>
>
> Duplicating this issue from SQOOP-175, which is in the cloudera JIRA
> From SQOOP-175's description by Ken Krugler :
> On Mac OS X 10.6.3, the TestNamedFifo.testNamedFifo() test fails. The error 
> is caused by the Shell.execCommand() use of mknod, since (at least on my Mac) 
> mknod doesn't know about the --mode=xxx parameter or the -p parameters.
> Based on 
> http://stackoverflow.com/questions/4546356/is-mknod-portable-if-not-what-is-the-alternative,
>  I switched the code to use mkfifo and it now passes all tests.
> The change to NamedFifo.create() is trivial:
> Shell.execCommand("mkfifo", "-m", "0" + modeStr, filename);
> But I have no way of trying this out on other OSes, so it might create a 
> different compatibility issue.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to