From ac49990f3df05abb9639b0a5a9be2b26572340ad Mon Sep 17 00:00:00 2001 From: Daniel Becker Date: Tue, 5 Apr 2016 00:35:21 -0700 Subject: [PATCH] clean up DllImport attributes Any native function that can modify errno should have the SetLastError attribute set to true. Also, no need to specify EntryPoint if it's the same as the function name. --- mcs/class/System/System.IO/KeventWatcher.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mcs/class/System/System.IO/KeventWatcher.cs b/mcs/class/System/System.IO/KeventWatcher.cs index 996e0e9b61f..5cc8a377356 100644 --- a/mcs/class/System/System.IO/KeventWatcher.cs +++ b/mcs/class/System/System.IO/KeventWatcher.cs @@ -665,19 +665,19 @@ namespace System.IO { string fixupPath = null; string fullPathNoLastSlash = null; - [DllImport ("libc", EntryPoint="fcntl", CharSet=CharSet.Auto, SetLastError=true)] + [DllImport ("libc", CharSet=CharSet.Auto, SetLastError=true)] static extern int fcntl (int file_names_by_descriptor, int cmd, StringBuilder sb); - [DllImport ("libc")] + [DllImport ("libc", SetLastError=true)] extern static int open (string path, int flags, int mode_t); [DllImport ("libc")] extern static int close (int fd); - [DllImport ("libc")] + [DllImport ("libc", SetLastError=true)] extern static int kqueue (); - [DllImport ("libc")] + [DllImport ("libc", SetLastError=true)] extern static int kevent (int kq, [In]kevent[] ev, int nchanges, [Out]kevent[] evtlist, int nevents, [In] ref timespec time); [MethodImplAttribute(MethodImplOptions.InternalCall)] -- 2.25.1