aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/generic/lockf.c3
-rw-r--r--sysdeps/i386/i486/bits/string.h9
2 files changed, 7 insertions, 5 deletions
diff --git a/sysdeps/generic/lockf.c b/sysdeps/generic/lockf.c
index 6e8851bed7..cc264cda56 100644
--- a/sysdeps/generic/lockf.c
+++ b/sysdeps/generic/lockf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994, 1996, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1994, 1996, 1997, 1998, 2000 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
@@ -41,6 +41,7 @@ lockf (int fd, int cmd, off_t len)
case F_TEST:
/* Test the lock: return 0 if FD is unlocked or locked by this process;
return -1, set errno to EACCES, if another process holds the lock. */
+ fl.l_type = F_RDLCK;
if (__fcntl (fd, F_GETLK, &fl) < 0)
return -1;
if (fl.l_type == F_UNLCK || fl.l_pid == __getpid ())
diff --git a/sysdeps/i386/i486/bits/string.h b/sysdeps/i386/i486/bits/string.h
index 9d88ee3149..c880f94eed 100644
--- a/sysdeps/i386/i486/bits/string.h
+++ b/sysdeps/i386/i486/bits/string.h
@@ -987,8 +987,9 @@ __strcat_g (char *__dest, __const char *__src)
__builtin_constant_p (src) && __builtin_constant_p (n) \
? (strlen (src) < ((size_t) (n)) \
? strcat (__dest, src) \
- : (memcpy (strchr (__dest, '\0'), \
- (__const char *) src, n), __dest)) \
+ : (*((char *)__mempcpy (strchr (__dest, '\0'), \
+ (__const char *) src, n)) = 0, \
+ __dest)) \
: __strncat_g (__dest, src, n); }))
__STRING_INLINE char *__strncat_g (char *__dest, __const char __src[],
@@ -1543,7 +1544,7 @@ __strcspn_g (__const char *__s, __const char *__reject)
#define strspn(s, accept) \
(__extension__ (__builtin_constant_p (accept) && sizeof ((accept)[0]) == 1 \
? ((accept)[0] == '\0' \
- ? 0 \
+ ? ((void) (s), 0) \
: ((accept)[1] == '\0' \
? __strspn_c1 (s, (((accept)[0] << 8 ) & 0xff00)) \
: __strspn_cg (s, accept, strlen (accept)))) \
@@ -1656,7 +1657,7 @@ __strspn_g (__const char *__s, __const char *__accept)
#define strpbrk(s, accept) \
(__extension__ (__builtin_constant_p (accept) && sizeof ((accept)[0]) == 1 \
? ((accept)[0] == '\0' \
- ? NULL \
+ ? ((void) (s), NULL) \
: ((accept)[1] == '\0' \
? strchr (s, (accept)[0]) \
: __strpbrk_cg (s, accept, strlen (accept)))) \