This repository was archived by the owner on Feb 8, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -313,16 +313,12 @@ static int container_setup_mount(struct hyper_container *container)
313313 return -1 ;
314314 }
315315
316- if (unlink ("./dev/ptmx" ) < 0 ) {
317- perror ("remove /dev/ptmx failed" );
318- return -1 ;
319- }
320- if (symlink ("/dev/pts/ptmx" , "./dev/ptmx" ) < 0 ) {
316+ /* all containers share the same devtmpfs, so we need to ignore the errno EEXIST */
317+ if (symlink ("/dev/pts/ptmx" , "./dev/ptmx" ) < 0 && errno != EEXIST ) {
321318 perror ("link /dev/pts/ptmx to /dev/ptmx failed" );
322319 return -1 ;
323320 }
324321
325- /* all containers share the same devtmpfs, so we need to ignore the errno EEXIST */
326322 if ((symlink ("/proc/self/fd" , "./dev/fd" ) < 0 && errno != EEXIST ) ||
327323 (symlink ("/proc/self/fd/0" , "./dev/stdin" ) < 0 && errno != EEXIST ) ||
328324 (symlink ("/proc/self/fd/1" , "./dev/stdout" ) < 0 && errno != EEXIST ) ||
Original file line number Diff line number Diff line change @@ -475,9 +475,9 @@ static int hyper_setup_shared(struct hyper_pod *pod)
475475
476476static int hyper_setup_pod (struct hyper_pod * pod )
477477{
478- /* create tmp proc directory */
479- if (hyper_mkdir ("/tmp/hyper/proc " , 0755 ) < 0 ) {
480- perror ("create tmp proc failed" );
478+ /* create sandbox directory */
479+ if (hyper_mkdir ("/tmp/hyper" , 0755 ) < 0 ) {
480+ perror ("create sandbox directory failed" );
481481 return -1 ;
482482 }
483483
@@ -1366,6 +1366,15 @@ int main(int argc, char *argv[])
13661366 return -1 ;
13671367 }
13681368
1369+ if (unlink ("/dev/ptmx" ) < 0 ) {
1370+ perror ("remove /dev/ptmx failed" );
1371+ return -1 ;
1372+ }
1373+ if (symlink ("/dev/pts/ptmx" , "/dev/ptmx" ) < 0 ) {
1374+ perror ("link /dev/pts/ptmx to /dev/ptmx failed" );
1375+ return -1 ;
1376+ }
1377+
13691378 cmdline = read_cmdline ();
13701379
13711380 setsid ();
You can’t perform that action at this time.
0 commit comments