aboutsummaryrefslogtreecommitdiff
path: root/posix
diff options
context:
space:
mode:
Diffstat (limited to 'posix')
-rw-r--r--posix/confstr.c19
-rw-r--r--posix/execvp.c2
-rw-r--r--posix/glob.c10
3 files changed, 17 insertions, 14 deletions
diff --git a/posix/confstr.c b/posix/confstr.c
index 5b4a7be..b511ea0 100644
--- a/posix/confstr.c
+++ b/posix/confstr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
-#include <ansidecl.h>
#include <stddef.h>
#include <errno.h>
#include <unistd.h>
@@ -27,28 +26,30 @@ Cambridge, MA 02139, USA. */
with the value corresponding to NAME. Return the number
of characters required to hold NAME's entire value. */
size_t
-DEFUN(confstr, (name, buf, len),
- int name AND char *buf AND size_t len)
+confstr (name, buf, len)
+ int name;
+ char *buf;
+ size_t len;
{
- CONST char *string;
+ const char *string;
size_t string_len;
switch (name)
{
case _CS_PATH:
{
- static CONST char cs_path[] = CS_PATH;
+ static const char cs_path[] = CS_PATH;
string = cs_path;
- string_len = sizeof(cs_path);
+ string_len = sizeof (cs_path);
}
break;
default:
- errno = EINVAL;
+ __set_errno (EINVAL);
return 0;
}
if (buf != NULL)
- (void) strncpy(buf, string, len);
+ (void) strncpy (buf, string, len);
return string_len;
}
diff --git a/posix/execvp.c b/posix/execvp.c
index a1fcb79..400e082 100644
--- a/posix/execvp.c
+++ b/posix/execvp.c
@@ -135,7 +135,7 @@ execvp (file, argv)
if (got_eacces)
/* At least one failure was due to permissions, so report that error. */
- errno = EACCES;
+ __set_errno (EACCES);
/* Return the error from the last attempt (probably ENOENT). */
return -1;
diff --git a/posix/glob.c b/posix/glob.c
index 76060e1..b8820ce 100644
--- a/posix/glob.c
+++ b/posix/glob.c
@@ -72,6 +72,9 @@ Cambridge, MA 02139, USA. */
#if !defined(__GNU_LIBRARY__) && !defined(STDC_HEADERS)
extern int errno;
#endif
+#ifndef __set_errno
+#define __set_errno(val) errno = (val)
+#endif
#ifndef NULL
#define NULL 0
@@ -274,7 +277,7 @@ glob (pattern, flags, errfunc, pglob)
if (pattern == NULL || pglob == NULL || (flags & ~__GLOB_FLAGS) != 0)
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
@@ -880,7 +883,7 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
(*pglob->gl_closedir) (stream);
else
closedir ((DIR *) stream);
- errno = save;
+ __set_errno (save);
}
return nfound == 0 ? GLOB_NOMATCH : 0;
@@ -891,7 +894,7 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
(*pglob->gl_closedir) (stream);
else
closedir ((DIR *) stream);
- errno = save;
+ __set_errno (save);
}
while (names != NULL)
{
@@ -903,4 +906,3 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
}
#endif /* Not ELIDE_CODE. */
-