From fd450adfe7378555bc79b356caa28fe7e1875d35 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Tue, 18 Nov 2008 21:47:44 +0000 Subject: [PATCH] 2008-11-18 Jeff Johnston * libc/unix/basename.c: Add !_NO_BASENAME flag check so code can be ignored if desired by a platform. * libc/unix/dirname.c: Ditto except replace BASENAME with file name. * libc/unix/getcwd.c: Ditto. * libc/unix/getlogin.c: Ditto. * libc/unix/getpass.c: Ditto. * libc/unix/getpwent.c: Ditto. * libc/unix/getut.c: Ditto. * libc/unix/pread.c: Ditto. * libc/unix/pwrite.c: Ditto. * libc/unix/sigset.c: Ditto. --- newlib/ChangeLog | 14 ++++++++++++++ newlib/libc/unix/basename.c | 3 +++ newlib/libc/unix/dirname.c | 4 ++++ newlib/libc/unix/getcwd.c | 6 ++---- newlib/libc/unix/getlogin.c | 3 +++ newlib/libc/unix/getpass.c | 4 ---- newlib/libc/unix/getpwent.c | 4 ++++ newlib/libc/unix/getut.c | 4 ++++ newlib/libc/unix/pread.c | 4 +++- newlib/libc/unix/pwrite.c | 4 +++- newlib/libc/unix/sigset.c | 3 +++ 11 files changed, 43 insertions(+), 10 deletions(-) diff --git a/newlib/ChangeLog b/newlib/ChangeLog index d69b52e86..dcb7c6e27 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,17 @@ +2008-11-18 Jeff Johnston + + * libc/unix/basename.c: Add !_NO_BASENAME flag check so code can be + ignored if desired by a platform. + * libc/unix/dirname.c: Ditto except replace BASENAME with file name. + * libc/unix/getcwd.c: Ditto. + * libc/unix/getlogin.c: Ditto. + * libc/unix/getpass.c: Ditto. + * libc/unix/getpwent.c: Ditto. + * libc/unix/getut.c: Ditto. + * libc/unix/pread.c: Ditto. + * libc/unix/pwrite.c: Ditto. + * libc/unix/sigset.c: Ditto. + 2008-11-18 Craig Howland * libc/unix/ttyname.c: Add ttyname_r and change ttyname to use diff --git a/newlib/libc/unix/basename.c b/newlib/libc/unix/basename.c index 703e532d5..3a9cc0c19 100644 --- a/newlib/libc/unix/basename.c +++ b/newlib/libc/unix/basename.c @@ -1,3 +1,4 @@ +#ifndef _NO_BASENAME /* Copyright 2005 Shaun Jackman * Permission to use, copy, modify, and distribute this software * is freely granted, provided that this notice is preserved. @@ -23,3 +24,5 @@ _DEFUN (basename, (path), p--; return p + 1; } + +#endif /* !_NO_BASENAME */ diff --git a/newlib/libc/unix/dirname.c b/newlib/libc/unix/dirname.c index f026e3056..164da7f78 100644 --- a/newlib/libc/unix/dirname.c +++ b/newlib/libc/unix/dirname.c @@ -1,3 +1,5 @@ +#ifndef _NO_DIRNAME + /* Copyright 2005 Shaun Jackman * Permission to use, copy, modify, and distribute this software * is freely granted, provided that this notice is preserved. @@ -26,3 +28,5 @@ _DEFUN (dirname, (path), p == path ? "/" : (*p = '\0', path); } + +#endif /* !_NO_DIRNAME */ diff --git a/newlib/libc/unix/getcwd.c b/newlib/libc/unix/getcwd.c index f57e14742..b49a4b6e0 100644 --- a/newlib/libc/unix/getcwd.c +++ b/newlib/libc/unix/getcwd.c @@ -1,3 +1,4 @@ +#ifndef _NO_GETCWD /* * Copyright (c) 1989, 1991 The Regents of the University of California. * All rights reserved. @@ -10,10 +11,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. @@ -263,3 +260,4 @@ err: } #endif /* _REENT_ONLY */ +#endif /* !_NO_GETCWD */ diff --git a/newlib/libc/unix/getlogin.c b/newlib/libc/unix/getlogin.c index ea4ca2983..da4f47a95 100644 --- a/newlib/libc/unix/getlogin.c +++ b/newlib/libc/unix/getlogin.c @@ -1,3 +1,5 @@ +#ifndef _NO_GETLOGIN + #include #include #include @@ -40,3 +42,4 @@ getlogin () close (utmp_fd); return 0; } +#endif /* !_NO_GETLOGIN */ diff --git a/newlib/libc/unix/getpass.c b/newlib/libc/unix/getpass.c index 69327ba05..6bd1c44a9 100644 --- a/newlib/libc/unix/getpass.c +++ b/newlib/libc/unix/getpass.c @@ -10,10 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. diff --git a/newlib/libc/unix/getpwent.c b/newlib/libc/unix/getpwent.c index 5390c682f..0f13a20f7 100644 --- a/newlib/libc/unix/getpwent.c +++ b/newlib/libc/unix/getpwent.c @@ -1,3 +1,5 @@ +#ifndef _NO_GETPWENT + #include #include #include @@ -125,3 +127,5 @@ endpwent () if (passwd_fp != NULL) fclose (passwd_fp); } + +#endif /* !_NO_GETPWENT */ diff --git a/newlib/libc/unix/getut.c b/newlib/libc/unix/getut.c index 554ed3ca1..cf054cb46 100644 --- a/newlib/libc/unix/getut.c +++ b/newlib/libc/unix/getut.c @@ -1,3 +1,5 @@ +#ifndef _NO_GETUT + #include #include #include @@ -84,3 +86,5 @@ getutline (struct utmp *line) return 0; } + +#endif /* !_NO_GETUT */ diff --git a/newlib/libc/unix/pread.c b/newlib/libc/unix/pread.c index 72087542e..770c3fcf0 100644 --- a/newlib/libc/unix/pread.c +++ b/newlib/libc/unix/pread.c @@ -1,3 +1,4 @@ +#ifndef _NO_PREAD /* FUNCTION <>---read a file from specified position @@ -88,4 +89,5 @@ _DEFUN (pread, (fd, buf, n, off), return _pread_r (_REENT, fd, buf, n, off); } -#endif +#endif /* !_REENT_ONLY */ +#endif /* !_NO_PREAD */ diff --git a/newlib/libc/unix/pwrite.c b/newlib/libc/unix/pwrite.c index 23979ac79..9f2a89835 100644 --- a/newlib/libc/unix/pwrite.c +++ b/newlib/libc/unix/pwrite.c @@ -1,3 +1,4 @@ +#ifndef _NO_PWRITE /* FUNCTION <>---write a file from specified position @@ -89,4 +90,5 @@ _DEFUN (pwrite, (fd, buf, n, off), return _pwrite_r (_REENT, fd, buf, n, off); } -#endif +#endif /* !_REENT_ONLY */ +#endif /* !_NO_PWRITE */ diff --git a/newlib/libc/unix/sigset.c b/newlib/libc/unix/sigset.c index 867fb94c3..186134956 100644 --- a/newlib/libc/unix/sigset.c +++ b/newlib/libc/unix/sigset.c @@ -1,3 +1,5 @@ +#ifndef _NO_SIGSET + #include #include @@ -62,3 +64,4 @@ sigismember (const sigset_t * set, int signo) } #endif /* SIG_SETMASK */ +#endif /* _NO_SIGSET */