This is the mail archive of the newlib@sources.redhat.com mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[PATCH] Remove some cygwin cruft from newlib


This patch started out as an attempt to remove Windows path considerations from
newlib when controlled by the __CYGWIN32__ (sic) conditional.  This led me to
remove a couple of additional uses of __CYGWIN32__.

cgf

2001-10-22  Christopher Faylor  <cgf@redhat.com>
 
 	* libc/posix/execvp.c: Remove obsolete CYGWIN32 considerations
 	throughout.
 	* signal.h: Change comment to reflect __CYGWIN__ rather than __CYGWIN32__.
 	* popen.c (popen): Use __CYGWIN_ rather than __CYGWIN32__.
 	* system.c (_system_r): Ditto.

Index: libc/include/sys/signal.h
===================================================================
RCS file: /cvs/uberbaum/newlib/libc/include/sys/signal.h,v
retrieving revision 1.8
diff -p -r1.8 signal.h
*** libc/include/sys/signal.h	2001/04/12 00:05:57	1.8
--- libc/include/sys/signal.h	2001/10/22 16:39:39
*************** int _EXFUN(sigqueue, (pid_t pid, int sig
*** 178,184 ****
  
  #endif /* defined(_POSIX_REALTIME_SIGNALS) */
  
! #endif /* defined(__CYGWIN32__) || defined(__rtems__) */
  
  /* #endif __STRICT_ANSI__ */
  
--- 178,184 ----
  
  #endif /* defined(_POSIX_REALTIME_SIGNALS) */
  
! #endif /* defined(__CYGWIN__) || defined(__rtems__) */
  
  /* #endif __STRICT_ANSI__ */
  
Index: libc/posix/execvp.c
===================================================================
RCS file: /cvs/uberbaum/newlib/libc/posix/execvp.c,v
retrieving revision 1.4
diff -p -r1.4 execvp.c
*** libc/posix/execvp.c	2000/11/21 23:57:25	1.4
--- libc/posix/execvp.c	2001/10/22 16:39:39
***************
*** 11,22 ****
  #include <errno.h>
  #include <ctype.h>
  
- #ifdef __CYGWIN32__
- static char path_delim;
- #define PATH_DELIM path_delim
- #else
  #define PATH_DELIM ':'
- #endif
  
  /*
   * Copy string, until c or <nul> is encountered.
--- 11,17 ----
*************** _DEFUN (execvp, (file, argv),
*** 52,75 ****
  
    /* If FILE contains a directory, don't search $PATH.  */
    if (strchr (file, '/')
- #ifdef __CYGWIN32__
-       || strchr (file, '\\')
- #endif
        )
      return execv (file, argv);
- 
- #ifdef __CYGWIN32__
-   /* If a drive letter is passed, the path is still an absolute one.
-      Technically this isn't true, but Cygwin is currently defined so
-      that it is.  */
-   if ((isalpha (file[0]) && file[1] == ':')
-       || file[0] == '\\')
-     return execv (file, argv);
- #endif
- 
- #ifdef __CYGWIN32__
-   path_delim = cygwin_posix_path_list_p (path) ? ':' : ';';
- #endif
  
    while (*path)
      {
--- 47,54 ----
Index: libc/posix/popen.c
===================================================================
RCS file: /cvs/uberbaum/newlib/libc/posix/popen.c,v
retrieving revision 1.2
diff -p -r1.2 popen.c
*** libc/posix/popen.c	2000/08/24 22:32:38	1.2
--- libc/posix/popen.c	2001/10/22 16:39:39
*************** popen(program, type)
*** 106,112 ****
  			(void)close(pdes[1]);
  		}
  		execl(_PATH_BSHELL, "sh", "-c", program, NULL);
! #ifdef __CYGWIN32__
  		/* On cygwin32, we may not have /bin/sh.  In that
                     case, try to find sh on PATH.  */
  		execlp("sh", "sh", "-c", program, NULL);
--- 106,112 ----
  			(void)close(pdes[1]);
  		}
  		execl(_PATH_BSHELL, "sh", "-c", program, NULL);
! #ifdef __CYGWIN__
  		/* On cygwin32, we may not have /bin/sh.  In that
                     case, try to find sh on PATH.  */
  		execlp("sh", "sh", "-c", program, NULL);
Index: libc/stdlib/system.c
===================================================================
RCS file: /cvs/uberbaum/newlib/libc/stdlib/system.c,v
retrieving revision 1.5
diff -p -r1.5 system.c
*** libc/stdlib/system.c	2000/12/04 18:29:29	1.5
--- libc/stdlib/system.c	2001/10/22 16:39:39
*************** _system_r (ptr, s)
*** 81,87 ****
       For now we always return 0 and leave it to each target to explicitly
       handle otherwise (this can always be relaxed in the future).  */
  
! #if defined (unix) || defined (__CYGWIN32__)
    if (s == NULL)
      return 1;
    return do_system (ptr, s);
--- 81,87 ----
       For now we always return 0 and leave it to each target to explicitly
       handle otherwise (this can always be relaxed in the future).  */
  
! #if defined (unix) || defined (__CYGWIN__)
    if (s == NULL)
      return 1;
    return do_system (ptr, s);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]