Examples of newErrnoFromErrno()


Examples of org.jruby.Ruby.newErrnoFromErrno()

                    newlines--;
                    continue;
                }
                read_size = readInternal(context, this, fd, bufBytes, buf, rbuf.len + newlines);
                if (read_size < 0) {
                    throw runtime.newErrnoFromErrno(posix.errno, pathv);
                }
                if (read_size == rbuf.len) {
                    posix.lseek(fd, r, PosixShim.SEEK_SET);
                    break;
                } else {
View Full Code Here

Examples of org.jruby.Ruby.newErrnoFromErrno()

        PopenExecutor executor = new PopenExecutor();
        pid = executor.spawnProcess(context, runtime, eargp, errmsg);

        if (pid == -1) {
            if (errmsg[0] == null) {
                throw runtime.newErrnoFromErrno(executor.errno, fail_str.toString());
            }
            throw runtime.newErrnoFromErrno(executor.errno, errmsg[0]);
        }
        return runtime.newFixnum(pid);
    }
View Full Code Here

Examples of org.jruby.Ruby.newErrnoFromErrno()

        if (pid == -1) {
            if (errmsg[0] == null) {
                throw runtime.newErrnoFromErrno(executor.errno, fail_str.toString());
            }
            throw runtime.newErrnoFromErrno(executor.errno, errmsg[0]);
        }
        return runtime.newFixnum(pid);
    }

    // MRI: rb_spawn_internal
View Full Code Here

Examples of org.jruby.Ruby.newErrnoFromErrno()

        }
        Channel[] mainPipe = null, secondPipe = null;
        switch (fmode & (OpenFile.READABLE|OpenFile.WRITABLE)) {
            case OpenFile.READABLE | OpenFile.WRITABLE:
                if ((secondPipe = posix.pipe()) == null)
                    throw runtime.newErrnoFromErrno(posix.errno, prog.toString());
                if ((mainPipe = posix.pipe()) == null) {
                    e = posix.errno;
                    try {secondPipe[1].close();} catch (IOException ioe) {}
                    try {secondPipe[0].close();} catch (IOException ioe) {}
                    posix.errno = e;
View Full Code Here

Examples of org.jruby.Ruby.newErrnoFromErrno()

                if ((mainPipe = posix.pipe()) == null) {
                    e = posix.errno;
                    try {secondPipe[1].close();} catch (IOException ioe) {}
                    try {secondPipe[0].close();} catch (IOException ioe) {}
                    posix.errno = e;
                    throw runtime.newErrnoFromErrno(posix.errno, prog.toString());
                }

                if (eargp != null) prepareStdioRedirects(runtime, mainPipe, secondPipe, eargp);

                break;
View Full Code Here

Examples of org.jruby.Ruby.newErrnoFromErrno()

                if (eargp != null) prepareStdioRedirects(runtime, mainPipe, secondPipe, eargp);

                break;
            case OpenFile.READABLE:
                if ((mainPipe = posix.pipe()) == null)
                    throw runtime.newErrnoFromErrno(posix.errno, prog.toString());

                if (eargp != null) prepareStdioRedirects(runtime, mainPipe, null, eargp);

                break;
            case OpenFile.WRITABLE:
View Full Code Here

Examples of org.jruby.Ruby.newErrnoFromErrno()

                if (eargp != null) prepareStdioRedirects(runtime, mainPipe, null, eargp);

                break;
            case OpenFile.WRITABLE:
                if ((mainPipe = posix.pipe()) == null)
                    throw runtime.newErrnoFromErrno(posix.errno, prog.toString());

                if (eargp != null) prepareStdioRedirects(runtime, null, mainPipe, eargp);

                break;
            default:
View Full Code Here

Examples of org.jruby.Ruby.newErrnoFromErrno()

            if ((fmode & (OpenFile.READABLE|OpenFile.WRITABLE)) == (OpenFile.READABLE|OpenFile.WRITABLE)) {
                try {mainPipe[1].close();} catch (IOException ioe) {}
                try {mainPipe[0].close();} catch (IOException ioe) {}
            }
            errno = e;
            throw runtime.newErrnoFromErrno(errno, prog.toString());
        }
        if ((fmode & OpenFile.READABLE) != 0 && (fmode & OpenFile.WRITABLE) != 0) {
            try {mainPipe[1].close();} catch (IOException ioe) {}
            fd = mainPipe[0];
            try {secondPipe[0].close();} catch (IOException ioe) {}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.