Skip to content

Conversation

@nkremerh
Copy link
Contributor

No description provided.

nkremerh added 3 commits May 11, 2018 09:56
Modifies printing of environment to append rather than clobber
Removes print of entire environment on invocation
}
}

if(!logfile_name) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a lot of code duplication that could be easily factored out...

logfile_check();

FILE *result = real_freopen(path,mode,stream);
pid_t pid = getpid();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like this boilerplate could be factored too...

static int (*real_open) ( const char *pathname,int flags,... ) = 0;
static int (*real_openat) ( int dirfd, const char *pathname, int flags,... ) = 0;
static int (*real_creat) ( const char *pathname,mode_t mode ) = 0;
static FILE * (*real_fopen) ( const char *path,const char *mode ) = 0;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be constructive to look at the libc source to see how fopen/open relate to each other. In the past, the idea was that both rely upon a common underlying call (_open or __open or __libc_open) that does that actual system call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants