Fixes segfault and adds open, creat calls#4
Open
nkremerh wants to merge 5 commits intodthain:masterfrom
Open
Conversation
Modifies printing of environment to append rather than clobber
Removes print of entire environment on invocation
Adds openat
dthain
reviewed
Feb 13, 2019
envtrace-helper.c
Outdated
| } | ||
| } | ||
|
|
||
| if(!logfile_name) { |
Owner
There was a problem hiding this comment.
Seems like a lot of code duplication that could be easily factored out...
dthain
reviewed
Feb 18, 2019
| logfile_check(); | ||
|
|
||
| FILE *result = real_freopen(path,mode,stream); | ||
| pid_t pid = getpid(); |
Owner
There was a problem hiding this comment.
Seems like this boilerplate could be factored too...
dthain
reviewed
Feb 18, 2019
| 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; |
Owner
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.