https://bugzilla.novell.com/show_bug.cgi?id=728774
https://bugzilla.novell.com/show_bug.cgi?id=728774#c45
--- Comment #45 from Jeff Mahoney 2012-06-06 15:41:23 EDT ---
BTW this can be demonstrated with the following simple program. The open
statement will always fail with -ENXIO. dup() has nothing to do with it.
#include
#include
#include
#include
#include
#include
#include
#include
int
main(void)
{
int ret;
int fds[2];
int fd;
pid_t pid;
ret = socketpair(AF_UNIX, SOCK_STREAM, 0, fds);
if (ret < 0) {
perror("socketpair");
return 1;
}
close(2);
ret = dup2(fds[0], 2);
if (ret < 0) {
printf("dup2 failed; %d %s\n", ret, strerror(errno));
return 1;
}
fd = open("/dev/stderr", O_WRONLY);
if (fd < 0) {
printf("open failed; %d %s\n", ret, strerror(errno));
return 1;
}
close(fd);
close(fds[0]);
close(fds[1]);
return 0;
}
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.