Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F149157112
D26612.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D26612.diff
View Options
Index: head/sys/kern/subr_syscall.c
===================================================================
--- head/sys/kern/subr_syscall.c
+++ head/sys/kern/subr_syscall.c
@@ -138,7 +138,8 @@
(void)sigfastblock_fetch(td);
/* Let system calls set td_errno directly. */
- td->td_pflags &= ~TDP_NERRNO;
+ KASSERT((td->td_pflags & TDP_NERRNO) == 0,
+ ("%s: TDP_NERRNO set", __func__));
if (__predict_false(SYSTRACE_ENABLED() ||
AUDIT_SYSCALL_ENTER(sa->code, td))) {
@@ -149,7 +150,9 @@
#endif
error = (sa->callp->sy_call)(td, sa->args);
/* Save the latest error return value. */
- if (__predict_false((td->td_pflags & TDP_NERRNO) == 0))
+ if (__predict_false((td->td_pflags & TDP_NERRNO) != 0))
+ td->td_pflags &= ~TDP_NERRNO;
+ else
td->td_errno = error;
AUDIT_SYSCALL_EXIT(error, td);
#ifdef KDTRACE_HOOKS
@@ -161,7 +164,9 @@
} else {
error = (sa->callp->sy_call)(td, sa->args);
/* Save the latest error return value. */
- if (__predict_false((td->td_pflags & TDP_NERRNO) == 0))
+ if (__predict_false((td->td_pflags & TDP_NERRNO) != 0))
+ td->td_pflags &= ~TDP_NERRNO;
+ else
td->td_errno = error;
}
syscall_thread_exit(td, sa->callp);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Mar 23, 3:35 PM (14 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30192123
Default Alt Text
D26612.diff (1 KB)
Attached To
Mode
D26612: Only clear TDP_NERRNO when needed
Attached
Detach File
Event Timeline
Log In to Comment