Mercurial > hg > octave-nkf
diff libqterminal/unix/kpty.cpp @ 15670:d79d1a3130c8
Fix for building on MacOS.
author | Jacob Dawid <jacob.dawid@googlemail.com> |
---|---|
date | Sat, 02 Jun 2012 16:33:49 +0200 |
parents | f2b81e8a4ab5 |
children | a182972304fa |
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";