-
Notifications
You must be signed in to change notification settings - Fork 3
Fixes segfault and adds open, creat calls #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Modifies printing of environment to append rather than clobber
Removes print of entire environment on invocation
Adds openat
envtrace-helper.c
Outdated
| } | ||
| } | ||
|
|
||
| if(!logfile_name) { |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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.
No description provided.