]> sourceware.org Git - newlib-cygwin.git/commitdiff
* path.cc (chdir): Always use the normalized_path as posix_cwd, except if it
authorChristopher Faylor <me@cgf.cx>
Fri, 28 May 2004 19:50:07 +0000 (19:50 +0000)
committerChristopher Faylor <me@cgf.cx>
Fri, 28 May 2004 19:50:07 +0000 (19:50 +0000)
starts with a drive.

Also perform whitespace cleanup.

44 files changed:
winsup/cygwin/ChangeLog
winsup/cygwin/cpuid.h
winsup/cygwin/cygheap.h
winsup/cygwin/cygserver_msg.h
winsup/cygwin/cygserver_sem.h
winsup/cygwin/dcrt0.cc
winsup/cygwin/dir.cc
winsup/cygwin/environ.cc
winsup/cygwin/exceptions.cc
winsup/cygwin/external.cc
winsup/cygwin/fhandler.cc
winsup/cygwin/fhandler_console.cc
winsup/cygwin/fhandler_disk_file.cc
winsup/cygwin/fhandler_dsp.cc
winsup/cygwin/fhandler_proc.cc
winsup/cygwin/fhandler_raw.cc
winsup/cygwin/fhandler_serial.cc
winsup/cygwin/fhandler_socket.cc
winsup/cygwin/fhandler_tape.cc
winsup/cygwin/fhandler_tty.cc
winsup/cygwin/grp.cc
winsup/cygwin/heap.cc
winsup/cygwin/init.cc
winsup/cygwin/libc/bsdlib.cc
winsup/cygwin/msg.cc
winsup/cygwin/mtinfo.h
winsup/cygwin/net.cc
winsup/cygwin/passwd.cc
winsup/cygwin/path.cc
winsup/cygwin/poll.cc
winsup/cygwin/sched.cc
winsup/cygwin/sec_helper.cc
winsup/cygwin/security.cc
winsup/cygwin/sem.cc
winsup/cygwin/shared.cc
winsup/cygwin/shm.cc
winsup/cygwin/sigproc.cc
winsup/cygwin/syscalls.cc
winsup/cygwin/sysconf.cc
winsup/cygwin/thread.cc
winsup/cygwin/thread.h
winsup/cygwin/tty.cc
winsup/cygwin/uinfo.cc
winsup/cygwin/wincap.cc

index edf43778db067168c4eed53918db6589dcb36d1a..ee3e1803033e316a550f0a020f4034091636f023 100644 (file)
@@ -1,3 +1,8 @@
+2004-05-28  Pierre Humblet  <Pierre.Humblet@ieee.org>
+
+       * path.cc (chdir): Always use the normalized_path as posix_cwd, except
+       if it starts with a drive.
+
 2004-05-25  Christopher Faylor  <cgf@alum.bu.edu>
 
        * winbase.h: Semi-revert previous patch as it caused strange behavior.
index 1f0cc5006f446c1e91948e63809aeba7a777390d..998bbbf91b32c34341f93c7e8ac1fe234803ad4a 100644 (file)
@@ -6,9 +6,9 @@ cpuid (unsigned *a, unsigned *b, unsigned *c, unsigned *d, unsigned in)
 {
   asm ("cpuid"
        : "=a" (*a),
-         "=b" (*b),
-         "=c" (*c),
-         "=d" (*d)
+        "=b" (*b),
+        "=c" (*c),
+        "=d" (*d)
        : "a" (in));
 }
 
