about summary refs log tree commit diff
path: root/sysdeps/posix
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/posix')
-rw-r--r--sysdeps/posix/defs.c2
-rw-r--r--sysdeps/posix/getcwd.c2
-rw-r--r--sysdeps/posix/pipestream.c20
-rw-r--r--sysdeps/posix/profil.c3
-rw-r--r--sysdeps/posix/sleep.c3
-rw-r--r--sysdeps/posix/stdio_init.c3
6 files changed, 14 insertions, 19 deletions
diff --git a/sysdeps/posix/defs.c b/sysdeps/posix/defs.c
index bc0d34bf15..b25b9b0fea 100644
--- a/sysdeps/posix/defs.c
+++ b/sysdeps/posix/defs.c
@@ -63,7 +63,7 @@ FILE *__stdio_head = &stdstreams[0];
    to cause _cleanup to be linked in.  */
 
 void
-_cleanup ()
+_cleanup (void)
 {
   __fcloseall ();
 }
diff --git a/sysdeps/posix/getcwd.c b/sysdeps/posix/getcwd.c
index fa3cf98c74..865bd3fa6a 100644
--- a/sysdeps/posix/getcwd.c
+++ b/sysdeps/posix/getcwd.c
@@ -326,7 +326,7 @@ __getcwd (buf, size)
 	{
 	  size_t namlen = _D_EXACT_NAMLEN (d);
 
-	  if ((size_t) (pathp - path) < namlen)
+	  if ((size_t) (pathp - path) <= namlen)
 	    {
 	      if (buf != NULL)
 		{
diff --git a/sysdeps/posix/pipestream.c b/sysdeps/posix/pipestream.c
index 6041f830e7..31348b8976 100644
--- a/sysdeps/posix/pipestream.c
+++ b/sysdeps/posix/pipestream.c
@@ -41,8 +41,8 @@ struct child
    These all simply call the corresponding
    original function with the original cookie.  */
 
-#define FUNC(type, name, args)						      \
-  static type __CONCAT(child_,name) args __CONCAT(name,decl)		      \
+#define FUNC(type, name, proto, args)					      \
+  static type __CONCAT(child_,name) proto				      \
   {									      \
     struct child *c = (struct child *) cookie;				      \
     {									      \
@@ -51,16 +51,12 @@ struct child
     }									      \
   }
 
-#define readdecl void *cookie; register char *buf; register size_t n;
-FUNC (int, read, (cookie, buf, n))
-#define writedecl void *cookie; register const char *buf; register size_t n;
-FUNC (int, write, (cookie, buf, n))
-#define seekdecl void *cookie; fpos_t *pos; int whence;
-FUNC (int, seek, (cookie, pos, whence))
-#define closedecl void *cookie;
-FUNC (int, close, (cookie))
-#define filenodecl void *cookie;
-FUNC (int, fileno, (cookie))
+FUNC (int, read, (void *cookie, char *buf, size_t n), (cookie, buf, n))
+FUNC (int, write, (void *cookie, const char *buf, size_t n), (cookie, buf, n))
+FUNC (int, seek, (void *cookie, fpos_t *pos, int whence),
+      (cookie, pos, whence))
+FUNC (int, close, (void *cookie), (cookie))
+FUNC (int, fileno, (void *cookie), (cookie))
 
 static const __io_functions child_funcs
   = { child_read, child_write, child_seek, child_close, child_fileno };
diff --git a/sysdeps/posix/profil.c b/sysdeps/posix/profil.c
index a51baf3713..734111efbb 100644
--- a/sysdeps/posix/profil.c
+++ b/sysdeps/posix/profil.c
@@ -60,7 +60,7 @@ profil_count (void *pc)
    disable profiling.  Returns zero on success, -1 on error.  */
 
 int
-profil (u_short *sample_buffer, size_t size, size_t offset, u_int scale)
+__profil (u_short *sample_buffer, size_t size, size_t offset, u_int scale)
 {
   static struct sigaction act, oact;
   static struct itimerval timer, otimer;
@@ -103,5 +103,6 @@ profil (u_short *sample_buffer, size_t size, size_t offset, u_int scale)
   timer.it_interval = timer.it_value;
   return setitimer (ITIMER_PROF, &timer, &otimer);
 }
+weak_alias (__profil, profil)
 
 #endif
diff --git a/sysdeps/posix/sleep.c b/sysdeps/posix/sleep.c
index e6d8de45ad..5933be6835 100644
--- a/sysdeps/posix/sleep.c
+++ b/sysdeps/posix/sleep.c
@@ -25,8 +25,7 @@
 /* SIGALRM signal handler for `sleep'.  This does nothing but return,
    but SIG_IGN isn't supposed to break `pause'.  */
 static void
-sleep_handler (sig)
-     int sig;
+sleep_handler (int sig)
 {
   return;
 }
diff --git a/sysdeps/posix/stdio_init.c b/sysdeps/posix/stdio_init.c
index 6847d1fdc9..4dc7028133 100644
--- a/sysdeps/posix/stdio_init.c
+++ b/sysdeps/posix/stdio_init.c
@@ -26,8 +26,7 @@
    If no buffer is allocated, but the bufsize is set,
    the bufsize will be used to allocate the buffer.  */
 void
-__stdio_init_stream (stream)
-     FILE *stream;
+__stdio_init_stream (FILE *stream)
 {
   const int fd = (int) stream->__cookie;
   struct stat statb;