Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F149050117
D9425.id24682.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
993 B
Referenced Files
None
Subscribers
None
D9425.id24682.diff
View Options
Index: sys/compat/linux/linux_file.c
===================================================================
--- sys/compat/linux/linux_file.c
+++ sys/compat/linux/linux_file.c
@@ -1540,8 +1540,13 @@
if (error)
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
Mon, Mar 23, 12:09 AM (10 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30147172
Default Alt Text
D9425.id24682.diff (993 B)
Attached To
Mode
D9425: Fix error handling in linux_pipe().
Attached
Detach File
Event Timeline
Log In to Comment