Check return value of KDE::chmod

wilder-portage
Kurt Hindenburg 12 years ago
parent b9b17cae4d
commit fbffd35c31
  1. 13
      src/Pty.cpp

@ -262,10 +262,15 @@ void Pty::setWriteable(bool writeable)
{
KDE_struct_stat sbuf;
KDE::stat(pty()->ttyName(), &sbuf);
if (writeable)
KDE::chmod(pty()->ttyName(), sbuf.st_mode | S_IWGRP);
else
KDE::chmod(pty()->ttyName(), sbuf.st_mode & ~(S_IWGRP | S_IWOTH));
if (writeable) {
if (KDE::chmod(pty()->ttyName(), sbuf.st_mode | S_IWGRP) < 0) {
kWarning() << "Could not set writeable on "<<pty()->ttyName();
}
} else {
if (KDE::chmod(pty()->ttyName(), sbuf.st_mode & ~(S_IWGRP | S_IWOTH)) < 0) {
kWarning() << "Could not unset writeable on "<<pty()->ttyName();
}
}
}
void Pty::closePty()

Loading…
Cancel
Save