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

return value of system() function #48

Closed
seongsu opened this issue Aug 22, 2011 · 0 comments
Closed

return value of system() function #48

seongsu opened this issue Aug 22, 2011 · 0 comments
Assignees
Labels
Milestone

Comments

@seongsu
Copy link

seongsu commented Aug 22, 2011

Hi,

I found that the system() function in Dumbo always returns zero if the actual return value is less than 256. As you know, command 'hadoop fs -test -e' returns 1 if the given path do not exists. But the system() function returns zero in the case. I think '/ 256' should be removed in the code.

def system(cmd, stdout=sys.stdout, stderr=sys.stderr):
    if sys.version[:3] == '2.4':
        return os.system(cmd) / 256
    proc = subprocess.Popen(cmd, shell=True, stdout=stdout,
                            stderr=stderr)
    return os.waitpid(proc.pid, 0)[1] / 256

Please let me know what you think of this. Thanks.
Seongsu

@ghost ghost assigned klbostee Sep 9, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants