* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#define RCSID "$Id: tty.c,v 1.13 2004/01/13 04:17:59 paulus Exp $"
+#define RCSID "$Id: tty.c,v 1.16 2004/10/28 00:16:37 paulus Exp $"
#include <stdio.h>
#include <ctype.h>
if (*cp == 0)
return 0;
- if (strncmp("/dev/", cp, 5) != 0) {
+ if (*cp != '/') {
strlcpy(dev, "/dev/", sizeof(dev));
strlcat(dev, cp, sizeof(dev));
cp = dev;
{
char *connector;
int fdflags;
+#ifndef __linux__
struct stat statbuf;
+#endif
char numbuf[16];
/*
#ifndef __linux__
if (tty_mode != (mode_t) -1) {
- if (fchmod(real_ttyfd, tty_mode) != 0) {
- /* XXX if devnam is a symlink, this will change the link */
- chmod(devnam, tty_mode);
- }
+ if (fchmod(real_ttyfd, tty_mode) != 0)
+ error("Couldn't restore tty permissions");
}
#endif /* __linux__ */