index 15b179ea0ab3b93de295cd676c70e5a4820e943b..59253b5c71a6ce1f76382ae68bbd94d2a52e9d0f 100644 (file)
@@ -182,7 +182,7 @@ public:
   }
   bool has_impersonation_tokens ()
     { return external_token != INVALID_HANDLE_VALUE
-             || internal_token != INVALID_HANDLE_VALUE
+            || internal_token != INVALID_HANDLE_VALUE
             || current_token != INVALID_HANDLE_VALUE; }
   void close_impersonation_tokens ()
   {
index 116741e2ea14115a5625374dfb0a5b69a7311dc9..716aaf82b621b47466dc8da6c3c8c3d8c39c6551 100644 (file)
@@ -48,7 +48,7 @@ private:
       proc ipcblk;
       union
       {
-        struct msgctl_args ctlargs;
+       struct msgctl_args ctlargs;
        struct msgget_args getargs;
        struct msgrcv_args rcvargs;
        struct msgsnd_args sndargs;
index 288a054387d042e4098fd9481e780b620e0d37ff..53a5ec570142e5bb5f1044c7af9e5b2eb2d293f0 100644 (file)
@@ -47,7 +47,7 @@ private:
       proc ipcblk;
       union
       {
-        struct semctl_args ctlargs;
+       struct semctl_args ctlargs;
        struct semget_args getargs;
        struct semop_args  opargs;
       };
index 90f6ac8dcb41f33500f2850d82bcbc710f61d048..6f99403b04fb206492ae0625efb4d67ad393f1d2 100644 (file)
@@ -904,7 +904,7 @@ initialize_main_tls (char *padding)
 
    UPTR is a pointer to global data that lives on the libc side of the
    line [if one distinguishes the application from the dll].  */
-  
+
 extern "C" void __stdcall
 _dll_crt0 ()
 {
index d0a650434bb01d5c03bae5928832c4662d87adc3..e74498fb0509d386f98f2846539465f226975939 100644 (file)
@@ -292,7 +292,7 @@ rmdir (const char *dir)
                           (DWORD) real_dir & ~FILE_ATTRIBUTE_READONLY);
 
       for (bool is_cwd = false; ; is_cwd = true)
-        {
+       {
          DWORD err;
          int rc = RemoveDirectory (real_dir);
          DWORD att = GetFileAttributes (real_dir);
@@ -304,8 +304,8 @@ rmdir (const char *dir)
              /* RemoveDirectory on a samba drive doesn't return an error if the
                 directory can't be removed because it's not empty. Checking for
                 existence afterwards keeps us informed about success. */
-             if (att == INVALID_FILE_ATTRIBUTES) 
-               {
+             if (att == INVALID_FILE_ATTRIBUTES)
+               {
                  res = 0;
                  break;
                }
@@ -327,19 +327,19 @@ rmdir (const char *dir)
             SetCurrentDirectory. */
 
          if (strcasematch (real_dir, cygheap->cwd.win32)
-             && !strcasematch ("c:\\", cygheap->cwd.win32) 
+             && !strcasematch ("c:\\", cygheap->cwd.win32)
              && !is_cwd
              && SetCurrentDirectory ("c:\\"))
            continue;
-         
-         /* On 9X ERROR_ACCESS_DENIED is returned 
+
+         /* On 9X ERROR_ACCESS_DENIED is returned
             if you try to remove a non-empty directory. */
          if (err == ERROR_ACCESS_DENIED
              && wincap.access_denied_on_delete ())
            err = ERROR_DIR_NOT_EMPTY;
-         
+
          __seterrno_from_win_error (err);
-         
+
          /* Directory still exists, restore its characteristics. */
          if (real_dir.has_attribute (FILE_ATTRIBUTE_READONLY))
            SetFileAttributes (real_dir, real_dir);
index be4b88408e8da364f7a9ccf3826fdb6da4a521b8..6fac0994b0265d05b20659160f037c23120c713c 100644 (file)
@@ -913,7 +913,7 @@ build_env (const char * const *envp, char *&envblock, int &envc,
   if (cygheap->user.issetuid ())
     for (unsigned i = 0; i < SPENVS_SIZE; i++)
       if (!saw_spenv[i])
-        {
+      {
          *dstp = spenvs[i].retrieve (no_envblock);
          if (*dstp && !no_envblock && *dstp != env_dontadd)
            {
@@ -921,7 +921,7 @@ build_env (const char * const *envp, char *&envblock, int &envc,
              dstp++;
            }
        }
-  
+
   envc = dstp - newenv;                /* Number of entries in newenv */
   assert ((size_t) envc <= (n + SPENVS_SIZE));
   *dstp = NULL;                        /* Terminate */
index 44f37cbbe36663a1e7ad5e5ece0e34f16aea104c..66879ee4b986e87046e8065b3b46fd49acebb55a 100644 (file)
@@ -830,13 +830,13 @@ ctrl_c_handler (DWORD type)
   if (myself->ctty != -1)
     {
       if (type == CTRL_CLOSE_EVENT)
-        {
+       {
          sig_send (NULL, SIGHUP);
          saw_close = true;
          return FALSE;
        }
       if (!saw_close && type == CTRL_LOGOFF_EVENT)
-        {
+       {
          /* Check if the process is actually associated with a visible
             window station, one which actually represents a visible desktop.
             If not, the CTRL_LOGOFF_EVENT doesn't concern this process. */
index b14932426231f055010a85c27ded44f5cac65557..c6694fa93daa64a5348e9f50b83b84fa7d1d6e11 100644 (file)
@@ -252,7 +252,7 @@ cygwin_internal (cygwin_getinfo_types t, ...)
          return check_ntsec (filename);
        }
       case CW_GET_ERRNO_FROM_WINERROR:
-        {
+       {
          int error = va_arg (arg, int);
          int deferrno = va_arg (arg, int);
          return geterrno_from_win_error (error, deferrno);
@@ -270,20 +270,20 @@ cygwin_internal (cygwin_getinfo_types t, ...)
          memcpy (sd_buf, sd, sd.size ());
          psa->lpSecurityDescriptor = sd_buf;
          return 0;
-        }
+       }
       case CW_GET_SHMLBA:
-        {
+       {
          return getshmlba ();
        }
       case CW_GET_UID_FROM_SID:
-        {
+       {
          PSID psid = va_arg (arg, PSID);
          cygsid sid (psid);
          struct passwd *pw = internal_getpwsid (sid);
          return pw ? pw->pw_uid : (__uid32_t)-1;
        }
       case CW_GET_GID_FROM_SID:
-        {
+       {
          PSID psid = va_arg (arg, PSID);
          cygsid sid (psid);
          struct __group32 *gr = internal_getgrsid (sid);
index bcc43074a6e9ac3a2302c5ad0a16313fb2c57347..c481bde29ac45e9ae65acd5d16ad4c7cdc6ffdcb 100644 (file)
@@ -562,19 +562,19 @@ fhandler_base::open (int flags, mode_t mode)
   switch (query_open ())
     {
       case query_read_control:
-        access = READ_CONTROL;
-        create_options = FILE_OPEN_FOR_BACKUP_INTENT;
-        break;
+       access = READ_CONTROL;
+       create_options = FILE_OPEN_FOR_BACKUP_INTENT;
+       break;
       case query_stat_control:
-        access = READ_CONTROL | FILE_READ_ATTRIBUTES;
-        create_options = FILE_OPEN_FOR_BACKUP_INTENT;
-        break;
+       access = READ_CONTROL | FILE_READ_ATTRIBUTES;
+       create_options = FILE_OPEN_FOR_BACKUP_INTENT;
+       break;
       case query_write_control:
-        access = READ_CONTROL | WRITE_OWNER | WRITE_DAC;
-        create_options = FILE_OPEN_FOR_BACKUP_INTENT | FILE_OPEN_FOR_RECOVERY;
-        break;
+       access = READ_CONTROL | WRITE_OWNER | WRITE_DAC;
+       create_options = FILE_OPEN_FOR_BACKUP_INTENT | FILE_OPEN_FOR_RECOVERY;
+       break;
       default:
-        create_options = 0;
+       create_options = 0;
        if (get_major () == DEV_TAPE_MAJOR && (flags & O_TEXT))
          {
            /* O_TEXT is used to indicate write-through on tape devices */
@@ -636,7 +636,7 @@ fhandler_base::open (int flags, mode_t mode)
     }
 
   status = NtCreateFile (&x, access, &attr, &io, NULL, file_attributes, shared,
-                        create_disposition, create_options, NULL, 0);
+                        create_disposition, create_options, NULL, 0);
   if (!NT_SUCCESS (status))
     {
       if (!wincap.can_open_directories () && pc.isdir ())
@@ -654,7 +654,7 @@ fhandler_base::open (int flags, mode_t mode)
    }
 
   syscall_printf ("%x = NtCreateFile "
-                 "(%p, %x, %s, io, NULL, %x, %x, %x, %x, NULL, 0)",
+                 "(%p, %x, %s, io, NULL, %x, %x, %x, %x, NULL, 0)",
                  status, x, access, get_win32_name (), file_attributes, shared,
                  create_disposition, create_options);
 
@@ -810,22 +810,22 @@ fhandler_base::write (const void *ptr, size_t len)
              && current_position >= actual_length + (128 * 1024))
            {
              /* If the file systemn supports sparse files and the application
-                is writing after a long seek beyond EOF, convert the file to
+                is writing after a long seek beyond EOF, convert the file to
                 a sparse file. */
              DWORD dw;
              HANDLE h = get_output_handle ();
              BOOL r = DeviceIoControl (h, FSCTL_SET_SPARSE, NULL, 0, NULL,
-                                       0, &dw, NULL);
+                                       0, &dw, NULL);
              syscall_printf ("%d = DeviceIoControl(%p, FSCTL_SET_SPARSE, "
                              "NULL, 0, NULL, 0, &dw, NULL)", r, h);
            }
          else if (wincap.has_lseek_bug ())
            {
              /* Oops, this is the bug case - Win95 uses whatever is on the
-                disk instead of some known (safe) value, so we must seek
+                disk instead of some known (safe) value, so we must seek
                 back and fill in the gap with zeros. - DJ
-                Note: this bug doesn't happen on NT4, even though the
-                documentation for WriteFile() says that it *may* happen
+                Note: this bug doesn't happen on NT4, even though the
+                documentation for WriteFile() says that it *may* happen
                 on any OS. */
              char zeros[512];
              int number_of_zeros_to_write = current_position - actual_length;
@@ -1084,7 +1084,7 @@ fhandler_base::lseek (_off64_t offset, int whence)
   else
     {
       if (poff_high)
-        res += (_off64_t) *poff_high << 32;
+       res += (_off64_t) *poff_high << 32;
 
       /* When next we write(), we will check to see if *this* seek went beyond
         the end of the file, and back-seek and fill with zeros if so - DJ */
index 242182ec32473df6d7d079af156255b6ffc8dfd4..327219d3469c3ddf76a2859ba0f26c6d7dd87bb1 100644 (file)
@@ -1112,11 +1112,11 @@ fhandler_console::char_command (char c)
             case 9:    /* dim */
               dev_state->intensity = INTENSITY_DIM;
               break;
-             case 10:   /* end alternate charset */
-               dev_state->alternate_charset_active = false;
+            case 10:   /* end alternate charset */
+              dev_state->alternate_charset_active = false;
               break;
-             case 11:   /* start alternate charset */
-               dev_state->alternate_charset_active = true;
+            case 11:   /* start alternate charset */
+              dev_state->alternate_charset_active = true;
               break;
             case 24:
               dev_state->underline = false;
index 7b48668491e30fc6c1f057ef0212d55876eb83c4..194f646020abb4fbb632d918a44c372b043e734f 100644 (file)
@@ -190,7 +190,7 @@ fhandler_base::fstat_fs (struct __stat64 *buf)
   if (oret)
     {
       /* We now have a valid handle, regardless of the "nohandle" state.
-         Since fhandler_base::open only calls CloseHandle if !nohandle,
+        Since fhandler_base::open only calls CloseHandle if !nohandle,
         we have to set it to false before calling close_fs and restore
         the state afterwards. */
       res = fstat_by_handle (buf);
@@ -270,7 +270,7 @@ fhandler_base::fstat_helper (struct __stat64 *buf,
   if (pc.has_attribute (FILE_ATTRIBUTE_COMPRESSED | FILE_ATTRIBUTE_SPARSE_FILE)
       && get_io_handle ()
       && !NtQueryInformationFile (get_io_handle (), &st, (PVOID) &fci,
-                                 sizeof fci, FileCompressionInformation))
+                                 sizeof fci, FileCompressionInformation))
     buf->st_blocks = (fci.CompressedSize.QuadPart + S_BLKSIZE - 1) / S_BLKSIZE;
   else
     /* Just compute no. of blocks from file size. */
@@ -287,14 +287,14 @@ fhandler_base::fstat_helper (struct __stat64 *buf,
       /* symlinks are everything for everyone! */
       buf->st_mode = S_IFLNK | S_IRWXU | S_IRWXG | S_IRWXO;
       get_file_attribute (pc.has_acls (), get_io_handle (), get_win32_name (),
-                         NULL, &buf->st_uid, &buf->st_gid);
+                         NULL, &buf->st_uid, &buf->st_gid);
       goto done;
     }
   else if (pc.issocket ())
     buf->st_mode = S_IFSOCK;
 
   if (!get_file_attribute (pc.has_acls (), get_io_handle (), get_win32_name (),
-                          &buf->st_mode, &buf->st_uid, &buf->st_gid))
+                          &buf->st_mode, &buf->st_uid, &buf->st_gid))
     {
       /* If read-only attribute is set, modify ntsec return value */
       if (pc.has_attribute (FILE_ATTRIBUTE_READONLY) && !pc.issymlink ())
@@ -396,7 +396,7 @@ fhandler_disk_file::fchmod (mode_t mode)
                               ILLEGAL_UID, ILLEGAL_GID, mode)
          && allow_ntsec)
        res = 0;
-      
+
       if (oret)
        close_fs ();
     }
@@ -424,7 +424,7 @@ fhandler_disk_file::fchown (__uid32_t uid, __gid32_t gid)
   if (!pc.has_acls () || !allow_ntsec)
     {
       /* fake - if not supported, pretend we're like win95
-         where it just works */
+        where it just works */
       return 0;
     }
 
@@ -459,7 +459,7 @@ fhandler_disk_file::facl (int cmd, int nentries, __aclent32_t *aclbufp)
   if (!pc.has_acls () || !allow_ntsec)
     {
       switch (cmd)
-        {
+       {
          struct __stat64 st;
 
          case SETACL:
@@ -478,7 +478,7 @@ fhandler_disk_file::facl (int cmd, int nentries, __aclent32_t *aclbufp)
                    if (!(oret = open_fs (O_BINARY, 0)))
                      return -1;
                  }
-               if (!fstat_by_handle (&st))
+               if (!fstat_by_handle (&st))
                  {
                    aclbufp[0].a_type = USER_OBJ;
                    aclbufp[0].a_id = st.st_uid;
@@ -489,7 +489,7 @@ fhandler_disk_file::facl (int cmd, int nentries, __aclent32_t *aclbufp)
                    aclbufp[2].a_type = OTHER_OBJ;
                    aclbufp[2].a_id = ILLEGAL_GID;
                    aclbufp[2].a_perm = st.st_mode & S_IRWXO;
-                   aclbufp[3].a_type = CLASS_OBJ; 
+                   aclbufp[3].a_type = CLASS_OBJ;
                    aclbufp[3].a_id = ILLEGAL_GID;
                    aclbufp[3].a_perm = S_IRWXU | S_IRWXG | S_IRWXO;
                    res = MIN_ACL_ENTRIES;
@@ -701,7 +701,7 @@ fhandler_disk_file::lock (int cmd, struct __flock64 *fl)
   if (win32_len == 0)
     {
       /* Special case if len == 0 for POSIX means lock to the end of
-         the entire file (and all future extensions).  */
+        the entire file (and all future extensions).  */
       /* CV, 2003-12-03: And yet another Win 9x bugginess.  For some reason
         offset + length must be <= 0x100000000.  I'm using 0xffffffff as
         upper border here, this should be sufficient. */
index a872c231efe2f4851b33a7281168a10b981ffd73..7044c6686c75673e077e9146ea5ba4ab7d19a736 100644 (file)
@@ -43,7 +43,7 @@ details. */
      to the device fails with EBUSY.
      If different processes open the audio device simultaneously,
      the results are unpredictable - usually the first one wins.
-    
+
   3. The wave device is reserved within a process from the time that
      the first read or write call has been successful until /dev/dsp
      has been closed by that process. During this reservation period
@@ -93,7 +93,7 @@ class fhandler_dev_dsp::Audio::queue
 
   bool send (WAVEHDR *);  // queue an item, returns true if successful
   bool recv (WAVEHDR **); // retrieve an item, returns true if successful
-  int query ();           // return number of items queued
+  int query ();                  // return number of items queued
 
  private:
   int head_;
@@ -131,7 +131,7 @@ class fhandler_dev_dsp::Audio_out: public Audio
   queue *Qapp2app_;  // empty and unprepared blocks
   HWAVEOUT dev_;     // The wave device
   int bufferIndex_;  // offset into pHdr_->lpData
-  WAVEHDR *pHdr_;    // data to be filled by write  
+  WAVEHDR *pHdr_;    // data to be filled by write
   WAVEHDR wavehdr_[MAX_BLOCKS];
   char *bigwavebuffer_; // audio samples only
 
@@ -356,7 +356,7 @@ fhandler_dev_dsp::Audio::blockSize (int rate, int bits, int channels)
   blockSize = ((bits / 8) * channels * rate) / 8; // approx 125ms per block
   // round up to multiple of 64
   blockSize +=  0x3f;
-  blockSize &= ~0x3f; 
+  blockSize &= ~0x3f;
   return blockSize;
 }
 
@@ -414,7 +414,7 @@ fhandler_dev_dsp::Audio_out::start (int rate, int bits, int channels)
 
   debug_printf ("freq=%d bits=%d channels=%d %s", rate, bits, channels,
                (rc != MMSYSERR_NOERROR) ? "FAIL" : "OK");
-  
+
   return (rc == MMSYSERR_NOERROR);
 }
 
@@ -431,8 +431,8 @@ fhandler_dev_dsp::Audio_out::stop (bool immediately)
     {
       if (!immediately)
        {
-         sendcurrent ();           // force out last block whatever size..
-         waitforallsent ();        // block till finished..
+         sendcurrent ();       // force out last block whatever size..
+         waitforallsent ();    // block till finished..
        }
 
       rc = waveOutReset (dev_);
@@ -817,7 +817,7 @@ fhandler_dev_dsp::Audio_in::start (int rate, int bits, int channels)
 
   debug_printf ("freq=%d bits=%d channels=%d %s", rate, bits, channels,
                (rc != MMSYSERR_NOERROR) ? "FAIL" : "OK");
-  
+
   return (rc == MMSYSERR_NOERROR);
 }
 
@@ -920,7 +920,7 @@ fhandler_dev_dsp::Audio_in::read (char *pSampleData, int &nBytes)
          (this->*convert_) ((unsigned char *)pSampleData, bytes_to_read);
          nBytes += bytes_to_read;
          bufferIndex_ += bytes_to_read;
-         debug_printf ("got %d", bytes_to_read); 
+         debug_printf ("got %d", bytes_to_read);
          break; // done; use remaining data in next call to read
        }
       else
@@ -972,7 +972,7 @@ fhandler_dev_dsp::Audio_in::waitfordata ()
        }
     }
   pHdr_ = pHdr;
-  bufferIndex_ = 0; 
+  bufferIndex_ = 0;
 }
 
 void
@@ -1069,7 +1069,7 @@ fhandler_dev_dsp::open (int flags, mode_t mode)
       break;
     case O_RDONLY:
       audio_in_ = new Audio_in;
-      if (!audio_in_->query (audiofreq_, audiobits_, audiochannels_)) 
+      if (!audio_in_->query (audiofreq_, audiobits_, audiochannels_))
        {
          delete audio_in_;
          audio_in_ = NULL;
@@ -1113,7 +1113,7 @@ fhandler_dev_dsp::open (int flags, mode_t mode)
       set_errno (EIO);
     }
   debug_printf ("ACCMODE=0x%08x audio_in=%08x audio_out=%08x, rc=%d",
-                flags & O_ACCMODE, (int)audio_in_, (int)audio_out_, rc);
+               flags & O_ACCMODE, (int)audio_in_, (int)audio_out_, rc);
   return rc;
 }
 
@@ -1209,8 +1209,8 @@ fhandler_dev_dsp::close (void)
     {
       if (exit_state != ES_NOT_EXITING)
        { // emergency close due to call to exit() or Ctrl-C:
-         // do not wait for all pending audio to be played
-         audio_out_->stop (true);
+        // do not wait for all pending audio to be played
+        audio_out_->stop (true);
        }
       delete audio_out_;
       audio_out_ = NULL;
@@ -1335,7 +1335,7 @@ fhandler_dev_dsp::ioctl (unsigned int cmd, void *ptr)
       CASE (SNDCTL_DSP_SPEED)
       {
        if (audio_out_)
-         {         
+         {
            RETURN_ERROR_WHEN_BUSY (audio_out_);
            audio_out_->stop ();
            if (audio_out_->query (*intptr, audiobits_, audiochannels_))
@@ -1367,7 +1367,7 @@ fhandler_dev_dsp::ioctl (unsigned int cmd, void *ptr)
        int nChannels = *intptr + 1;
 
        if (audio_out_)
-         {         
+         {
            RETURN_ERROR_WHEN_BUSY (audio_out_);
            audio_out_->stop ();
            if (audio_out_->query (audiofreq_, audiobits_, nChannels))
@@ -1399,7 +1399,7 @@ fhandler_dev_dsp::ioctl (unsigned int cmd, void *ptr)
        int nChannels = *intptr;
 
        if (audio_out_)
-         {         
+         {
            RETURN_ERROR_WHEN_BUSY (audio_out_);
            audio_out_->stop ();
            if (audio_out_->query (audiofreq_, audiobits_, nChannels))
index e79d59d166b20dff211b448f7eeec76f8d3604e1..0331314e1df9f712d780ba55866a15e6561613a1 100644 (file)
@@ -399,7 +399,7 @@ format_proc_meminfo (char *destbuf, size_t maxsize)
       ret = NtQuerySystemInformation (SystemPagefileInformation, (PVOID) spi,
                                      size, &size);
       if (ret == STATUS_INFO_LENGTH_MISMATCH)
-        {
+       {
          free (spi);
          spi = (PSYSTEM_PAGEFILE_INFORMATION) malloc (size);
          if (spi)
@@ -416,7 +416,7 @@ format_proc_meminfo (char *destbuf, size_t maxsize)
     {
       PSYSTEM_PAGEFILE_INFORMATION spp = spi;
       do
-        {
+       {
          swap_total += spp->CurrentSize * getpagesize ();
          swap_free += (spp->CurrentSize - spp->TotalUsed) * getpagesize ();
        }
@@ -711,13 +711,13 @@ format_proc_cpuinfo (char *destbuf, size_t maxsize)
              cpuid (&cpuid_sig, &extra_info, &features2, &features1, 1);
              /* unsigned extended_family = (cpuid_sig & 0x0ff00000) >> 20,
                          extended_model  = (cpuid_sig & 0x000f0000) >> 16; */
-             unsigned type            = (cpuid_sig & 0x00003000) >> 12,
-                      family          = (cpuid_sig & 0x00000f00) >> 8,
-                      model           = (cpuid_sig & 0x000000f0) >> 4,
-                      stepping        = cpuid_sig & 0x0000000f;
-             unsigned brand_id        = extra_info & 0x0000000f,
-                      cpu_count       = (extra_info & 0x00ff0000) >> 16,
-                      apic_id         = (extra_info & 0xff000000) >> 24;
+             unsigned type             = (cpuid_sig & 0x00003000) >> 12,
+                      family           = (cpuid_sig & 0x00000f00) >> 8,
+                      model            = (cpuid_sig & 0x000000f0) >> 4,
+                      stepping         = cpuid_sig & 0x0000000f;
+             unsigned brand_id         = extra_info & 0x0000000f,
+                      cpu_count        = (extra_info & 0x00ff0000) >> 16,
+                      apic_id          = (extra_info & 0xff000000) >> 24;
              const char *type_str;
              switch (type)
                {
@@ -964,7 +964,7 @@ format_proc_partitions (char *destbuf, size_t maxsize)
                        continue;
                      char devname[16];
                      __small_sprintf (devname, "/dev/sd%c%d",
-                                               drive_number + 'a',
+                                               drive_number + 'a',
                                                partition + 1);
                      device dev;
                      dev.parse (devname);
index 84f657f7653ae03060c8cde5aae849ebe6932d42..edbae89bdfc7a879aa64b15932b494aab598f11b 100644 (file)
@@ -179,7 +179,7 @@ fhandler_dev_raw::raw_read (void *ptr, size_t& ulen)
       if (is_eom (ret))
        set_errno (ENOSPC);
       else
-        __seterrno ();
+       __seterrno ();
       goto err;
     }
 
index 59ac65c5efee374cf884e1f5f5688361185146f0..0616ff12676afec8a8309bf92a8eaccf308b777b 100644 (file)
@@ -534,7 +534,7 @@ fhandler_serial::tcflush (int queue)
       set_errno (EINVAL);
       return -1;
     }
-       
+
   if (!PurgeComm (get_handle (), flags))
     {
       __seterrno ();
index a0b6727f04514123c5bffd95f3c33849ee8e894f..f37b2c9a2f48e190c362bad166559e01548df96a 100644 (file)
@@ -631,7 +631,7 @@ fhandler_socket::accept (struct sockaddr *peer, int *len)
     {
       cygheap_fdnew res_fd;
       if (res_fd >= 0 && fdsock (res_fd, &dev (), res))
-        {
+       {
          if (get_addr_family () == AF_LOCAL)
            ((fhandler_socket *) res_fd)->set_sun_path (get_sun_path ());
          ((fhandler_socket *) res_fd)->set_addr_family (get_addr_family ());
@@ -724,14 +724,14 @@ fhandler_socket::wait (HANDLE event, int flags)
   switch (WSAWaitForMultipleEvents (2, ev, FALSE, 10, FALSE))
     {
       case WSA_WAIT_TIMEOUT:
-        ret = 0;
+       ret = 0;
        break;
       case WSA_WAIT_EVENT_0:
        if (!WSAEnumNetworkEvents (get_socket (), event, &evts))
          {
            if (!evts.lNetworkEvents)
              {
-               ret = 0;
+               ret = 0;
                break;
              }
            if (evts.lNetworkEvents & FD_OOB)
@@ -777,7 +777,7 @@ fhandler_socket::wait (HANDLE event, int flags)
          }
        break;
       case WSA_WAIT_EVENT_0 + 1:
-        WSASetLastError (WSAEINTR);
+       WSASetLastError (WSAEINTR);
        break;
       default:
        WSASetLastError (WSAEFAULT);
@@ -841,14 +841,14 @@ fhandler_socket::recvfrom (void *ptr, size_t len, int flags,
          HANDLE evt;
          if (prepare (evt, FD_CLOSE | FD_READ | (owner () ? FD_OOB : 0)))
            {
-              do
-                {
+             do
+               {
                  DWORD lflags = (DWORD) flags;
                  res = WSARecvFrom (get_socket (), &wsabuf, 1, &ret, &lflags,
                                     from, fromlen, NULL, NULL);
-                }
-              while (res == SOCKET_ERROR
-                     && WSAGetLastError () == WSAEWOULDBLOCK
+               }
+             while (res == SOCKET_ERROR
+                    && WSAGetLastError () == WSAEWOULDBLOCK
                     && !closed ()
                     && !(res = wait (evt, flags)));
              release (evt);
@@ -963,13 +963,13 @@ fhandler_socket::recvmsg (struct msghdr *msg, int flags, ssize_t tot)
          HANDLE evt;
          if (prepare (evt, FD_CLOSE | FD_READ | (owner () ? FD_OOB : 0)))
            {
-              do
-                {
+             do
+               {
                  DWORD lflags = (DWORD) flags;
                  res = WSARecvFrom (get_socket (), wsabuf, iovcnt, &ret,
                                     &lflags, from, fromlen, NULL, NULL);
-                }
-              while (res == SOCKET_ERROR
+               }
+             while (res == SOCKET_ERROR
                     && WSAGetLastError () == WSAEWOULDBLOCK
                     && !closed ()
                     && !(res = wait (evt, flags)));
@@ -1040,7 +1040,7 @@ fhandler_socket::sendto (const void *ptr, size_t len, int flags,
          HANDLE evt;
          if (prepare (evt, FD_CLOSE | FD_WRITE | (owner () ? FD_OOB : 0)))
            {
-             do 
+             do
                {
                  res = WSASendTo (get_socket (), &wsabuf, 1, &ret,
                                   flags & MSG_WINMASK,
@@ -1048,7 +1048,7 @@ fhandler_socket::sendto (const void *ptr, size_t len, int flags,
                                   tolen, NULL, NULL);
                }
              while (res == SOCKET_ERROR
-                    && WSAGetLastError () == WSAEWOULDBLOCK
+                    && WSAGetLastError () == WSAEWOULDBLOCK
                     && !(res = wait (evt, 0))
                     && !closed ());
              release (evt);
@@ -1170,17 +1170,17 @@ fhandler_socket::sendmsg (const struct msghdr *msg, int flags, ssize_t tot)
          HANDLE evt;
          if (prepare (evt, FD_CLOSE | FD_WRITE | (owner () ? FD_OOB : 0)))
            {
-              do
-                {
+             do
+               {
                  res = WSASendTo (get_socket (), wsabuf, iovcnt,
-                                  &ret, flags,
+                                  &ret, flags,
                                   (struct sockaddr *) msg->msg_name,
                                   msg->msg_namelen, NULL, NULL);
-                }
-              while (res == SOCKET_ERROR
-                    && WSAGetLastError () == WSAEWOULDBLOCK
+               }
+             while (res == SOCKET_ERROR
+                    && WSAGetLastError () == WSAEWOULDBLOCK
                     && !(res = wait (evt, 0))
-                    && !closed ());
+                    && !closed ());
              release (evt);
            }
        }
@@ -1381,7 +1381,7 @@ fhandler_socket::ioctl (unsigned int cmd, void *p)
     case FIONREAD:
       res = ioctlsocket (get_socket (), FIONREAD, (unsigned long *) p);
       if (res == SOCKET_ERROR)
-        set_winsock_errno ();
+       set_winsock_errno ();
       break;
     default:
       /* We must cancel WSAAsyncSelect (if any) before setting socket to
index a8d0f3294488786cbfc896df196bbaec16af19ef..1e31ee1b011a2fb428c9bb87b063755c9bd8f20e 100644 (file)
@@ -142,7 +142,7 @@ mtinfo_drive::close (HANDLE mt, bool rewind)
       if (dirty == async_write_pending)
        lasterr = async_wait (mt, NULL);
       if (!lasterr)
-        {
+       {
          /* if last operation was writing, write a filemark */
          debug_printf ("writing filemark");
          write_marks (mt, TAPE_FILEMARKS, two_fm () ? 2 : 1);
@@ -157,7 +157,7 @@ mtinfo_drive::close (HANDLE mt, bool rewind)
   else if (dirty == has_read && !rewind)
     {
       if (sysv ())
-        {
+       {
          /* Under SYSV semantics, the tape is moved past the next file mark
             after read. */
          if (part (partition)->emark == no_eof)
@@ -166,7 +166,7 @@ mtinfo_drive::close (HANDLE mt, bool rewind)
            part (partition)->emark = eof;
        }
       else
-        {
+       {
          /* Under BSD semantics, we must check if the filemark has been
             inadvertendly crossed.  If so cross the filemark backwards
             and position the tape right before EOF. */
@@ -265,9 +265,9 @@ mtinfo_drive::read (HANDLE mt, HANDLE mt_evt, void *ptr, size_t &ulen)
   else if (IS_EOD (lasterr))
     {
       if (part (partition)->emark == eof)
-        part (partition)->emark = IS_EOM (lasterr) ? eom : eod;
+       part (partition)->emark = IS_EOM (lasterr) ? eom : eod;
       else
-        {
+       {
          part (partition)->emark = IS_EOM (lasterr) ? eom_hit : eod_hit;
          lasterr = 0;
        }
@@ -278,7 +278,7 @@ mtinfo_drive::read (HANDLE mt, HANDLE mt_evt, void *ptr, size_t &ulen)
       /* This happens if the buffer is too small when in variable block
         size mode.  Linux returns ENOMEM here.  We're doing the same. */
       if (lasterr == ERROR_MORE_DATA)
-        lasterr = ERROR_NOT_ENOUGH_MEMORY;
+       lasterr = ERROR_NOT_ENOUGH_MEMORY;
     }
   if (!lasterr)
     dirty = has_read;
@@ -324,7 +324,7 @@ mtinfo_drive::write (HANDLE mt, HANDLE mt_evt, const void *ptr, size_t &len)
   if (lasterr == ERROR_IO_PENDING)
     {
       if (async_writes () && mp ()->BlockSize == 0)
-        dirty = async_write_pending;
+       dirty = async_write_pending;
       else
        /* Wait for completion if a non-async write. */
        lasterr = async_wait (mt, &bytes_written);
@@ -349,9 +349,9 @@ mtinfo_drive::write (HANDLE mt, HANDLE mt_evt, const void *ptr, size_t &len)
     {
       part (partition)->emark = no_eof;
       if (!lasterr)
-        dirty = has_written;
+       dirty = has_written;
       else if (lasterr == ERROR_IO_PENDING)
-        dirty = async_write_pending;
+       dirty = async_write_pending;
     }
   return error ("write");
 }
@@ -370,9 +370,9 @@ mtinfo_drive::get_pos (HANDLE mt, long *ppartition, long *pblock)
        partition = (long) p - 1;
       block = (long) low;
       if (ppartition)
-        *ppartition= partition;
+       *ppartition= partition;
       if (pblock)
-        *pblock = block;
+       *pblock = block;
     }
   else
     {
@@ -408,7 +408,7 @@ mtinfo_drive::set_pos (HANDLE mt, int mode, long count,
       case TAPE_SPACE_RELATIVE_BLOCKS:
       case TAPE_SPACE_FILEMARKS:
       case TAPE_SPACE_SETMARKS:
-        if (!count)
+       if (!count)
          {
            lasterr = 0;
            goto out;
@@ -417,7 +417,7 @@ mtinfo_drive::set_pos (HANDLE mt, int mode, long count,
       case TAPE_ABSOLUTE_BLOCK:
       case TAPE_LOGICAL_BLOCK:
       case TAPE_REWIND:
-        dont_wait = nowait () ? TRUE : FALSE;
+       dont_wait = nowait () ? TRUE : FALSE;
        break;
     }
   if (mode == TAPE_SPACE_FILEMARKS)
@@ -437,9 +437,9 @@ mtinfo_drive::set_pos (HANDLE mt, int mode, long count,
       case TAPE_LOGICAL_BLOCK:
        get_pos (mt);
        part (partition)->initialize (block);
-        break;
+       break;
       case TAPE_REWIND:
-        if (!err)
+       if (!err)
          {
            block = 0;
            part (partition)->initialize (0);
@@ -454,7 +454,7 @@ mtinfo_drive::set_pos (HANDLE mt, int mode, long count,
        get_pos (mt);
        part (partition)->initialize (block);
        part (partition)->emark = IS_EOM (err) ? eom : eod;
-        break;
+       break;
       case TAPE_SPACE_FILEMARKS:
        if (!err || IS_SM (err))
          {
@@ -469,7 +469,7 @@ mtinfo_drive::set_pos (HANDLE mt, int mode, long count,
              }
            else
              {
-               if (part (partition)->file >= 0)
+               if (part (partition)->file >= 0)
                  part (partition)->file += count - undone;
                part (partition)->fblock = -1;
                part (partition)->smark = false;
@@ -533,17 +533,17 @@ mtinfo_drive::set_pos (HANDLE mt, int mode, long count,
            block = 0;
            part (partition)->initialize (0);
          }
-        break;
+       break;
       case TAPE_SPACE_SETMARKS:
        get_pos (mt);
        part (partition)->block = block;
-        if (!err)
+       if (!err)
          {
            part (partition)->file = -1;
            part (partition)->fblock = -1;
            part (partition)->smark = true;
          }
-        break;
+       break;
     }
   lasterr = err;
 out:
@@ -563,13 +563,13 @@ mtinfo_drive::create_partitions (HANDLE mt, long count)
   if (get_feature (TAPE_DRIVE_INITIATOR))
     {
       if (count <= 0)
-        TAPE_FUNC (CreateTapePartition (mt, TAPE_INITIATOR_PARTITIONS,
+       TAPE_FUNC (CreateTapePartition (mt, TAPE_INITIATOR_PARTITIONS,
                                        count <= 0 ? 0 : 2, (DWORD) count));
     }
   else if (get_feature (TAPE_DRIVE_FIXED))
     {
       /* This is supposed to work for Tandberg SLR drivers up to version
-         1.6 which missed to set the TAPE_DRIVE_INITIATOR flag.  According
+        1.6 which missed to set the TAPE_DRIVE_INITIATOR flag.  According
         to Tandberg, CreateTapePartition(TAPE_FIXED_PARTITIONS) apparently
         does not ignore the dwCount parameter.  Go figure! */
       TAPE_FUNC (CreateTapePartition (mt, TAPE_FIXED_PARTITIONS,
@@ -600,7 +600,7 @@ mtinfo_drive::set_partition (HANDLE mt, long count)
          if (sav_partition != partition)
            {
              if (partition < MAX_PARTITION_NUM
-                 && part (partition)->block != block)
+                 && part (partition)->block != block)
                part (partition)->initialize (block);
            }
          else if (sav_block != block && partition < MAX_PARTITION_NUM)
@@ -608,7 +608,7 @@ mtinfo_drive::set_partition (HANDLE mt, long count)
          lasterr = err;
        }
       else
-        {
+       {
          partition = count;
          if (part (partition)->block == -1)
            part (partition)->initialize (0);
@@ -710,9 +710,9 @@ mtinfo_drive::prepare (HANDLE mt, int action, bool is_auto)
        break;
       case TAPE_LOCK:
        lock = lasterr ? lock_error : is_auto ? auto_locked : locked;
-        break;
+       break;
       case TAPE_UNLOCK:
-        lock = lasterr ? lock_error : unlocked;
+       lock = lasterr ? lock_error : unlocked;
        break;
     }
   return error ("prepare");
@@ -813,12 +813,12 @@ mtinfo_drive::get_status (HANDLE mt, struct mtget *get)
        else
          get->mt_gstat |= GMT_EOF (-1);
       if (part (partition)->emark >= eod_hit)
-        get->mt_gstat |= GMT_EOD (-1);
+       get->mt_gstat |= GMT_EOD (-1);
       if (part (partition)->emark >= eom_hit)
-        get->mt_gstat |= GMT_EOT (-1);
+       get->mt_gstat |= GMT_EOT (-1);
 
       if (part (partition)->smark)
-        get->mt_gstat |= GMT_SM (-1);
+       get->mt_gstat |= GMT_SM (-1);
 
       get->mt_gstat |= GMT_ONLINE (-1);
 
@@ -895,7 +895,7 @@ mtinfo_drive::set_options (HANDLE mt, long options)
          {
            buffer_writes ((options == 1));
          }
-        break;
+       break;
       case MT_ST_BOOLEANS:
        buffer_writes (!!(options & MT_ST_BUFFER_WRITES));
        async_writes (!!(options & MT_ST_ASYNC_WRITES));
@@ -913,10 +913,10 @@ mtinfo_drive::set_options (HANDLE mt, long options)
        if (sdp.ECC != dp ()->ECC || sdp.DataPadding != dp ()->DataPadding
            || sdp.ReportSetmarks != dp ()->ReportSetmarks)
          call_setparams = true;
-        break;
+       break;
       case MT_ST_SETBOOLEANS:
       case MT_ST_CLEARBOOLEANS:
-        set = (what == MT_ST_SETBOOLEANS);
+       set = (what == MT_ST_SETBOOLEANS);
        if (options & MT_ST_BUFFER_WRITES)
          buffer_writes (set);
        if (options & MT_ST_ASYNC_WRITES)
@@ -940,7 +940,7 @@ mtinfo_drive::set_options (HANDLE mt, long options)
        if (sdp.ECC != dp ()->ECC || sdp.DataPadding != dp ()->DataPadding
            || sdp.ReportSetmarks != dp ()->ReportSetmarks)
          call_setparams = true;
-        break;
+       break;
       case MT_ST_EOT_WZ_SIZE:
        if (get_feature (TAPE_DRIVE_SET_EOT_WZ_SIZE))
          {
@@ -948,14 +948,14 @@ mtinfo_drive::set_options (HANDLE mt, long options)
            if (sdp.EOTWarningZoneSize != dp ()->EOTWarningZoneSize)
              call_setparams = true;
          }
-        break;
+       break;
     }
   if (call_setparams)
     {
       TAPE_FUNC (SetTapeParameters (mt, SET_TAPE_DRIVE_INFORMATION, &sdp));
       int err = lasterr;
       if (!err)
-        {
+       {
          dp ()->ECC = sdp.ECC;
          dp ()->DataPadding = sdp.DataPadding;
          dp ()->ReportSetmarks = sdp.ReportSetmarks;
@@ -973,10 +973,10 @@ mtinfo_drive::ioctl (HANDLE mt, unsigned int cmd, void *buf)
   if (cmd == MTIOCTOP)
     {
       if (__check_invalid_read_ptr (buf, sizeof (struct mtop)))
-        return ERROR_NOACCESS;
+       return ERROR_NOACCESS;
       struct mtop *op = (struct mtop *) buf;
       if (lasterr == ERROR_BUS_RESET)
-        {
+       {
          /* If a bus reset occurs, block further access to this device
             until the user rewinds, unloads or in any other way tries
             to maintain a well-known tape position. */
@@ -990,7 +990,7 @@ mtinfo_drive::ioctl (HANDLE mt, unsigned int cmd, void *buf)
              debug_printf ("Couldn't relock drive after bus reset.");
              lock = unlocked;
            }
-        }
+       }
       switch (op->mt_op)
        {
          case MTRESET:
@@ -1120,13 +1120,13 @@ mtinfo_drive::ioctl (HANDLE mt, unsigned int cmd, void *buf)
   else if (cmd == MTIOCGET)
     {
       if (__check_null_invalid_struct (buf, sizeof (struct mtget)))
-        return ERROR_NOACCESS;
+       return ERROR_NOACCESS;
       get_status (mt, (struct mtget *) buf);
     }
   else if (cmd == MTIOCPOS)
     {
       if (__check_null_invalid_struct (buf, sizeof (struct mtpos)))
-        return ERROR_NOACCESS;
+       return ERROR_NOACCESS;
       if (!get_pos (mt))
        ((struct mtpos *) buf)->mt_blkno = block;
     }
@@ -1152,7 +1152,7 @@ mtinfo::initialize (void)
       magic = MTINFO_MAGIC;
       version = MTINFO_VERSION;
       for (unsigned i = 0; i < MAX_DRIVE_NUM; ++i)
-        drive (i)->initialize (i, true);
+       drive (i)->initialize (i, true);
       ReleaseMutex (mtx);
       CloseHandle (mtx);
     }
@@ -1164,7 +1164,7 @@ mtinfo::initialize (void)
        api_fatal ("MT magic number screwed up: %lu, should be %lu",
                   magic, MTINFO_MAGIC);
       if (version != MTINFO_VERSION)
-        system_printf ("MT version number mismatch: %lu, should be %lu",
+       system_printf ("MT version number mismatch: %lu, should be %lu",
                       version, MTINFO_VERSION);
     }
 }
@@ -1297,12 +1297,12 @@ fhandler_dev_tape::raw_read (void *ptr, size_t &ulen)
       buf += bytes_to_read;
       devbufstart += bytes_to_read;
       if (devbufstart == devbufend)
-        devbufstart = devbufend = 0;
+       devbufstart = devbufend = 0;
       /* If a switch to variable block_size occured, just return the buffer
-         remains until the buffer is empty, then proceed with usual variable
+        remains until the buffer is empty, then proceed with usual variable
         block size handling (one block per read call). */
       if (!block_size)
-        len = 0;
+       len = 0;
     }
   if (len > 0)
     {
@@ -1310,7 +1310,7 @@ fhandler_dev_tape::raw_read (void *ptr, size_t &ulen)
        debug_printf ("Creating event failed: %E");
       size_t block_fit = !block_size ? len : rounddown(len,  block_size);
       if (block_fit)
-        {
+       {
          debug_printf ("read %d bytes from tape (rest %d)",
                        block_fit, len - block_fit);
          ret = mt->drive (driveno ())->read (get_handle (), mt_evt, buf,
@@ -1324,7 +1324,7 @@ fhandler_dev_tape::raw_read (void *ptr, size_t &ulen)
              buf += block_fit;
              /* Only one block in each read call, please. */
              if (!block_size)
-               len = 0;
+               len = 0;
            }
          else {
            len = 0;
@@ -1333,7 +1333,7 @@ fhandler_dev_tape::raw_read (void *ptr, size_t &ulen)
          }
        }
       if (!ret && len > 0)
-        {
+       {
          debug_printf ("read %d bytes from tape (one block)", block_size);
          ret = mt->drive (driveno ())->read (get_handle (), mt_evt, devbuf,
                                              block_size);
index bf17e833128493d56607ee58e32084e317309656..f7831fe9bde26ca834c3a69810e2b402415bdaef 100644 (file)
@@ -299,7 +299,7 @@ fhandler_pty_master::process_slave_output (char *buf, size_t len, int pktmode_on
                goto out;
              /* DISCARD (FLUSHO) and tcflush can finish here. */
              if (n == 0 && (get_ttyp ()->ti.c_lflag & FLUSHO || !buf))
-               goto out;
+               goto out;
              if (n == 0 && is_nonblocking ())
                {
                  set_errno (EAGAIN);
@@ -587,7 +587,7 @@ fhandler_tty_slave::open (int flags, mode_t)
          termios_printf ("SetProcessWindowStation %d, %E", b);
        }
       b = AllocConsole ();     // will cause flashing if workstation
-                               // stuff fails
+                               // stuff fails
       termios_printf ("%d = AllocConsole (), %E", b);
       if (b)
        init_console_handler ();
@@ -809,7 +809,7 @@ fhandler_tty_slave::read (void *ptr, size_t& len)
 
       /* On first peek determine no. of bytes to flush. */
       if (!ptr && len == UINT_MAX)
-        len = (size_t) bytes_in_pipe;
+       len = (size_t) bytes_in_pipe;
 
       if (ptr && !vmin && !time_to_wait)
        {
@@ -847,7 +847,7 @@ fhandler_tty_slave::read (void *ptr, size_t& len)
              len -= n;
              totalread += n;
              if (ptr)
-               {
+               {
                  memcpy (ptr, buf, n);
                  ptr = (char *) ptr + n;
                }
@@ -864,7 +864,7 @@ fhandler_tty_slave::read (void *ptr, size_t& len)
          if (!bytes_in_pipe)
            break;
          continue;
-        }
+       }
 
       if (get_ttyp ()->read_retval < 0)        // read error
        {
@@ -1414,7 +1414,7 @@ fhandler_tty_master::init_console ()
     return -1;
 
   console->init (INVALID_HANDLE_VALUE, GENERIC_READ | GENERIC_WRITE, O_BINARY);
-  cygheap->open_fhs--;         /* handled when individual fds are opened */
+  cygheap->open_fhs--;         /* handled when individual fds are opened */
   console->uninterruptible_io (true);
   return 0;
 }
index f46cb89d6663f4111d8a853ddd1cdaab544abb8a..4edfc412830baaf9cfbe8924f658afddc82b8520 100644 (file)
@@ -185,7 +185,7 @@ getgrgid_r (__gid32_t gid, struct __group32 *grp, char *buffer, size_t bufsize,
     return ERANGE;
 
   struct __group32 *tempgr = internal_getgrgid (gid, true);
-  pthread_testcancel (); 
+  pthread_testcancel ();
   if (!tempgr)
     return 0;
 
@@ -242,7 +242,7 @@ getgrnam_r (const char *nam, struct __group32 *grp, char *buffer,
     return ERANGE;
 
   struct __group32 *tempgr = internal_getgrnam (nam, true);
-  pthread_testcancel (); 
+  pthread_testcancel ();
   if (!tempgr)
     return 0;
 
@@ -373,7 +373,7 @@ internal_getgroups (int gidsetsize, __gid32_t *grouplist, cygpsid * srchsid)
                    for (DWORD pg = 0; pg < groups->GroupCount; ++pg)
                      if (sid == groups->Groups[pg].Sid &&
                          sid != well_known_world_sid)
-                       {
+                       {
                          if (cnt < gidsetsize)
                            grouplist[cnt] = gr->gr_gid;
                          ++cnt;
index 9ea5d9ba730feb2801786e8ac08b027a3ea1a1b1..9f86f9911ef3738d6bd5a48b8dcffed41f7e6bd6 100644 (file)
@@ -145,7 +145,7 @@ sbrk (int n)
     newbrksize = commitbytes;
 
    if ((VirtualAlloc (cygheap->user_heap.top, newbrksize, MEM_RESERVE, PAGE_NOACCESS)
-        || VirtualAlloc (cygheap->user_heap.top, newbrksize = commitbytes, MEM_RESERVE, PAGE_NOACCESS))
+       || VirtualAlloc (cygheap->user_heap.top, newbrksize = commitbytes, MEM_RESERVE, PAGE_NOACCESS))
        && VirtualAlloc (cygheap->user_heap.top, commitbytes, MEM_COMMIT, PAGE_READWRITE) != NULL)
      {
        cygheap->user_heap.max = (char *) cygheap->user_heap.max + pround (newbrksize);
index 9ba585ecb58148cd8aa7ea9d092d16510f75068e..e42698e361dc0386296373572523a77e6960577a 100644 (file)
@@ -81,7 +81,7 @@ munge_threadfunc ()
     /* no need for the overhead */;
   else
     {
-      for (i = 0; threadfunc_ix[i]; i++)               
+      for (i = 0; threadfunc_ix[i]; i++)
        ebp[threadfunc_ix[i]] = (char *) threadfunc_fe;
       ((char **) _tlsbase)[OLDFUNC_OFFSET] = threadfunc;
     }
index 4de52f230b68d51dd679b5b79f5db4d66ea7a7fb..71393fb87adaa6038bcca4abb32d76d83324f14b 100644 (file)
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  *
  * CV 2003-09-10: Cygwin specific changes applied.  Code simplified just
- *                for Cygwin alone.
+ *               for Cygwin alone.
  */
 
 #include "winsup.h"
@@ -96,11 +96,11 @@ login_tty (int fd)
   if ((fdname = ttyname (fd)))
     {
       if (fd != STDIN_FILENO)
-        close (STDIN_FILENO);
+       close (STDIN_FILENO);
       if (fd != STDOUT_FILENO)
-        close (STDOUT_FILENO);
+       close (STDOUT_FILENO);
       if (fd != STDERR_FILENO)
-        close (STDERR_FILENO);
+       close (STDERR_FILENO);
       newfd = open (fdname, O_RDWR);
       close (newfd);
     }
@@ -126,7 +126,7 @@ openpty (int *amaster, int *aslave, char *name, struct termios *termp,
       strcpy (pts, ptsname (master));
       revoke (pts);
       if ((slave = open (pts, O_RDWR | O_NOCTTY)) >= 0)
-        {
+       {
          if (amaster)
            *amaster = master;
          if (aslave)
@@ -251,11 +251,11 @@ setprogname (const char *newprogname)
   if (!check_null_str_errno (newprogname))
     {
       /* Per BSD man page, setprogname keeps a pointer to the last
-         path component of the argument.  It does *not* copy the
+        path component of the argument.  It does *not* copy the
         argument before. */
       __progname = strrchr (newprogname, '/');
       if (__progname)
-        ++__progname;
+       ++__progname;
       else
        __progname = (char *)newprogname;
     }
index 7e80f669b08034c9a9ecf8ad230e7f7d636d2ef8..d226cc0c01daf83a81aa993ddb30faa508a52bff 100644 (file)
@@ -105,29 +105,29 @@ msgctl (int msqid, int cmd, struct msqid_ds *buf)
       case IPC_STAT:
        if (__check_null_invalid_struct_errno (buf, sizeof *buf))
          return -1;
-        break;
+       break;
       case IPC_SET:
        if (__check_invalid_read_ptr_errno (buf, sizeof *buf))
          return -1;
-        break;
+       break;
       case IPC_RMID:
-        break;
+       break;
       case IPC_INFO:
        /* msqid == 0: Request for msginfo struct. */
        if (!msqid
            && __check_null_invalid_struct_errno (buf, sizeof (struct msginfo)))
            return -1;
        /* Otherwise, request msqid entries from internal msqid_ds array. */
-        if (msqid)
+       if (msqid)
          if (__check_null_invalid_struct_errno (buf, msqid * sizeof (struct msqid_ds)))
            return -1;
-        break;
+       break;
       case MSG_INFO:
-        if (__check_null_invalid_struct_errno (buf, sizeof (struct msg_info)))
+       if (__check_null_invalid_struct_errno (buf, sizeof (struct msg_info)))
          return -1;
-        break;
+       break;
       default:
-        syscall_printf ("-1 [%d] = msgctl ()", EINVAL);
+       syscall_printf ("-1 [%d] = msgctl ()", EINVAL);
        set_errno (EINVAL);
        return -1;
     }
@@ -137,7 +137,7 @@ msgctl (int msqid, int cmd, struct msqid_ds *buf)
       syscall_printf ("-1 [%d] = msgctl ()", request.error_code ());
       set_errno (request.error_code ());
       if (request.error_code () == ENOSYS)
-        raise (SIGSYS);
+       raise (SIGSYS);
       return -1;
     }
   return request.retval ();
@@ -159,7 +159,7 @@ msgget (key_t key, int msgflg)
       syscall_printf ("-1 [%d] = msgget ()", request.error_code ());
       set_errno (request.error_code ());
       if (request.error_code () == ENOSYS)
-        raise (SIGSYS);
+       raise (SIGSYS);
       return -1;
     }
   return request.retval ();
@@ -175,7 +175,7 @@ msgrcv (int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg)
 {
 #ifdef USE_SERVER
   syscall_printf ("msgrcv (msqid = %d, msgp = %p, msgsz = %d, "
-                 "msgtyp = %d, msgflg = 0x%x)",
+                 "msgtyp = %d, msgflg = 0x%x)",
                  msqid, msgp, msgsz, msgtyp, msgflg);
   if (__check_null_invalid_struct_errno (msgp, msgsz))
     return -1;
@@ -185,7 +185,7 @@ msgrcv (int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg)
       syscall_printf ("-1 [%d] = msgrcv ()", request.error_code ());
       set_errno (request.error_code ());
       if (request.error_code () == ENOSYS)
-        raise (SIGSYS);
+       raise (SIGSYS);
       return -1;
     }
   return request.rcvval ();
@@ -210,7 +210,7 @@ msgsnd (int msqid, const void *msgp, size_t msgsz, int msgflg)
       syscall_printf ("-1 [%d] = msgsnd ()", request.error_code ());
       set_errno (request.error_code ());
       if (request.error_code () == ENOSYS)
-        raise (SIGSYS);
+       raise (SIGSYS);
       return -1;
     }
   return request.retval ();
index 52dd6b24fc90c6b8dcb1c23fee6ecc9f95f3b6cc..cf694964e1c39cf2d258748a4653a29aa0d65780 100644 (file)
@@ -84,7 +84,7 @@ class mtinfo_drive
   inline int error (const char *str)
     {
       if (lasterr)
-        debug_printf ("%s: Win32 error %d", lasterr);
+       debug_printf ("%s: Win32 error %d", lasterr);
       return lasterr;
     }
   inline bool get_feature (DWORD parm)
index 58c3a9fabe9945cb21015225701d7a5ffecf8e08..b958e43655d4e98c5a8bc64f1375bf72527b4575 100644 (file)
@@ -1953,7 +1953,7 @@ cygwin_rresvport (int *port)
       cygheap_fdnew res_fd;
 
       if (res_fd >= 0 && fdsock (res_fd, tcp_dev, res))
-        res = res_fd;
+       res = res_fd;
       else
        res = -1;
     }
index 536f4ae90b05fc410d0b54d2923b51b4d015a767..3175d92aab08585817fb3f1bacbb82395f475c5c 100644 (file)
@@ -78,7 +78,7 @@ pwdgrp::read_passwd ()
        !internal_getpwuid (myself->uid))))
     {
       static char linebuf[1024];       // must be static and
-                                       // should not be NO_COPY
+                                       // should not be NO_COPY
       (void) cygheap->user.ontherange (CH_HOME, NULL);
       snprintf (linebuf, sizeof (linebuf), "%s:*:%lu:%lu:,%s:%s:/bin/sh",
                cygheap->user.name (),
index 6ab938bd186a718210bf9d54f963bf79f8af8a93..102f51338e94d57ececcc297d572524a5c550caf 100644 (file)
@@ -461,20 +461,20 @@ path_conv::set_normalized_path (const char *path_copy)
 PUNICODE_STRING
 path_conv::get_nt_native_path (UNICODE_STRING &upath, WCHAR *wpath)
 {
-  if (path[0] != '\\')             /* X:\...  or NUL, etc. */
+  if (path[0] != '\\')                 /* X:\...  or NUL, etc. */
     {
       str2buf2uni (upath, wpath, "\\??\\");
       str2buf2uni_cat (upath, path);
     }
-  else if (path[1] != '\\')        /* \Device\... */
+  else if (path[1] != '\\')            /* \Device\... */
     str2buf2uni (upath, wpath, path);
-  else if (path[2] != '.' 
-          || path[3] != '\\')     /* \\server\share\... */
+  else if (path[2] != '.'
+          || path[3] != '\\')          /* \\server\share\... */
     {
       str2buf2uni (upath, wpath, "\\??\\UNC\\");
       str2buf2uni_cat (upath, path + 2);
-    }        
-  else                                          /* \\.\device */
+    }
+  else                                 /* \\.\device */
     {
       str2buf2uni (upath, wpath, "\\??\\");
       str2buf2uni_cat (upath, path + 4);
@@ -550,21 +550,21 @@ path_conv::check (const char *src, unsigned opt,
         into account during processing */
       if (tail > path_copy + 1)
        {
-          if (isslash (tail[-1]))
-            {
+         if (isslash (tail[-1]))
+           {
               need_directory = 1;
               tail--;
            }
-          /* Remove trailing dots and spaces which are ignored by Win32 functions but
+         /* Remove trailing dots and spaces which are ignored by Win32 functions but
             not by native NT functions. */
-          while (tail[-1] == '.' || tail[-1] == ' ') 
+         while (tail[-1] == '.' || tail[-1] == ' ')
            tail--;
-          if (tail > path_copy + 1 && isslash (tail[-1]))
-            {
+         if (tail > path_copy + 1 && isslash (tail[-1]))
+           {
              error = ENOENT;
-              return;
+             return;
            }
-        }
+       }
       path_end = tail;
       *tail = '\0';
 
@@ -1017,7 +1017,7 @@ normalize_win32_path (const char *src, char *dst, char **tail)
       else if (src[0] == '.' && src[1] == '.'
               /* dst must be greater than dst_start */
               && dst[-1] == '\\')
-        {
+       {
          if (isdirsep (src[2]) || src[2] == 0)
            {
              /* Back up over /, but not if it's the first one.  */
@@ -3316,7 +3316,7 @@ chdir (const char *in_dir)
         defeat the Windows 95 (i.e. MS-DOS) tendency of returning to
         the last directory visited on the given drive. */
       if (isdrive (native_dir) && !native_dir[2])
-        {
+       {
          path.get_win32 ()[2] = '\\';
          path.get_win32 ()[3] = '\0';
        }
@@ -3325,7 +3325,7 @@ chdir (const char *in_dir)
         The posix_cwd is just path.normalized_path.
         In other cases we let cwd.set obtain the Posix path through
         the mount table. */
-      if (!path.has_symlinks () && !isabspath (in_dir))
+      if (!isdrive(path.normalized_path))
        posix_cwd = path.normalized_path;
       res = 0;
       doit = true;
@@ -3674,10 +3674,10 @@ cwdstuff::set (const char *win32_cwd, const char *posix_cwd, bool doit)
     {
        cwd_lock->acquire ();
        if (doit && !SetCurrentDirectory (win32_cwd))
-         {
-            __seterrno ();
-            goto out;
-         }
+        {
+           __seterrno ();
+           goto out;
+        }
     }
   /* If there is no win32 path or it has the form c:xxx, get the value */
   if (!win32_cwd || (isdrive (win32_cwd) && win32_cwd[2] != '\\'))
@@ -3685,13 +3685,13 @@ cwdstuff::set (const char *win32_cwd, const char *posix_cwd, bool doit)
       int i;
       DWORD len, dlen;
       for (i = 0, dlen = CYG_MAX_PATH/3; i < 2; i++, dlen = len)
-        {
+       {
          win32 = (char *) crealloc (win32, dlen);
          if ((len = GetCurrentDirectoryA (dlen, win32)) < dlen)
            break;
        }
       if (len == 0)
-        {
+       {
          __seterrno ();
          debug_printf ("GetCurrentDirectory, %E");
          win32_cwd = pathbuf; /* Force lock release */
index 8f9bda91123b39e315c718e304986c224e597f30..4afbac8580d1570928eca07cb0824507fbd82c98 100644 (file)
@@ -104,7 +104,7 @@ poll (struct pollfd *fds, unsigned int nfds, int timeout)
                          {
                            case -1: /* Something weird happened */
                              /* When select returns that data is available,
-                                that could mean that the socket is in
+                                that could mean that the socket is in
                                 listen mode and a client tries to connect.
                                 Unfortunately, recvfrom() doesn't make much
                                 sense then.  It returns WSAENOTCONN in that
index 548c659574db35da336ede8574f4375f17ad8317..0f4b2fec7f347eeeb10c8f4072de87a790c999a2 100644 (file)
@@ -284,7 +284,7 @@ sched_rr_get_interval (pid_t pid, struct timespec *interval)
     forprocid = 0;
 
   reg_key reg (HKEY_LOCAL_MACHINE, KEY_READ, "SYSTEM", "CurrentControlSet",
-               "Control", "PriorityControl", NULL);
+              "Control", "PriorityControl", NULL);
   if (reg.error ())
     {
       set_errno (ESRCH);
index b97dcd0283cd43169467890d0e8e43ad4353531c..852ef5b524be22e7e2fadf173dea5f25ebb0bfad 100644 (file)
@@ -385,7 +385,7 @@ enable_restore_privilege ()
     {
       int res = 2 + set_process_privilege (SE_RESTORE_NAME, true, issetuid);
       if (!issetuid)
-        saved_res = res;
+       saved_res = res;
     }
 }
 
index 29dd0a056132f424fffd2dc03b9bffb46ed91d9c..6ae52e9ff08cb7d67fe467e738f5e43936ea6b7b 100644 (file)
@@ -1077,7 +1077,7 @@ out:
    of the SD on success. Unfortunately NT returns
    0 in `len' on success, while W2K returns the
    correct size!
-   
+
    2003-11-26: Now the function allocates the space needed by itself so
    it knows the real size and returns it in the security_descriptor object.
 */
@@ -1142,7 +1142,7 @@ write_sd (HANDLE fh, const char *file, security_descriptor &sd)
                                     NULL)) == INVALID_HANDLE_VALUE)
        break;
       if (fh && (ret = NtSetSecurityObject (fh,
-                                           DACL_SECURITY_INFORMATION 
+                                           DACL_SECURITY_INFORMATION
                                            | GROUP_SECURITY_INFORMATION
                                            | OWNER_SECURITY_INFORMATION,
                                            sd)) == STATUS_SUCCESS)
@@ -1768,7 +1768,7 @@ set_security_attribute (int attribute, PSECURITY_ATTRIBUTES psa,
   InitializeSecurityDescriptor ((PSECURITY_DESCRIPTOR)psa->lpSecurityDescriptor,
                                SECURITY_DESCRIPTOR_REVISION);
   psa->lpSecurityDescriptor = alloc_sd (geteuid32 (), getegid32 (),
-                                       attribute, sd);
+                                       attribute, sd);
 }
 
 static int
index c623db122790eacba218b31e1b8bc8574a7330d4..1d7f53c67bcf9d9ef93bd93e6d6f0d244059e28b 100644 (file)
@@ -116,7 +116,7 @@ semctl (int semid, int semnum, int cmd, ...)
       syscall_printf ("-1 [%d] = semctl ()", request.error_code ());
       set_errno (request.error_code ());
       if (request.error_code () == ENOSYS)
-        raise (SIGSYS);
+       raise (SIGSYS);
       return -1;
     }
   return request.retval ();
@@ -139,7 +139,7 @@ semget (key_t key, int nsems, int semflg)
       syscall_printf ("-1 [%d] = semget ()", request.error_code ());
       set_errno (request.error_code ());
       if (request.error_code () == ENOSYS)
-        raise (SIGSYS);
+       raise (SIGSYS);
       return -1;
     }
   return request.retval ();
@@ -164,7 +164,7 @@ semop (int semid, struct sembuf *sops, size_t nsops)
       syscall_printf ("-1 [%d] = semop ()", request.error_code ());
       set_errno (request.error_code ());
       if (request.error_code () == ENOSYS)
-        raise (SIGSYS);
+       raise (SIGSYS);
       return -1;
     }
   return request.retval ();
index 42beb54f97661c2fcf4a7756e033f3a83b6e56d4..65adc3e2731f7ac1191a28c0a2b2cbcf59080c24 100644 (file)
@@ -97,7 +97,7 @@ open_shared (const char *name, int n, HANDLE &shared_h, DWORD size,
       if (!name)
        mapname = NULL;
       else
-        mapname = shared_name (map_buf, name, n);
+       mapname = shared_name (map_buf, name, n);
       if (!(shared_h = CreateFileMapping (INVALID_HANDLE_VALUE, psa,
                                          PAGE_READWRITE, 0, size, mapname)))
        api_fatal ("CreateFileMapping %s, %E.  Terminating.", mapname);
@@ -163,7 +163,7 @@ user_shared_initialize (bool reinit)
   if (!cygwin_user_h)
     {
       if (wincap.has_security ())
-        {
+       {
          cygpsid tu (cygheap->user.sid ());
          tu.string (name);
        }
index 4bae7b2d28d12e2a2fef182e2a3c8c91efc51507..a5fbe3a7148dda4ddd0da5d34cbcf631ef59e875 100644 (file)
@@ -133,9 +133,9 @@ fixup_shms_after_fork ()
   SLIST_FOREACH (sph_entry, &sph_list, sph_next)
     {
       vm_object_t ptr = MapViewOfFileEx(sph_entry->hdl, sph_entry->access,
-                                       0, 0, sph_entry->size, sph_entry->ptr);
+                                       0, 0, sph_entry->size, sph_entry->ptr);
       if (ptr != sph_entry->ptr)
-        api_fatal ("MapViewOfFileEx (%p), %E.  Terminating.", sph_entry->ptr);
+       api_fatal ("MapViewOfFileEx (%p), %E.  Terminating.", sph_entry->ptr);
     }
   return 0;
 }
@@ -161,13 +161,13 @@ shmat (int shmid, const void *shmaddr, int shmflg)
   if (!ssh_entry)
     {
       /* The shmid is unknown to this process so far.  Try to get it from
-         the server if it exists.  Use special internal call to shmget,
+        the server if it exists.  Use special internal call to shmget,
         which interprets the key as a shmid and only returns a valid
         shmid if one exists.  Since shmctl inserts a new entry for this
         shmid into ssh_list automatically, we just have to go through
         that list again.  If that still fails, well, bad luck. */
       if (shmid && shmget ((key_t) shmid, 0, IPC_KEY_IS_SHMID) != -1)
-        {
+       {
          SLIST_FOREACH (ssh_entry, &ssh_list, ssh_next)
            {
              if (ssh_entry->shmid == shmid)
@@ -175,7 +175,7 @@ shmat (int shmid, const void *shmaddr, int shmflg)
            }
        }
       if (!ssh_entry)
-        {
+       {
          /* Invalid shmid */
          set_errno (EINVAL);
          return (void *) -1;
@@ -185,11 +185,11 @@ shmat (int shmid, const void *shmaddr, int shmflg)
   if (shmaddr)
     {
       if (shmflg & SHM_RND)
-        attach_va = (vm_object_t)((vm_offset_t)shmaddr & ~(SHMLBA-1));
+       attach_va = (vm_object_t)((vm_offset_t)shmaddr & ~(SHMLBA-1));
       else
        attach_va = (vm_object_t)shmaddr;
       /* Don't even bother to call anything if shmaddr is NULL or
-         not aligned. */
+        not aligned. */
       if (!attach_va || (vm_offset_t)attach_va % SHMLBA)
        {
          set_errno (EINVAL);
@@ -222,7 +222,7 @@ shmat (int shmid, const void *shmaddr, int shmflg)
       delete sph_entry;
       set_errno (request.error_code ());
       if (request.error_code () == ENOSYS)
-        raise (SIGSYS);
+       raise (SIGSYS);
       return (void *) -1;
     }
   sph_entry->ptr = ptr;
@@ -250,7 +250,7 @@ shmctl (int shmid, int cmd, struct shmid_ds *buf)
       case IPC_SET:
        if (__check_null_invalid_struct_errno (buf, sizeof (struct shmid_ds)))
          return -1;
-        break;
+       break;
       case IPC_INFO:
        /* shmid == 0: Request for shminfo struct. */
        if (!shmid
@@ -260,11 +260,11 @@ shmctl (int shmid, int cmd, struct shmid_ds *buf)
        if (shmid)
          if (__check_null_invalid_struct_errno (buf, shmid * sizeof (struct shmid_ds)))
            return -1;
-        break;
+       break;
       case SHM_INFO:
-        if (__check_null_invalid_struct_errno (buf, sizeof (struct shm_info)))
+       if (__check_null_invalid_struct_errno (buf, sizeof (struct shm_info)))
          return -1;
-        break;
+       break;
     }
   client_request_shm request (shmid, cmd, buf);
   if (request.make_request () == -1 || request.retval () == -1)
@@ -272,7 +272,7 @@ shmctl (int shmid, int cmd, struct shmid_ds *buf)
       syscall_printf ("-1 [%d] = shmctl ()", request.error_code ());
       set_errno (request.error_code ());
       if (request.error_code () == ENOSYS)
-        raise (SIGSYS);
+       raise (SIGSYS);
       return -1;
     }
   if (cmd == IPC_RMID)
@@ -280,7 +280,7 @@ shmctl (int shmid, int cmd, struct shmid_ds *buf)
       /* The process must cleanup its own storage... */
       shm_shmid_list *ssh_entry, *ssh_next_entry;
       SLIST_FOREACH_SAFE (ssh_entry, &ssh_list, ssh_next, ssh_next_entry)
-        {
+       {
          if (ssh_entry->shmid == shmid)
            {
              SLIST_REMOVE (&ssh_list, ssh_entry, shm_shmid_list, ssh_next);
@@ -310,7 +310,7 @@ shmdt (const void *shmaddr)
       syscall_printf ("-1 [%d] = shmdt ()", request.error_code ());
       set_errno (request.error_code ());
       if (request.error_code () == ENOSYS)
-        raise (SIGSYS);
+       raise (SIGSYS);
       return -1;
     }
   shm_attached_list *sph_entry, *sph_next_entry;
@@ -318,7 +318,7 @@ shmdt (const void *shmaddr)
   SLIST_FOREACH_SAFE (sph_entry, &sph_list, sph_next, sph_next_entry)
     {
       if (sph_entry->ptr == shmaddr)
-        {
+       {
          SLIST_REMOVE (&sph_list, sph_entry, shm_attached_list, sph_next);
          /* ...and unmap view. */
          UnmapViewOfFile (sph_entry->ptr);
@@ -354,7 +354,7 @@ shmget (key_t key, size_t size, int shmflg)
       delete ssh_new_entry;
       set_errno (request.error_code ());
       if (request.error_code () == ENOSYS)
-        raise (SIGSYS);
+       raise (SIGSYS);
       return -1;
     }
   int shmid = request.retval ();       /* Shared mem ID */
@@ -363,7 +363,7 @@ shmget (key_t key, size_t size, int shmflg)
   SLIST_FOREACH (ssh_entry, &ssh_list, ssh_next)
     {
       if (ssh_entry->shmid == shmid)
-        {
+       {
          /* We already maintain an entry for this shmid.  That means,
             the hdl returned by cygserver is a superfluous duplicate
             of the original hdl maintained by cygserver.  We can safely
index 055029979a4719823328b6de7015c61b59010786..47096f086f0ec3118f8eba893b1a3d1524b03c9a 100644 (file)
@@ -426,7 +426,7 @@ proc_subproc (DWORD what, DWORD val)
 
     scan_wait:
       /* Scan the linked list of wait()ing threads.  If a wait's parameters
-         match this pid, then activate it.  */
+        match this pid, then activate it.  */
       for (w = &waitq_head; w->next != NULL; w = w->next)
        {
          if ((potential_match = checkstate (w)) > 0)
@@ -759,7 +759,7 @@ sig_send (_pinfo *p, siginfo_t& si, _cygtls *tls)
   if (!WriteFile (sendsig, &pack, sizeof (pack), &nb, NULL) || nb != sizeof (pack))
     {
       /* Couldn't send to the pipe.  This probably means that the
-         process is exiting.  */
+        process is exiting.  */
       if (!its_me)
        {
          sigproc_printf ("WriteFile for pipe %p failed, %E", sendsig);
index e7a698bb7de7d40f4e881ed8b59e9e934bb88133..b524e61f3062f6619e57780d33f4fbe4695d0dea 100644 (file)
@@ -916,7 +916,7 @@ chmod (const char *path, mode_t mode)
   fhandler_base *fh;
   if (!(fh = build_fh_name (path, NULL, PC_SYM_FOLLOW, stat_suffixes)))
     goto error;
-      
+
   if (fh->error ())
     {
       debug_printf ("got %d error from build_fh_name", fh->error ());
@@ -1058,10 +1058,10 @@ stat_worker (const char *name, struct __stat64 *buf, int nofollow)
   if (check_null_invalid_struct_errno (buf))
     goto error;
 
-  if (!(fh = build_fh_name (name, NULL, nofollow ? PC_SYM_NOFOLLOW : PC_SYM_FOLLOW, 
+  if (!(fh = build_fh_name (name, NULL, nofollow ? PC_SYM_NOFOLLOW : PC_SYM_FOLLOW,
                            stat_suffixes)))
     goto error;
-  
+
   if (fh->error ())
     {
       debug_printf ("got %d error from build_fh_name", fh->error ());
@@ -1162,7 +1162,7 @@ access (const char *fn, int flags)
     {
       fhandler_base *fh = build_fh_name (fn, NULL, PC_SYM_FOLLOW, stat_suffixes);
       if (fh)
-        {
+       {
          res =  fh->fhaccess (flags);
          delete fh;
        }
@@ -1492,7 +1492,7 @@ ttyname_r (int fd, char *buf, size_t buflen)
       else if (buflen < strlen (cfd->ttyname ()) + 1)
        ret = ERANGE;
       else
-        strcpy (buf, cfd->ttyname ());
+       strcpy (buf, cfd->ttyname ());
     }
   debug_printf ("returning %d tty: %s", ret, ret ? "NULL" : buf);
   return ret;
index 4de8d8738a233866d0586040b81c148e24e14b39..66e4fc44188859b141a672531ae51c93d651099b 100644 (file)
@@ -52,7 +52,7 @@ sysconf (int in)
       case _SC_SAVED_IDS:
        return _POSIX_SAVED_IDS;
       case _SC_LOGIN_NAME_MAX:
-        return LOGIN_NAME_MAX;
+       return LOGIN_NAME_MAX;
       case _SC_GETPW_R_SIZE_MAX:
       case _SC_GETGR_R_SIZE_MAX:
        return 16*1024;
@@ -104,7 +104,7 @@ sysconf (int in)
          }
        break;
       case _SC_AVPHYS_PAGES:
-        if (wincap.supports_smp ())
+       if (wincap.supports_smp ())
          {
            NTSTATUS ret;
            SYSTEM_PERFORMANCE_INFORMATION spi;
@@ -124,7 +124,7 @@ sysconf (int in)
       case _SC_RTSIG_MAX:
        return RTSIG_MAX;
       case _SC_TTY_NAME_MAX:
-        return TTY_NAME_MAX;
+       return TTY_NAME_MAX;
     }
 
   /* Invalid input or unimplemented sysconf name */
index 8c36dfbce565bd9c24ec04543eed17686989a5c3..4cac624b8570ff05a454a763efcfcc103b62a734 100644 (file)
@@ -173,7 +173,7 @@ pthread::init_mainthread ()
     {
       thread = new pthread ();
       if (!thread)
-        api_fatal ("failed to create mainthread object");
+       api_fatal ("failed to create mainthread object");
     }
 
   set_tls_self_pointer (thread);
@@ -1436,9 +1436,9 @@ bool
 pthread_mutex::is_good_initializer (pthread_mutex_t const *mutex)
 {
   if (verifyable_object_isvalid (mutex, PTHREAD_MUTEX_MAGIC,
-                                 PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP,
-                                 PTHREAD_NORMAL_MUTEX_INITIALIZER_NP,
-                                 PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP) != VALID_STATIC_OBJECT)
+                                PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP,
+                                PTHREAD_NORMAL_MUTEX_INITIALIZER_NP,
+                                PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP) != VALID_STATIC_OBJECT)
     return false;
   return true;
 }
@@ -1447,9 +1447,9 @@ bool
 pthread_mutex::is_good_initializer_or_object (pthread_mutex_t const *mutex)
 {
   if (verifyable_object_isvalid (mutex, PTHREAD_MUTEX_MAGIC,
-                                 PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP,
-                                 PTHREAD_NORMAL_MUTEX_INITIALIZER_NP,
-                                 PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP) == INVALID_OBJECT)
+                                PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP,
+                                PTHREAD_NORMAL_MUTEX_INITIALIZER_NP,
+                                PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP) == INVALID_OBJECT)
     return false;
   return true;
 }
@@ -1458,9 +1458,9 @@ bool
 pthread_mutex::is_good_initializer_or_bad_object (pthread_mutex_t const *mutex)
 {
   if (verifyable_object_isvalid (mutex, PTHREAD_MUTEX_MAGIC,
-                                 PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP,
-                                 PTHREAD_NORMAL_MUTEX_INITIALIZER_NP,
-                                 PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP) == VALID_OBJECT)
+                                PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP,
+                                PTHREAD_NORMAL_MUTEX_INITIALIZER_NP,
+                                PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP) == VALID_OBJECT)
     return false;
   return true;
 }
@@ -1662,7 +1662,7 @@ semaphore::semaphore (const char *sem_name, int oflag, mode_t mode,
                                  unsigned int value)
 : verifyable_object (SEM_MAGIC),
   shared (PTHREAD_PROCESS_SHARED),
-  currentvalue (value),                /* Unused for named semaphores. */
+  currentvalue (value),                /* Unused for named semaphores. */
   name (NULL)
 {
   if (oflag & O_CREAT)
@@ -1853,7 +1853,7 @@ check_valid_pointer (void const *pointer)
 
 verifyable_object_state
 verifyable_object_isvalid (void const * objectptr, long magic, void *static_ptr1,
-                           void *static_ptr2, void *static_ptr3)
+                          void *static_ptr2, void *static_ptr3)
 {
   verifyable_object **object = (verifyable_object **)objectptr;
   if (check_valid_pointer (object))
@@ -2880,8 +2880,8 @@ pthread_equal (pthread_t t1, pthread_t t2)
 
 int
 pthread_mutex::init (pthread_mutex_t *mutex,
-                     const pthread_mutexattr_t *attr,
-                     const pthread_mutex_t initializer)
+                    const pthread_mutexattr_t *attr,
+                    const pthread_mutex_t initializer)
 {
   pthread_mutex_t new_mutex;
 
@@ -2907,11 +2907,11 @@ pthread_mutex::init (pthread_mutex_t *mutex,
   if (!attr && initializer)
     {
       if (initializer == PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP)
-        new_mutex->type = PTHREAD_MUTEX_RECURSIVE;
+       new_mutex->type = PTHREAD_MUTEX_RECURSIVE;
       else if (initializer == PTHREAD_NORMAL_MUTEX_INITIALIZER_NP)
-        new_mutex->type = PTHREAD_MUTEX_NORMAL;
+       new_mutex->type = PTHREAD_MUTEX_NORMAL;
       else if (initializer == PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP)
-        new_mutex->type = PTHREAD_MUTEX_ERRORCHECK;
+       new_mutex->type = PTHREAD_MUTEX_ERRORCHECK;
     }
 
   *mutex = new_mutex;
index b560f73dd81d80c178adb3ef2cc7e69a986dd0a3..712e36f03eb021c51adff2a317e805da86d16992 100644 (file)
@@ -121,9 +121,9 @@ typedef enum
 } verifyable_object_state;
 
 verifyable_object_state verifyable_object_isvalid (void const * objectptr, long magic,
-                                                   void *static_ptr1 = NULL,
-                                                   void *static_ptr2 = NULL,
-                                                   void *static_ptr3 = NULL);
+                                                  void *static_ptr1 = NULL,
+                                                  void *static_ptr2 = NULL,
+                                                  void *static_ptr3 = NULL);
 
 template <class list_node> inline void
 List_insert (list_node *&head, list_node *node)
@@ -279,7 +279,7 @@ public:
   static bool can_be_unlocked (pthread_mutex_t const *mutex);
   static void init_mutex ();
   static int init (pthread_mutex_t *mutex, const pthread_mutexattr_t *attr,
-                   const pthread_mutex_t initializer = NULL);
+                  const pthread_mutex_t initializer = NULL);
 
   unsigned long lock_counter;
   HANDLE win32_obj_id;
index e374acb7c11c664602ef86c1b48004fc49d34dde..eea5ec42ea7ad59fac81ee7904d67d997070d77d 100644 (file)
@@ -325,19 +325,19 @@ tty::alive (const char *fmt)
   return ev != NULL;
 }
 
-HANDLE 
+HANDLE
 tty::open_output_mutex ()
 {
   return open_mutex (OUTPUT_MUTEX);
-} 
+}
 
 HANDLE
 tty::open_input_mutex ()
 {
   return open_mutex (INPUT_MUTEX);
-} 
+}
 
-HANDLE 
+HANDLE
 tty::open_mutex (const char *mutex)
 {
   char buf[CYG_MAX_PATH];
index 2bf164ff6033d5e431ce31522874b4e740082139..4c9dacb8f63e7afc36b80ba55e3fc3dc422e1df0 100644 (file)
@@ -75,7 +75,7 @@ cygheap_user::init ()
 
   BOOL acl_exists, dummy;
   TOKEN_DEFAULT_DACL dacl;
-  if (GetSecurityDescriptorDacl (psd, &acl_exists, 
+  if (GetSecurityDescriptorDacl (psd, &acl_exists,
                                 &dacl.DefaultDacl, &dummy)
       && acl_exists && dacl.DefaultDacl)
     {
@@ -118,7 +118,7 @@ internal_getlogin (cygheap_user &user)
              HANDLE ptok;
              if (gsid != user.groups.pgsid
                  && OpenProcessToken (hMainProc, TOKEN_ADJUST_DEFAULT, &ptok))
-               {
+               {
                  /* Set primary group to the group in /etc/passwd. */
                  if (!SetTokenInformation (ptok, TokenPrimaryGroup,
                                            &gsid, sizeof gsid))
@@ -148,7 +148,7 @@ uinfo_init ()
   /* Conditions must match those in spawn to allow starting child
      processes with ruid != euid and rgid != egid. */
   else if (cygheap->user.issetuid ()
-          && cygheap->user.saved_uid == cygheap->user.real_uid
+          && cygheap->user.saved_uid == cygheap->user.real_uid
           && cygheap->user.saved_gid == cygheap->user.real_gid
           && !cygheap->user.groups.issetgroups ())
     {
index 4018a6e62605b8532bc1e78807459d55df6ae186..0a9307068827b093cbca5defe21f8cc0689eb779 100644 (file)
@@ -581,7 +581,7 @@ wincapc::init ()
              if (strcmp (version.szCSDVersion, "Service Pack 4") < 0)
                caps = &wincap_nt4;
              else
-               {
+               {
                  caps = &wincap_nt4sp4;
                  if (strcmp (version.szCSDVersion, "Service Pack 6") >= 0)
                    has_osversioninfoex = true;
@@ -591,7 +591,7 @@ wincapc::init ()
              os = "NT";
              has_osversioninfoex = true;
              switch (version.dwMinorVersion)
-               {
+               {
                  case 0:
                    caps = &wincap_2000;
                    break;
This page took 0.117838 seconds and 5 git commands to generate.