Mercurial > hg > octave-shane
changeset 15670:d79d1a3130c8
Fix for building on MacOS.
author | Jacob Dawid <jacob.dawid@googlemail.com> |
---|---|
date | Sat, 02 Jun 2012 16:33:49 +0200 |
parents | a8ff19a82906 |
children | 14da85a0d1c3 |
files | libqterminal/unix/kpty.cpp |
diffstat | 1 files changed, 15 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/libqterminal/unix/kpty.cpp +++ b/libqterminal/unix/kpty.cpp @@ -61,14 +61,17 @@ #include <unistd.h> #include <grp.h> -#if defined(HAVE_PTY_H) -# include <pty.h> -#endif - -#ifdef HAVE_LIBUTIL_H -# include <libutil.h> -#elif defined(HAVE_UTIL_H) +#ifdef Q_OS_MAC # include <util.h> +#else +# if defined(HAVE_PTY_H) +# include <pty.h> +# endif +# ifdef HAVE_LIBUTIL_H +# include <libutil.h> +# elif defined(HAVE_UTIL_H) +# include <util.h> +# endif #endif /* @@ -305,16 +308,16 @@ p = getgrnam("wheel"); gid_t gid = p ? p->gr_gid : getgid (); - if (!chown(d->ttyName.data(), getuid(), gid)) { - chmod(d->ttyName.data(), S_IRUSR|S_IWUSR|S_IWGRP); - } + if (!chown(d->ttyName.data(), getuid(), gid)) { + chmod(d->ttyName.data(), S_IRUSR|S_IWUSR|S_IWGRP); + } } goto gotpty; } ::close(d->masterFd); d->masterFd = -1; - } - } + } + } } qWarning() << "Can't open a pseudo teletype";