This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 3/5] linux ttyname and ttyname_r: Add tests [BZ #22145]


On Wed, 11 Oct 2017 23:53:19 -0400,
Luke Shumaker wrote:
> +  
> +  VERIFY (mount ("/console", "/dev/console", NULL, MS_BIND, NULL) == 0);
> +  xmkdir ("/oldpts", 0755);
> +  VERIFY (mount ("/dev/pts", "/oldpts", NULL, MS_MOVE, NULL) == 0);
> +  xclose (xopen ("/dev/pts/trap", O_WRONLY|O_CREAT|O_NOCTTY, 0));
> +  char *path = xasprintf("/oldpts/%s", strrchr(slavename, '/')+1);
> +  VERIFY (mount (path, "/dev/pts/trap", NULL, MS_BIND, NULL) == 0);
> +  free(path);
> +  ok = doit (slave, "with search-path trap",
> +	     (struct result_r){.name="/dev/console", .ret=0, .err=0}) && ok;
> +  VERIFY (umount ("/dev/pts/trap") == 0);
> +  VERIFY (unlink ("/dev/pts/trap") == 0);
> +  VERIFY (umount ("/dev/console") == 0);
> +

When re-ordering the commits, I realized that the "wrong" commit fixed
this test, which means it wasn't really testing what I wanted it to be
testing.  Once I work that out, I'll submit v2 of the patchset with
all of the feedback I've gotten.

-- 
Happy hacking,
~ Luke Shumaker


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]