It's OK, if /dev/ptmx points to /dev/pts/ptmx via a symlink.
Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
static int setup_pts(int pts)
{
+ char target[PATH_MAX];
+
if (!pts)
return 0;
return -1;
}
+ if (realpath("/dev/ptmx", target) && !strcmp(target, "/dev/pts/ptmx"))
+ goto out;
+
/* fallback here, /dev/pts/ptmx exists just mount bind */
if (mount("/dev/pts/ptmx", "/dev/ptmx", "none", MS_BIND, 0)) {
SYSERROR("mount failed '/dev/pts/ptmx'->'/dev/ptmx'");