char path_trace[PATH_MAX];
int path_trace_len;
char *path_trace_ptr;
+ int open_ret = 0;
if(channel_dir == NULL) {
perror(subchannel_name);
- return ENOENT;
+ open_ret = ENOENT;
+ goto end;
}
printf("Creating trace subdirectory %s\n", subtrace_name);
printf("Appending to directory %s as resquested\n", subtrace_name);
} else {
perror(subtrace_name);
- return -1;
+ open_ret = -1;
+ goto end;
}
}
}
} else {
printf("File %s exists, cannot open. Try append mode.\n", path_trace);
- return -1;
+ open_ret = -1;
+ goto end;
}
} else {
if(errno == ENOENT) {
}
}
+end:
closedir(channel_dir);
- return 0;
+ return open_ret;
}