Commit e62a6255 authored by Philip Carns's avatar Philip Carns
Browse files

avoid attempting to instrument final log rename()

parent e245da9d
......@@ -1796,6 +1796,14 @@ int DARSHAN_DECL(rename)(const char *oldpath, const char *newpath)
char *oldpath_clean, *newpath_clean;
darshan_record_id old_rec_id, new_rec_id;
struct posix_file_record_ref *old_rec_ref, *new_rec_ref;
int disabled = 0;
/* This is a special case to avoid attempting to instrument final rename
* performed by darshan itself when finalizing
*/
POSIX_LOCK();
disabled = darshan_core_disabled_instrumentation();
POSIX_UNLOCK();
MAP_OR_FAIL(rename);
......@@ -1803,6 +1811,9 @@ int DARSHAN_DECL(rename)(const char *oldpath, const char *newpath)
ret = __real_rename(oldpath, newpath);
tm2 = darshan_core_wtime();
if(disabled)
return(ret);
if(ret == 0)
{
oldpath_clean = darshan_clean_file_path(oldpath);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment