]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
use ptmxmode mount option
authorCedric Le Goater <clg@fr.ibm.com>
Thu, 27 May 2010 14:16:30 +0000 (16:16 +0200)
committerDaniel Lezcano <dlezcano@fr.ibm.com>
Thu, 27 May 2010 14:16:30 +0000 (16:16 +0200)
Save one call by using the ptmxmode mount option.

Signed-off-by: Cedric Le Goater <clg@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
src/lxc/conf.c

index e7c93c0ed899de68a411df46c6206a48a504675b..f4ed89609025810a0fc9050e76e3a1b832c57a61 100644 (file)
@@ -623,16 +623,11 @@ static int setup_pts(int pts)
                return -1;
        }
 
-       if (mount("devpts", "/dev/pts", "devpts", MS_MGC_VAL, "newinstance")) {
+       if (mount("devpts", "/dev/pts", "devpts", MS_MGC_VAL, "newinstance,ptmxmode=0666")) {
                SYSERROR("failed to mount a new instance of '/dev/pts'");
                return -1;
        }
 
-       if (chmod("/dev/pts/ptmx", 0666)) {
-               SYSERROR("failed to set permission for '/dev/pts/ptmx'");
-               return -1;
-       }
-
        if (access("/dev/ptmx", F_OK)) {
                if (!symlink("/dev/pts/ptmx", "/dev/ptmx"))
                        goto out;