OSDN Git Service

whitespace
authorcgf <cgf>
Thu, 12 Dec 2002 03:09:38 +0000 (03:09 +0000)
committercgf <cgf>
Thu, 12 Dec 2002 03:09:38 +0000 (03:09 +0000)
winsup/cygwin/glob.c
winsup/cygwin/how-autoload-works.txt
winsup/cygwin/include/cygwin/stat.h
winsup/cygwin/include/pthread.h
winsup/cygwin/net.cc
winsup/cygwin/pinfo.h
winsup/cygwin/sec_acl.cc
winsup/cygwin/thread.h

index 971b309..32e4e60 100644 (file)
@@ -833,7 +833,7 @@ g_lstat(fn, sb, pglob)
 {
        /* FIXME: This only works as long as the application uses the old
           struct stat with 32 bit off_t types!!!
-          
+
           As soon as we switch over to 64 bit, we have to decide by
           the applications API minor version number, whether to use
           a pointer to a __stat64 or a _stat32 struct to the
@@ -867,7 +867,7 @@ g_stat(fn, sb, pglob)
 {
        /* FIXME: This only works as long as the application uses the old
           struct stat with 32 bit off_t types!!!
-          
+
           As soon as we switch over to 64 bit, we have to decide by
           the applications API minor version number, whether to use
           a pointer to a __stat64 or a _stat32 struct to the
index 27c2426..4f96d8b 100644 (file)
@@ -55,12 +55,12 @@ function that was not used there before, you should add a stub so it
 will be autoloaded.  To do so, add one of the LoadDllfunc* macros to
 autoload.cc.  All macros eventually resolve to the following form:
 
-LoadDLLfuncEx2 (function name, parameter block length, dll name, 
+LoadDLLfuncEx2 (function name, parameter block length, dll name,
                 non-fatality flag , value to return if function not available)
 
-Parameter block length is a sum of sizes (in bytes) of parameters which are 
-being passed to the function. If non-fatality flag is set to 0, then failure 
-to load dll and find a function will cause fatal error. If non fatality flag 
+Parameter block length is a sum of sizes (in bytes) of parameters which are
+being passed to the function. If non-fatality flag is set to 0, then failure
+to load dll and find a function will cause fatal error. If non fatality flag
 is set to 1, then call to the function will return default value.
 You can also use shorter versions -- LoadDLLfuncEx and LoadDLLfunc, if the
 defaults they provide suit your needs.
index 5772a37..1c1a5cd 100644 (file)
@@ -60,7 +60,7 @@ extern int lstat64 (const char *file_name, struct __stat64 *buf);
 #endif
 
 struct stat
-{ 
+{
   dev_t         st_dev;
   ino_t         st_ino;
   mode_t        st_mode;
index 96aa4de..02b8b89 100644 (file)
@@ -103,7 +103,7 @@ void pthread_cleanup_push (void (*routine)(void*), void *arg);
 void pthread_cleanup_pop (int execute);
 */
 typedef void (*__cleanup_routine_type) (void *);
-typedef struct _pthread_cleanup_handler 
+typedef struct _pthread_cleanup_handler
 {
   __cleanup_routine_type function;
   void *arg;
index 06b9a5a..b775fb9 100644 (file)
@@ -521,6 +521,8 @@ fdsock (int &fd, const char *name, SOCKET soc)
                  winsock2_active);
   fhandler_socket *fh =
     (fhandler_socket *) cygheap->fdtab.build_fhandler (fd, FH_SOCKET, name);
+  if (!fh)
+    return NULL;
   fh->set_io_handle ((HANDLE) soc);
   fh->set_flags (O_RDWR | O_BINARY);
   fh->set_r_no_interrupt (winsock2_active);
@@ -558,12 +560,17 @@ cygwin_socket (int af, int type, int protocol)
        name = (type == SOCK_STREAM ? "/dev/streamsocket" : "/dev/dgsocket");
 
       fh = fdsock (fd, name, soc);
-      if (fh)
+      if (!fh)
+       {
+         closesocket (soc);
+         res = -1;
+       }
+      else
        {
          fh->set_addr_family (af);
          fh->set_socket_type (type);
+         res = fd;
        }
-      res = fd;
     }
 
 done:
index 829a2c1..89b683f 100644 (file)
@@ -92,7 +92,7 @@ public:
 
   /* Non-zero if process was stopped by a signal. */
   char stopsig;
-  
+
   /* commune */
   pid_t hello_pid;
   HANDLE tothem;
index a928002..3766128 100644 (file)
@@ -313,7 +313,7 @@ getacl (const char *file, DWORD attr, int nentries, __aclent16_t *aclbufp)
       for (i = 0; i < acl->AceCount; ++i)
        {
          ACCESS_ALLOWED_ACE *ace;
-         
+
          if (!GetAce (acl, i, (PVOID *) &ace))
            continue;
 
@@ -367,7 +367,7 @@ getacl (const char *file, DWORD attr, int nentries, __aclent16_t *aclbufp)
            }
        }
       /* Include DEF_CLASS_OBJ if any default ace exists */
-      if ((types_def & (USER|GROUP)) 
+      if ((types_def & (USER|GROUP))
          && ((pos = searchace (lacl, MAX_ACL_ENTRIES, DEF_CLASS_OBJ)) >= 0))
        {
          lacl[pos].a_type = DEF_CLASS_OBJ;
@@ -378,7 +378,7 @@ getacl (const char *file, DWORD attr, int nentries, __aclent16_t *aclbufp)
   if ((pos = searchace (lacl, MAX_ACL_ENTRIES, 0)) < 0)
     pos = MAX_ACL_ENTRIES;
   if (aclbufp) {
-    if (EqualSid (owner_sid, group_sid)) 
+    if (EqualSid (owner_sid, group_sid))
       lacl[0].a_perm = lacl[1].a_perm;
     if (pos > nentries)
       {
index 32175a4..d33750c 100644 (file)
@@ -527,7 +527,6 @@ public:
   }
 };
 
 #define MT_INTERFACE user_data->threadinterface
 
 extern "C"