Simplify `fopen` call and report event
Remove `proc/self/maps` check
Ref:
@@ -1756,17 +1756,8 @@ fopen(const char *pathname, const char *mode)
WRAP_CHECK(fopen, NULL);
stream = g_fn.fopen(pathname, mode);
- if (stream != NULL) {
- // This check for /proc/self/maps is because we want to avoid
- // reporting that our funchook library opens /proc/self/maps
- // with fopen, then calls fgets and fclose on it as well...
- // See https://github.com/criblio/appscope/issues/214 for more info
- if (scope_strcmp(pathname, "/proc/self/maps")) {
- doOpen(fileno(stream), pathname, STREAM, "fopen");
- }
- } else {
- doUpdateState(FS_ERR_OPEN_CLOSE, -1, 0, "fopen", pathname);
- }
+ int fd = (stream) ? fileno(stream) : -1;
+ doOpen(fd, pathname, STREAM, "fopen");
return stream;
}
