Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F152567649
D9425.id.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
D9425.id.diff
View Options
Index: head/sys/compat/linux/linux_file.c
===================================================================
--- head/sys/compat/linux/linux_file.c
+++ head/sys/compat/linux/linux_file.c
@@ -1537,11 +1537,16 @@
#endif
error = kern_pipe(td, fildes, 0, NULL, NULL);
- if (error)
+ if (error != 0)
return (error);
- /* XXX: Close descriptors on error. */
- return (copyout(fildes, args->pipefds, sizeof(fildes)));
+ error = copyout(fildes, args->pipefds, sizeof(fildes));
+ if (error != 0) {
+ (void)kern_close(td, fildes[0]);
+ (void)kern_close(td, fildes[1]);
+ }
+
+ return (error);
}
int
@@ -1564,11 +1569,16 @@
if ((args->flags & LINUX_O_CLOEXEC) != 0)
flags |= O_CLOEXEC;
error = kern_pipe(td, fildes, flags, NULL, NULL);
- if (error)
+ if (error != 0)
return (error);
- /* XXX: Close descriptors on error. */
- return (copyout(fildes, args->pipefds, sizeof(fildes)));
+ error = copyout(fildes, args->pipefds, sizeof(fildes));
+ if (error != 0) {
+ (void)kern_close(td, fildes[0]);
+ (void)kern_close(td, fildes[1]);
+ }
+
+ return (error);
}
int
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Apr 16, 5:55 PM (5 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31617060
Default Alt Text
D9425.id.diff (1 KB)
Attached To
Mode
D9425: Fix error handling in linux_pipe().
Attached
Detach File
Event Timeline
Log In to Comment