Skip to content

Commit 290864a

Browse files
committed
Address code review
1 parent be4d550 commit 290864a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Include/internal/pycore_mmap.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@ _PyAnnotateMemoryMap(void *addr, size_t size, const char *name)
2626
}
2727
#endif
2828
assert(strlen(name) < 80);
29+
int old_errno = errno;
2930
prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, (unsigned long)(addr), size, name);
3031
/* Ignore errno from prctl */
3132
/* See: https://bugzilla.redhat.com/show_bug.cgi?id=2302746 */
32-
errno = 0;
33+
errno = old_errno;
3334
}
3435
#else
3536
static inline void

0 commit comments

Comments
 (0)