mirror of
https://github.com/adtools/clib2.git
synced 2025-12-08 14:59:05 +00:00
- File descriptors produced by dup() or dup2() now work exactly like
the original file descriptors they are duplicates of. I modified the function which maps file descriptor numbers to file descriptor table entries to return the table entries of the original files. - In the thread-safe library, duplicated stdin/stdout/stderr descriptors now work like the "real" ones. This is true even if the "real" ones were closed and only their former aliases remain. git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14909 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_remove_fd_alias.c,v 1.2 2005-02-28 13:22:53 obarthel Exp $
|
||||
* $Id: stdio_remove_fd_alias.c,v 1.3 2005-04-01 18:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -66,14 +66,22 @@ __remove_fd_alias(struct fd * fd)
|
||||
else if (fd->fd_NextLink != NULL) /* this one has aliases attached; it is the 'original' resource */
|
||||
{
|
||||
struct fd * first_alias;
|
||||
struct fd * next_alias;
|
||||
struct fd * list_fd;
|
||||
|
||||
/* The first link now becomes the original resource */
|
||||
first_alias = fd->fd_NextLink;
|
||||
next_alias = first_alias->fd_NextLink;
|
||||
|
||||
/* Structure copy... */
|
||||
(*first_alias) = (*fd);
|
||||
|
||||
/* Fix up the linkage. */
|
||||
first_alias->fd_NextLink = next_alias;
|
||||
first_alias->fd_Original = NULL;
|
||||
|
||||
/* The resources are migrated to the first link. */
|
||||
for(list_fd = first_alias->fd_NextLink ;
|
||||
for(list_fd = next_alias ;
|
||||
list_fd != NULL ;
|
||||
list_fd = list_fd->fd_NextLink)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user